glibc/sysdeps/arm
Adhemerval Zanella 4af6982e4c elf: Fix elf_get_dynamic_info definition
Before to 490e6c62aa ('elf: Avoid nested functions in the loader
[BZ #27220]'), elf_get_dynamic_info() was defined twice on rtld.c: on
the first dynamic-link.h include and later within _dl_start().  The
former definition did not define DONT_USE_BOOTSTRAP_MAP and it is used
on setup_vdso() (since it is a global definition), while the former does
define DONT_USE_BOOTSTRAP_MAP and it is used on loader self-relocation.

With the commit change, the function is now included and defined once
instead of defined as a nested function.  So rtld.c defines without
defining RTLD_BOOTSTRAP and it brokes at least powerpc32.

This patch fixes by moving the get-dynamic-info.h include out of
dynamic-link.h, which then the caller can corirectly set the expected
semantic by defining STATIC_PIE_BOOTSTRAP, RTLD_BOOTSTRAP, and/or
RESOLVE_MAP.

It also required to enable some asserts only for the loader bootstrap
to avoid issues when called from setup_vdso().

As a side note, this is another issues with nested functions: it is
not clear from pre-processed output (-E -dD) how the function will
be build and its semantic (since nested function will be local and
extra C defines may change it).

I checked on x86_64-linux-gnu (w/o --enable-static-pie),
i686-linux-gnu, powerpc64-linux-gnu, powerpc-linux-gnu-power4,
aarch64-linux-gnu, arm-linux-gnu, sparc64-linux-gnu, and
s390x-linux-gnu.

Reviewed-by: Fangrui Song <maskray@google.com>
2021-10-12 13:25:43 -03:00
..
armv6 Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
armv6t2 Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
armv7 Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
be arm: Fix softp-fp Implies (BZ #25635) 2020-03-06 09:53:24 -03:00
bits Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
include/bits Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
le arm: Fix softp-fp Implies (BZ #25635) 2020-03-06 09:53:24 -03:00
nofpu Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nptl elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
sys Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
__longjmp.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
add_n.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
addmul_1.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_assert.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_atexit.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_errno_addr.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_lcsts.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_localeconv.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_math.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_mb_cur_max.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_memclr.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_memcpy.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_memmove.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_memset.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_sighandlers.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_unwind_cpp_pr1.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
arm-features.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
arm-ifunc.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
arm-mcount.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
arm-unwind-resume.S Implement _Unwind_Resume in libc on top of <unwind-link.h> 2021-03-01 16:00:03 +01:00
atomic-machine.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
backtrace.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
bsd-_setjmp.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
bsd-setjmp.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
configure Remove configure test for ARM TLS descriptors support. 2015-10-27 23:56:50 +00:00
configure.ac Remove configure test for ARM TLS descriptors support. 2015-10-27 23:56:50 +00:00
crti.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
crtn.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-irel.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-lookupcfg.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-machine.h elf: Fix elf_get_dynamic_info definition 2021-10-12 13:25:43 -03:00
dl-sysdep.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-tls.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-tlsdesc.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-tlsdesc.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-trampoline.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
elf-initfini.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fclrexcpt.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fedisblxcpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
feenablxcpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fegetenv.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fegetexcept.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fegetmode.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fegetround.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
feholdexcpt.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fenv_private.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fesetenv.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fesetexcept.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fesetmode.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fesetround.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
feupdateenv.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fgetexcptflg.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
find_exidx.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fix-fp-int-convert-overflow.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fpu_control.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fraiseexcpt.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
framestate.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
fsetexcptflg.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
ftestexcept.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
gcc-compat.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
gccframe.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
get-rounding-mode.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
Implies Remove sysdeps/arm/soft-fp directory. 2014-10-16 09:54:45 -07:00
jmpbuf-unwind.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
ldbl-classify-compat.h Move LDBL_CLASSIFY_COMPAT to its own header. 2018-02-01 21:01:00 +00:00
ldsodefs.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
libc-aeabi_read_tp.S ARM: Move more aeabi routine magic out of Linux-specific directories 2014-06-26 15:08:29 -07:00
libc-tls.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
libm-test-ulps arm: update libm test ulps 2021-04-08 09:55:33 +01:00
libm-test-ulps-name Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00
linkmap.h Rename bits/linkmap.h to linkmap.h (bug 14912). 2015-09-04 19:44:27 +00:00
machine-gmon.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
Makefile nptl: Move __pthread_unwind_next into libc 2021-04-21 19:49:50 +02:00
math-tests-trap.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
math-use-builtins-sqrt.h arm: Use sqrt{f} builtin 2020-06-22 11:09:50 -03:00
memcpy.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
memmove.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
memset.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
memusage.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
preconfigure arm: Split BE/LE abilist 2019-08-29 09:58:21 -03:00
preconfigure.ac arm: Split BE/LE abilist 2019-08-29 09:58:21 -03:00
rt-aeabi_unwind_cpp_pr1.c ARM: Move more aeabi routine magic out of Linux-specific directories 2014-06-26 15:08:29 -07:00
rt-arm-unwind-resume.S ARM: Consolidate with generic unwinder wrapper code 2015-01-05 15:42:16 -08:00
rtld-global-offsets.sym Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
setfpucw.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
setjmp.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
sfp-machine.h Remove sysdeps/arm/soft-fp directory. 2014-10-16 09:54:45 -07:00
sotruss-lib.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
stackinfo.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
stap-probe-machine.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
start.S Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
static-stubs.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
strlen.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
sub_n.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
submul_1.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
sysdep.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
test-fpucw.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
tlsdesc.c elf: Remove lazy tlsdesc relocation related code 2021-04-21 14:35:53 +01:00
tlsdesc.sym Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
tst-armtlsdescextlazy.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdescextlazymod.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdescextnow.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdescextnowmod.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdescloc.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-armtlsdesclocmod.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-audit.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
unwind-arch.h Implement _Unwind_Resume in libc on top of <unwind-link.h> 2021-03-01 16:00:03 +01:00
unwind-dw2-fde-glibc.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
unwind-pe.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
unwind-resume.c Implement _Unwind_Resume in libc on top of <unwind-link.h> 2021-03-01 16:00:03 +01:00
unwind-resume.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
unwind.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
Versions Use -Werror=undef for assembly code. 2015-02-12 13:57:32 -08:00