]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - elf/Makefile
Mark _init and _fini as hidden [BZ #23145]
[thirdparty/glibc.git] / elf / Makefile
index 8967ac2685b0eaba82c612567f394d6175aaa605..f221422de3d5b7c83408435a6c539e511d3f3898 100644 (file)
@@ -32,7 +32,7 @@ routines      = $(all-dl-routines) dl-support dl-iteratephdr \
 dl-routines    = $(addprefix dl-,load lookup object reloc deps hwcaps \
                                  runtime init fini debug misc \
                                  version profile tls origin scope \
-                                 execstack caller open close trampoline \
+                                 execstack open close trampoline \
                                  exception sort-maps)
 ifeq (yes,$(use-ldconfig))
 dl-routines += dl-cache
@@ -54,7 +54,6 @@ all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
 # But they are absent from the shared libc, because that code is in ld.so.
 elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \
                    dl-sysdep dl-exception dl-reloc-static-pie
-shared-only-routines += dl-caller
 
 # ld.so uses those routines, plus some special stuff for being the program
 # interpreter and operating independent of libc.
@@ -151,7 +150,7 @@ tests-static-normal := tst-leaks1-static tst-array1-static tst-array5-static \
               tst-linkall-static tst-env-setuid tst-env-setuid-tunables
 tests-static-internal := tst-tls1-static tst-tls2-static \
               tst-ptrguard1-static tst-stackguard1-static \
-              tst-tls1-static-non-pie
+              tst-tls1-static-non-pie tst-libc_dlvsym-static
 
 CRT-tst-tls1-static-non-pie := $(csu-objpfx)crt1.o
 tst-tls1-static-non-pie-no-pie = yes
@@ -175,7 +174,7 @@ tests += restest1 preloadtest loadfail multiload origtest resolvfail \
         tst-tls4 tst-tls5 \
         tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
         tst-tls16 tst-tls17 tst-tls18 tst-tls19 tst-tls-dlinfo \
-        tst-align tst-align2 $(tests-execstack-$(have-z-execstack)) \
+        tst-align tst-align2 \
         tst-dlmodcount tst-dlopenrpath tst-deep1 \
         tst-dlmopen1 tst-dlmopen3 \
         unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
@@ -187,12 +186,12 @@ tests += restest1 preloadtest loadfail multiload origtest resolvfail \
         tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \
         tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error tst-noload \
         tst-latepthread tst-tls-manydynamic tst-nodelete-dlclose \
-        tst-debug1 tst-main1
+        tst-debug1 tst-main1 tst-absolute-sym tst-big-note
 #       reldep9
 tests-internal += loadtest unload unload2 circleload1 \
         neededtest neededtest2 neededtest3 neededtest4 \
         tst-tls3 tst-tls6 tst-tls7 tst-tls8 tst-dlmopen2 \
-        tst-ptrguard1 tst-stackguard1
+        tst-ptrguard1 tst-stackguard1 tst-libc_dlvsym
 ifeq ($(build-hardcoded-path-in-tests),yes)
 tests += tst-dlopen-aout
 tst-dlopen-aout-no-pie = yes
@@ -203,6 +202,7 @@ ifneq ($(selinux-enabled),1)
 tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog
 endif
 endif
+tests += $(tests-execstack-$(have-z-execstack))
 ifeq ($(run-built-tests),yes)
 tests-special += $(objpfx)tst-leaks1-mem.out \
                 $(objpfx)tst-leaks1-static-mem.out $(objpfx)noload-mem.out \
@@ -272,7 +272,9 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
                tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12 \
                tst-latepthreadmod $(tst-tls-many-dynamic-modules) \
                tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin \
-               tst-main1mod
+               tst-main1mod tst-libc_dlvsym-dso tst-absolute-sym-lib \
+               tst-big-note-lib
+
 ifeq (yes,$(have-mtls-dialect-gnu2))
 tests += tst-gnu2-tls1
 modules-names += tst-gnu2-tls1mod
@@ -346,7 +348,7 @@ ifeq ($(run-built-tests),yes)
 tests-special += $(objpfx)tst-pathopt.out $(objpfx)tst-rtld-load-self.out
 endif
 tests-special += $(objpfx)check-textrel.out $(objpfx)check-execstack.out \
-                $(objpfx)check-localplt.out
+                $(objpfx)check-localplt.out $(objpfx)check-initfini.out
 endif
 
 ifeq ($(run-built-tests),yes)
@@ -1134,6 +1136,19 @@ $(objpfx)check-localplt.out: $(..)scripts/check-localplt.awk \
        $(evaluate-test)
 endif
 
+$(all-built-dso:=.dynsym): %.dynsym: %
+       @rm -f $@T
+       LC_ALL=C $(READELF) -W --dyn-syms $< > $@T
+       test -s $@T
+       mv -f $@T $@
+common-generated += $(all-built-dso:$(common-objpfx)%=%.dynsym)
+
+$(objpfx)check-initfini.out: $(..)scripts/check-initfini.awk \
+                           $(all-built-dso:=.dynsym)
+       LC_ALL=C $(AWK) -f $^ > $@; \
+       $(evaluate-test)
+generated += check-initfini.out
+
 $(objpfx)tst-dlopenrpathmod.so: $(libdl)
 $(objpfx)tst-dlopenrpath: $(objpfx)tst-dlopenrpathmod.so $(libdl)
 CFLAGS-tst-dlopenrpath.c += -DPFX=\"$(objpfx)\"
@@ -1436,3 +1451,19 @@ CRT-tst-main1 := $(csu-objpfx)crt1.o
 tst-main1-no-pie = yes
 LDLIBS-tst-main1 = $(libsupport)
 tst-main1mod.so-no-z-defs = yes
+
+LDLIBS-tst-absolute-sym-lib.so = tst-absolute-sym-lib.lds
+$(objpfx)tst-absolute-sym-lib.so: $(LDLIBS-tst-absolute-sym-lib.so)
+$(objpfx)tst-absolute-sym: $(objpfx)tst-absolute-sym-lib.so
+
+# Both the main program and the DSO for tst-libc_dlvsym need to link
+# against libdl.
+$(objpfx)tst-libc_dlvsym: $(libdl)
+$(objpfx)tst-libc_dlvsym-dso.so: $(libsupport) $(libdl)
+$(objpfx)tst-libc_dlvsym.out: $(objpfx)tst-libc_dlvsym-dso.so
+$(objpfx)tst-libc_dlvsym-static: $(common-objpfx)dlfcn/libdl.a
+tst-libc_dlvsym-static-ENV = \
+  LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn
+$(objpfx)tst-libc_dlvsym-static.out: $(objpfx)tst-libc_dlvsym-dso.so
+
+$(objpfx)tst-big-note: $(objpfx)tst-big-note-lib.so