mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-10 23:30:07 +00:00
9c82da17b5
This is a change to the dynamic linker to add prelinker support for the R_ARM_TLS_DESC relocation. Two cases can be considered here, the usual one where lazy binding is in use and the less frequent one, where immediate binding is requested via the use of the DF_BIND_NOW dynamic flag (e.g. by using the GNU linker's "-z now" option). This change only handles the first case. In this scenario the prelinker does what the dynamic linker would do, that is it preinitialises R_ARM_TLS_DESC relocations with a pointer to the lazy specialization as provided with the DT_TLSDESC_PLT dynamic tag. A conflict is additionally created and in the conflict resolution path the dynamic linker complements the work by initialising the object's pointer as indicated by the DT_TLSDESC_GOT dynamic tag to the linker's internal lazy specialization worker function and also providing the associated link map in the second entry of the GOT. This step is required, because if prelinking is successful at the run time, then the dynamic linker's elf_machine_runtime_setup() function isn't called that would normally do so. The second case remains unresolved, because support for that scenario has not been implemented in the prelinker. In this case the lazy specialization is unavailable and the DT_TLSDESC_PLT dynamic tag is not present. The prelinker could assume the common case of static specialization and resolve the relocation, but that would require the exposure of dynamic linker's specialization worker function. Furthermore the dynamic linker would have to handle the relocation in the conflict resolution path and see if the dynamic specialization should be used instead. This however would require access to data structures currently not made available to the conflict resolution path and therefore a redesign of this part of the dynamic linker. Alternatively the prelinker could defer all processing to the dynamic linker's conflict resolution path, but that would require similar access to the said data structures. Therefore the prelinker issues an error instead and the dynamic linker has assertions to check that DT_TLSDESC_PLT and DT_TLSDESC_GOT are in use in its conflict resolution path. This change resolves all TLS failures in the prelinker testsuite, as noted in the bug report, as well as the small test case provided there. Unfortunately we don't seem to have any hooks to factor in the prelinker (if present on a system) to testing, so at this time this fix has to rely on using the prelinker test suite and enabling TLS descriptors there for coverage. [BZ #17078] * sysdeps/arm/dl-machine.h (elf_machine_rela) [RESOLVE_CONFLICT_FIND_MAP]: Handle R_ARM_TLS_DESC relocation. (elf_machine_lazy_rel): Handle prelinked R_ARM_TLS_DESC entries. |
||
---|---|---|
.. | ||
armv6 | ||
armv6t2 | ||
armv7 | ||
bits | ||
include/bits | ||
nptl | ||
soft-fp | ||
sys | ||
__longjmp.S | ||
abi-note.S | ||
add_n.S | ||
addmul_1.S | ||
aeabi_assert.c | ||
aeabi_atexit.c | ||
aeabi_errno_addr.c | ||
aeabi_lcsts.c | ||
aeabi_localeconv.c | ||
aeabi_math.c | ||
aeabi_mb_cur_max.c | ||
aeabi_memclr.c | ||
aeabi_memcpy.c | ||
aeabi_memmove.c | ||
aeabi_memset.c | ||
aeabi_sighandlers.S | ||
aeabi_unwind_cpp_pr1.c | ||
arm-features.h | ||
arm-mcount.S | ||
backtrace.c | ||
bsd-_setjmp.S | ||
bsd-setjmp.S | ||
configure | ||
configure.ac | ||
crti.S | ||
crtn.S | ||
dl-irel.h | ||
dl-lookupcfg.h | ||
dl-machine.h | ||
dl-sysdep.h | ||
dl-tls.h | ||
dl-tlsdesc.h | ||
dl-tlsdesc.S | ||
dl-trampoline.S | ||
fclrexcpt.c | ||
fedisblxcpt.c | ||
feenablxcpt.c | ||
fegetenv.c | ||
fegetexcept.c | ||
fegetround.c | ||
feholdexcpt.c | ||
fenv_private.h | ||
fesetenv.c | ||
fesetround.c | ||
feupdateenv.c | ||
fgetexcptflg.c | ||
find_exidx.c | ||
fpu_control.h | ||
fraiseexcpt.c | ||
frame.h | ||
framestate.c | ||
fsetexcptflg.c | ||
ftestexcept.c | ||
gcc-compat.h | ||
gccframe.h | ||
get-rounding-mode.h | ||
gmp-mparam.h | ||
Implies | ||
jmpbuf-unwind.h | ||
ldsodefs.h | ||
libc-aeabi_read_tp.S | ||
libc-tls.c | ||
libm-test-ulps | ||
machine-gmon.h | ||
Makefile | ||
math_private.h | ||
math-tests.h | ||
memcpy.S | ||
memmove.S | ||
memset.S | ||
memusage.h | ||
nptl-aeabi_unwind_cpp_pr1.c | ||
preconfigure | ||
preconfigure.ac | ||
rt-aeabi_unwind_cpp_pr1.c | ||
rtld-global-offsets.sym | ||
s_fma.c | ||
s_fmaf.c | ||
setfpucw.c | ||
setjmp.S | ||
sotruss-lib.c | ||
stackinfo.h | ||
start.S | ||
static-stubs.c | ||
strlen.S | ||
sub_n.S | ||
submul_1.S | ||
sysdep.h | ||
test-fpucw.c | ||
tls-macros.h | ||
tlsdesc.c | ||
tlsdesc.sym | ||
tst-armtlsdescextlazy.c | ||
tst-armtlsdescextlazymod.c | ||
tst-armtlsdescextnow.c | ||
tst-armtlsdescextnowmod.c | ||
tst-armtlsdescloc.c | ||
tst-armtlsdesclocmod.c | ||
tst-audit.h | ||
unwind-dw2-fde-glibc.c | ||
unwind-pe.c | ||
unwind.h | ||
Versions |