]> sourceware.org Git - glibc.git/commitdiff
Makerules: Remove no-op -Wl,-d when linking libc_pic.os
authorFangrui Song <maskray@google.com>
Sun, 26 Jun 2022 22:31:19 +0000 (15:31 -0700)
committerFangrui Song <maskray@google.com>
Sun, 26 Jun 2022 22:31:19 +0000 (15:31 -0700)
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.

Makerules

index dfe89e9e39ad7031e5eb08813f0840ec8cbbb130..d1e139d03c1c448e14aee35af3e54ee7abe2180c 100644 (file)
--- 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 page took 0.047513 seconds and 5 git commands to generate.