summaryrefslogtreecommitdiff
path: root/tests/libexec/ld.elf_so
AgeCommit message (Collapse)Author
2023-07-05tests/libexec/ld.elf_so: Fix helper library makefiles.riastradh
1. Consolidate logic into a single helper.mk to reduce duplication. 2. Set NO* variables, not MK* variables which are reserved for user. 3. Avoid eager X!= in favour of lazy ${X:sh}. 4. Mark _g.a set list entries obsolete. Never should've been built! PR misc/57462
2023-06-04Fix interactions of initial-exec TLS model and dlopenjoerg
(1) If an initial-exec relocation was used for a non-local symbol (i.e. the definition of the symbol is in a different DSO), the computation of the static TLS offset used the wrong DSO. This would effectively mean the wrong address was computed (PR toolchain/50277, PR pkg/57445). Fix this by forcing the computation of the correct DSO (the one defining the symbol). This code uses __UNCONST to avoid the vast interface changes for this special case. (2) If symbols from a DSO loaded via dlopen are used with both global-dynamic/local-dynamic and initial-exec relocations AND a initial-exec relocation was resolved first in a thread, a split brain situation could exist where the dynamic relocations would use one memory block (separate allocation) and the initial-exec relocations the static per-thread TLS space. (3) If the initial-exec relocation in (2) is seen after any thread has already used a GD/LD allocation, bail out. Since IE relocations are used only in the GOT, this will prevent the dlopen. This is a bit more aggressive than necessary, but a full blown reference counting doesn't seem to be justified.
2023-06-03adapt to ${CC_WNO_MAYBE_UNINITIALIZED}lukem
Use ${CC_WNO_MAYBE_UNINITIALIZED} instead of the older style more complex expressions. Remove workarounds if they were for a specific version of gcc < 10.
2023-06-02ld.elf_so: Test dynamic-then-static abuse via ctor.riastradh
XXX pullup-10
2023-06-02ld.elf_so: Test another edge case of mismatched TLS models.riastradh
One library defines a symbol and _doesn't_ use it, so it has no indication of whether the symbol is for static TLS or dynamic TLS, and then two other libraries use it in different ways. XXX pullup-10
2023-06-02ld.elf_so: tls_extern dynamic_defabuse_eager must xfail differently.riastradh
If a symbol has already been resolved as dynamic TLS, any library that tries to use it as static TLS cannot be dlopened. XXX pullup-10
2023-06-01ld.elf_so: Separately test eager and lazy resolution of def tls ptr.riastradh
eager: before loading use library lazy: after loading use library XXX pullup-10
2023-06-01ld.elf_so: Shorter test names.riastradh
No functional non-cosmetic change intended. XXX pullup-10
2023-06-01ld.elf_so: Test TLS abuse of static def, dynamic use and vice versa.riastradh
XXX pullup-10
2023-06-01ld.elf_so: Factor out logic in TLS tests to make writing more easier.riastradh
No functional change intended. XXX pullup-10
2023-06-01ld.elf_so: Test extern dynamic TLS too.riastradh
XXX pullup-10
2023-06-01ld.elf_so: Test variations on PR toolchain/50277.riastradh
XXX pullup-10
2023-05-31ld.elf_so: Nix inadvertently committed private test program.riastradh
2023-05-31ld.elf_so: Fix extern TLS test to match PR toolchain/50277.riastradh
Now it's actually testing the problem.
2023-05-31ld.elf_so: New test for extern initial-exec TLS, PR toolchain/50277.riastradh
XXX pullup-10
2022-06-21sort; it is the same list as in h_ifunc_static.c; perhaps it should bechristos
a HAVE_ something?
2022-06-21Support ifunc on aarch64. The tests pass at least.skrll
2022-06-21Wrap long #if defined(...) || ... and sort. NFCI.skrll
2022-06-13Whitespaceskrll
2022-01-14Trailing whitespaceskrll
2021-06-07Good bye oabi! Tested building earmv7hf.christos
2021-06-04PR/56230: Don't try to use ifunc with arm and oabichristos
2021-05-30Drop explicit -msecure-plt, it's the default for both clang and gcc.joerg
2020-09-29Whitespaceroy
2020-09-29Fix build with clang.roy
2020-09-22Add new RTLD test file for r_debugkamil
New tests: - self - dlopen Both check whether the r_debug structure seems to be well-formed, without and with a dlopen(3) call.
2020-05-05Disable attempt to use ifunc on hppa. It doesn't work and new binutilsskrll
throws a build error.
2019-07-09return return atf_no_error() instead of 0 for consistency.maya
suggested by moritzbuhl in https://github.com/NetBSD/src/pull/11/
2019-05-14clang ifunc's on powerpc require secure-plt.christos
2018-03-09Avoid casting fun by switching ifunc helper functions to returnjoerg
long long. Dead beef is too useful to switch to a different constant.
2018-01-01Build less of the test code if there's no linker ifunc support.maya
r1.6 changed the code in such a way that it was hitting a BFD assert on MIPS, causing the builds to fail. we were hitting the assert at binutils/dist/bfd/elfxx-mips.c:10879
2017-12-30Skip all tests on architectures w/o ifunc linker/ld.elf_so support.martin
2017-11-06init/fini for the main program is handled by crt0.o, so ifunc handlingjoerg
is skipped right now as it iterates the same list. Don't repeat that mistake and explicitly take care of it in the dynamic linker.
2017-08-12Add sparc/sparc64 support for irelative relocations.joerg
2017-08-10Add IRELATIVE support for ARM, X86 and PowerPC.joerg
2017-07-21Avoid a race condition between dlclose and thread termination.joerg
2017-07-11Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. Thisjoerg
functions are used for destructors of thread_local objects. If a pending destructor exists, prevent unloading of shared objects. Introduce __dl_cxa_refcount interface for this purpose. When the last reference is gone and the object has been dlclose'd before, the unloading is finalized. Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists on providing __cxa_thread_atexit as direct wrapper without further patching.
2017-01-13Don't play with "../.." in includes for h_macros.h; deal with it centrally.christos
Minor fixes.
2014-08-26Really revert to the original version.joerg
2014-08-26Revert. There is no such thing as __HAVE_IFUNC and there should not bejoerg
one in first place.
2014-08-26effectively disable the test to fix the build and explain why.christos
2014-08-25Add basic support for indirect functions. It allows providing a publicjoerg
function symbol with an implementation choosen at run time. Refactor calls to functions by address in ld.elf_so to create temporary function descriptors on the stack, if the address is not leaked outside. Limitations: - no support for initialising static storage with function pointers - no support for unnamed resolver functions Inspired by FreeBSD's r228435 by kib@freebsd.org.
2014-02-14ARM now works with integrated-as.joerg
2013-12-25Disable integrated-assembler for clang on ARM for two files that arejoerg
victims of the @ comment mess on that platform. Add a reference to the upstream PR.
2012-01-17Introduce __HAVE_NO___THREAD for sun2 and vax to disable the TLS usage.joerg
Require __HAVE_TLS_VARIANT_I or __HAVE_TLS_VARIANT_II as well as __lwp_getprivate_fast / __lwp_gettcb_fast to exist for libpthread. Define VAX as going to use TLS variant I, if it is ever implemented.
2011-07-03avoid building stuff that depends upon pic objects if MKPIC == no.mrg
2011-07-03only build the ld.elf_so tests if MKPIC != no.mrg
2011-06-25PR/45015: ld.elf_so: support ELF symbol versioningnonaka
Applied latest patch.
2011-06-11Turn warns on for all tests and fix all the bugs.christos
2011-05-24Use proper format stringjoerg