From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7814) id 8B9963857BB3; Sun, 26 Jun 2022 22:31:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B9963857BB3 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Fangrui Song To: glibc-cvs@sourceware.org Subject: [glibc] Makerules: Remove no-op -Wl,-d when linking libc_pic.os X-Act-Checkin: glibc X-Git-Author: Fangrui Song X-Git-Refname: refs/heads/master X-Git-Oldrev: 01c60dc90ca404c153d51f0ddc3b5fe36d3c1099 X-Git-Newrev: dbb0f06cc09784f6229cc1736c4af8caa687975f Message-Id: <20220626223120.8B9963857BB3@sourceware.org> Date: Sun, 26 Jun 2022 22:31:20 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2022 22:31:20 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dbb0f06cc09784f6229cc1736c4af8caa687975f commit dbb0f06cc09784f6229cc1736c4af8caa687975f Author: Fangrui Song Date: Sun Jun 26 15:31:19 2022 -0700 Makerules: Remove no-op -Wl,-d when linking libc_pic.os 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) perhaps 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. Diff: --- 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.