From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 2FA8C3857405 for ; Sun, 26 Jun 2022 21:14:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2FA8C3857405 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de Received: from [172.17.203.2] (port=33277 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1o5Za2-00Df8O-7z; Sun, 26 Jun 2022 21:14:06 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1o5Za1-0008wl-Tm; Sun, 26 Jun 2022 23:14:05 +0200 From: Florian Weimer To: Fangrui Song via Libc-alpha Subject: Re: [PATCH] Makerules: Remove no-op -Wl,-d when linking libc_pic.os References: <20220626184025.553459-1-maskray@google.com> Date: Sun, 26 Jun 2022 23:14:05 +0200 In-Reply-To: <20220626184025.553459-1-maskray@google.com> (Fangrui Song via Libc-alpha's message of "Sun, 26 Jun 2022 11:40:25 -0700") Message-ID: <87tu87nn4y.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2022 21:14:14 -0000 * Fangrui Song via Libc-alpha: > In GNU ld, -d assigns space to common symbols for -r (i.e. change common > symbols to STB_GLOBAL definitions). This option was added in commit > da2d1bc5adf49352232ad0514e79fbd5dcae08e8 (1998) likely because ld at > that time had a bug that common symbols did not override shared object > definitions. -d has been long unneeded and more so since -fno-common > was added to +cflags. > --- > Makerules | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/Makerules b/Makerules > index dfe89e9e39..d1e139d03c 100644 > --- a/Makerules > +++ b/Makerules > @@ -633,14 +633,10 @@ LDFLAGS-c.so = -nostdlib -nostartfiles > LDLIBS-c.so += $(libc.so-gnulib) > # Give libc.so an entry point and make it directly runnable itself. > LDFLAGS-c.so += -e __libc_main > -# Pre-link the objects of libc_pic.a so that we can locally resolve > -# COMMON symbols before we link against ld.so. This is because ld.so > -# contains some of libc_pic.a already, which will prevent the COMMONs > -# from being allocated in libc.so, which introduces evil dependencies > -# between libc.so and ld.so, which can make it impossible to upgrade. > +# Pre-link the objects of libc_pic.a for .gnu.glibc-stub.* processing. > $(common-objpfx)libc_pic.os: $(common-objpfx)libc_pic.a > $(LINK.o) -nostdlib -nostartfiles -r -o $@ \ > - $(LDFLAGS-c_pic.os) -Wl,-d $(whole-archive) $^ -o $@ > + $(LDFLAGS-c_pic.os) $(whole-archive) $^ -o $@ > > ifeq (,$(strip $(shlib-lds-flags))) > # Generate a list of -R options to excise .gnu.glibc-stub.* sections. This looks okay to me, thanks. Do you know what the .gnu.glibc-stub.* processing processing refers to?