From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by sourceware.org (Postfix) with ESMTPS id 93C0938708A8 for ; Fri, 4 Sep 2020 11:45:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 93C0938708A8 Received: from monopod.intra.ispras.ru (unknown [10.10.3.121]) by mail.ispras.ru (Postfix) with ESMTPS id 096B240D3BFF; Fri, 4 Sep 2020 11:45:05 +0000 (UTC) Date: Fri, 4 Sep 2020 14:45:04 +0300 (MSK) From: Alexander Monakov To: Josef Wolf cc: gcc-help@gcc.gnu.org Subject: Re: Linker won't bail out on non-existing functions? In-Reply-To: <20200904101835.GB4037@raven.inka.de> Message-ID: References: <20200904101835.GB4037@raven.inka.de> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2020 11:45:07 -0000 On Fri, 4 Sep 2020, Josef Wolf wrote: > So why won't the linker bail out when it can't resolve a reference? > Any hints? You're linking with --gc-sections, and if all references to undefined functions are in discarded sections, the linker won't complain. In other words, checking for remaining undefined references happens after discarding unneeded sections. Alexander