glibc/sysdeps/i386
Fangrui Song 490e6c62aa elf: Avoid nested functions in the loader [BZ #27220]
dynamic-link.h is included more than once in some elf/ files (rtld.c,
dl-conflict.c, dl-reloc.c, dl-reloc-static-pie.c) and uses GCC nested
functions. This harms readability and the nested functions usage
is the biggest obstacle prevents Clang build (Clang doesn't support GCC
nested functions).

The key idea for unnesting is to add extra parameters (struct link_map
*and struct r_scope_elm *[]) to RESOLVE_MAP,
ELF_MACHINE_BEFORE_RTLD_RELOC, ELF_DYNAMIC_RELOCATE, elf_machine_rel[a],
elf_machine_lazy_rel, and elf_machine_runtime_setup. (This is inspired
by Stan Shebs' ppc64/x86-64 implementation in the
google/grte/v5-2.27/master which uses mixed extra parameters and static
variables.)

Future simplification:
* If mips elf_machine_runtime_setup no longer needs RESOLVE_GOTSYM,
  elf_machine_runtime_setup can drop the `scope` parameter.
* If TLSDESC no longer need to be in elf_machine_lazy_rel,
  elf_machine_lazy_rel can drop the `scope` parameter.

Tested on aarch64, i386, x86-64, powerpc64le, powerpc64, powerpc32,
sparc64, sparcv9, s390x, s390, hppa, ia64, armhf, alpha, and mips64.
In addition, tested build-many-glibcs.py with {arc,csky,microblaze,nios2}-linux-gnu
and riscv64-linux-gnu-rv64imafdc-lp64d.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-10-07 11:55:02 -07:00
..
fpu Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358) 2021-09-21 21:54:37 +00:00
htl
i586 Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
i686 Add narrowing fma functions 2021-09-22 21:25:31 +00:00
i786
nptl elf: Remove THREAD_GSCOPE_IN_TCB 2021-09-16 01:04:20 +02:00
sys
____longjmp_chk.S
__longjmp.S
abort-instr.h
add_n.S
addmul_1.S
asm-syntax.h
backtrace.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
bcopy.S
bsd-_setjmp.S
bsd-setjmp.S
bzero.S
configure
configure.ac
crti.S
crtn.S
dl-irel.h
dl-machine.h elf: Avoid nested functions in the loader [BZ #27220] 2021-10-07 11:55:02 -07:00
dl-procinfo.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
dl-tls.h
dl-tlsdesc.h i386: Remove lazy tlsdesc relocation related code 2021-04-15 09:47:59 +01:00
dl-tlsdesc.S i386: Remove lazy tlsdesc relocation related code 2021-04-15 09:47:59 +01:00
dl-trampoline.S
ffs.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
gccframe.h
htonl.S
htons.S
i386-mcount.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
Implies
isa.h
jmpbuf-offsets.h
jmpbuf-unwind.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
link-defines.sym
lshift.S
machine-gmon.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
Makefile mcheck: Align struct hdr to MALLOC_ALIGNMENT bytes [BZ #28068] 2021-07-12 18:13:32 -07:00
malloc-alignment.h
memchr.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
memcmp.S
memcopy.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
memcpy_chk.S
memcpy.S
memmove_chk.S
memmove.S
mempcpy_chk.S
mempcpy.S
memset_chk.S
memset.S
memusage.h
mp_clz_tab.c
mul_1.S
preconfigure
pthread_spin_trylock.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
rawmemchr.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
rshift.S
setfpucw.c
setjmp.S
stackguard-macros.h
stackinfo.h
start.S Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
stpcpy.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
stpncpy.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strcat.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strchr.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strchrnul.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strcspn.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
string-inlines.c
strlen.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strlen.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strpbrk.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strrchr.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strspn.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
sub_n.S
submul_1.S
symbol-hacks.h
sysdep.h
tlsdesc.c elf: Remove lazy tlsdesc relocation related code 2021-04-21 14:35:53 +01:00
tlsdesc.sym
tst-audit3.c
tst-audit3.h
tst-audit.h
tst-auditmod3a.c
tst-auditmod3b.c
tst-ld-sse-use.sh
unwind-arch.h Implement <unwind-link.h> for dynamically loading the libgcc_s unwinder 2021-03-01 15:58:01 +01:00
Versions