]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove --with-default-link configure option
authorAdhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Tue, 27 Dec 2022 21:11:44 +0000 (18:11 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 27 Mar 2023 16:57:55 +0000 (13:57 -0300)
Now that there is no need to use a special linker script to hardening
internal data structures, remove the --with-default-link configure
option and associated definitions.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
INSTALL
Makerules
config.make.in
configure
configure.ac
elf/Makefile
iconvdata/extra-module.mk
manual/install.texi

diff --git a/INSTALL b/INSTALL
index 970d6627e28012fdc3a7dd4a9123d46a80ffaebb..cc1bfe9cbbcfbbce4c6d27e595a8555245d59643 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -90,12 +90,6 @@ if 'CFLAGS' is specified it must enable optimization.  For example:
      library will still be usable, but functionality may be lost--for
      example, you can't build a shared libc with old binutils.
 
-'--with-default-link'
-     With '--with-default-link', the build system does not use a custom
-     linker script for linking shared objects.  The default is
-     '--without-default-link', because the custom linker script is
-     needed for full RELRO protection.
-
 '--with-nonshared-cflags=CFLAGS'
      Use additional compiler flags CFLAGS to build the parts of the
      library which are always statically linked into applications and
index 16887cb44304ae1a18c6253d9ecfcabb31c48c41..31064470e52c8393d8a52d811cec117ba4a56af2 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -544,13 +544,8 @@ $(LINK.o) -shared -static-libgcc -Wl,-O1 $(sysdep-LDFLAGS) \
          -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link)
 endef
 
-# If the linker is good enough, we can let it use its default linker script.
-# In the long term the custom linker script will be removed.
-shlib-lds =
-shlib-lds-flags =
-
 define build-shlib
-$(build-shlib-helper) -o $@ $(shlib-lds-flags) \
+$(build-shlib-helper) -o $@ \
          $(csu-objpfx)abi-note.o $(build-shlib-objlist)
 endef
 
@@ -569,12 +564,12 @@ endef
 # binutils only position loadable notes into the first page for binaries,
 # not for shared objects
 define build-module
-$(build-module-helper) -o $@ $(shlib-lds-flags) \
+$(build-module-helper) -o $@ \
          $(csu-objpfx)abi-note.o $(build-module-objlist) $(link-libc-args)
 $(call after-link,$@)
 endef
 define build-module-asneeded
-$(build-module-helper) -o $@ $(shlib-lds-flags) \
+$(build-module-helper) -o $@ \
          $(csu-objpfx)abi-note.o \
          -Wl,--as-needed $(build-module-objlist) -Wl,--no-as-needed \
          $(link-libc-args)
@@ -606,7 +601,6 @@ $(common-objpfx)libc_pic.os: $(common-objpfx)libc_pic.a
        $(LINK.o) -nostdlib -nostartfiles -r -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.
 $(common-objpfx)libc_pic.opts: $(common-objpfx)libc_pic.os
        $(OBJDUMP) -h $< | \
@@ -620,7 +614,6 @@ $(common-objpfx)libc_pic.os.clean: $(common-objpfx)libc_pic.opts \
 generated += libc_pic.opts libc_pic.os.clean
 
 libc_pic_clean := .clean
-endif
 
 # Build a possibly-modified version of libc_pic.a for use in building
 # linkobj/libc.so.
@@ -650,16 +643,14 @@ $(common-objpfx)linkobj/libc.so: link-libc-deps = # empty
 $(common-objpfx)libc.so: $(common-objpfx)libc_pic.os$(libc_pic_clean) \
                         $(elf-objpfx)sofini.os \
                         $(elf-objpfx)interp.os \
-                        $(elf-objpfx)ld.so \
-                        $(shlib-lds)
+                        $(elf-objpfx)ld.so
        $(build-shlib)
        $(call after-link,$@)
 
 $(common-objpfx)linkobj/libc.so: $(common-objpfx)linkobj/libc_pic.a \
                         $(elf-objpfx)sofini.os \
                         $(elf-objpfx)interp.os \
-                        $(elf-objpfx)ld.so \
-                        $(shlib-lds)
+                        $(elf-objpfx)ld.so
        $(build-shlib)
        $(call after-link,$@)
 
@@ -720,7 +711,7 @@ endif
 
 extra-modules-build := $(filter-out $(modules-names-nobuild),$(modules-names))
 $(extra-modules-build:%=$(objpfx)%.so): $(objpfx)%.so: \
-               $(objpfx)%.os $(shlib-lds) $(link-libs-deps)
+               $(objpfx)%.os $(link-libs-deps)
        $(build-module)
 endif
 \f
index d7c416cbea066eb850a97091671c22e4dd3fb6f3..befcc226259f604970f1e47027869eb13dc40d01 100644 (file)
@@ -69,7 +69,6 @@ have-libaudit = @have_libaudit@
 have-libcap = @have_libcap@
 have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
 bind-now = @bindnow@
-use-default-link = @use_default_link@
 have-cxx-thread_local = @libc_cv_cxx_thread_local@
 have-loop-to-function = @libc_cv_cc_loop_to_function@
 have-textrel_ifunc = @libc_cv_textrel_ifunc@
index efb891456ae9f8eb157da1e2160f04b0a6f5bc56..c5a831e3cd6f45a9277c306c568c26b1e758b081 100755 (executable)
--- a/configure
+++ b/configure
@@ -680,7 +680,6 @@ hardcoded_path_in_tests
 enable_timezone_tools
 rtld_early_cflags
 extra_nonshared_cflags
-use_default_link
 sysheaders
 ac_ct_CXX
 CXXFLAGS
@@ -756,7 +755,6 @@ with_gd_lib
 with_binutils
 with_selinux
 with_headers
-with_default_link
 with_nonshared_cflags
 with_rtld_early_cflags
 with_timeoutfactor
@@ -1475,7 +1473,6 @@ Optional Packages:
   --with-selinux          if building with SELinux support
   --with-headers=PATH     location of system headers to use (for example
                           /usr/src/linux/include) [default=compiler default]
-  --with-default-link     do not use explicit linker scripts
   --with-nonshared-cflags=CFLAGS
                           build nonshared libraries with additional CFLAGS
   --with-rtld-early-cflags=CFLAGS
@@ -3275,16 +3272,6 @@ fi
 
 
 
-
-# Check whether --with-default-link was given.
-if test "${with_default_link+set}" = set; then :
-  withval=$with_default_link; use_default_link=$withval
-else
-  use_default_link=no
-fi
-
-
-
 # Check whether --with-nonshared-cflags was given.
 if test "${with_nonshared_cflags+set}" = set; then :
   withval=$with_nonshared_cflags; extra_nonshared_cflags=$withval
index 011844a3d4e3937c87e539e951cb17c8b841dbaa..88a6a88220ebaebebed7b1a61b84064bd747cd28 100644 (file)
@@ -147,13 +147,6 @@ AC_ARG_WITH([headers],
            [sysheaders=''])
 AC_SUBST(sysheaders)
 
-AC_SUBST(use_default_link)
-AC_ARG_WITH([default-link],
-           AS_HELP_STRING([--with-default-link],
-                          [do not use explicit linker scripts]),
-           [use_default_link=$withval],
-           [use_default_link=no])
-
 dnl Additional build flags injection.
 AC_ARG_WITH([nonshared-cflags],
            AS_HELP_STRING([--with-nonshared-cflags=CFLAGS],
index be6f2ca068976ffea8f3ca49cb710a0b0e41cd83..a32618a01f4b8aa8cb309b9eb52cb3eb37dfc8ad 100644 (file)
@@ -1242,8 +1242,6 @@ endif
 # Command to link into a larger single relocatable object.
 reloc-link = $(LINK.o) -nostdlib -nostartfiles -r
 
-$(objpfx)sotruss-lib.so: $(shlib-lds)
-
 $(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os)
        $(reloc-link) -o $@ $^
 
index ecaf50762496586e4b2a36a698aa12e70b6530be..a81665976365e027ce46b5bbd4e987e4b055dc44 100644 (file)
@@ -4,7 +4,7 @@ extra-modules-left := $(strip $(filter-out $(mod),$(extra-modules-left)))
 extra-objs := $(extra-objs) $(patsubst %,%.os,$($(mod)-routines))
 
 $(objpfx)$(mod).so: $(addprefix $(objpfx),$(addsuffix .os,$($(mod)-routines)))\
-                   $(shlib-lds) $(link-libc-deps)
+                   $(link-libc-deps)
        $(build-module-asneeded)
 
 ifneq (,$(extra-modules-left))
index 260f8a5c8240a02319e6932082f33eadb2cb8269..60fca21aedc9b550e80a2757e64ae6e04987eae1 100644 (file)
@@ -117,12 +117,6 @@ problem and suppress these constructs, so that the library will still be
 usable, but functionality may be lost---for example, you can't build a
 shared libc with old binutils.
 
-@item --with-default-link
-With @code{--with-default-link}, the build system does not use a custom
-linker script for linking shared objects.  The default is
-@code{--without-default-link}, because the custom linker script is
-needed for full RELRO protection.
-
 @item --with-nonshared-cflags=@var{cflags}
 Use additional compiler flags @var{cflags} to build the parts of the
 library which are always statically linked into applications and