Commit Graph

33 Commits

Author SHA1 Message Date
joerg d3d2a5f92e Avoid casting fun by switching ifunc helper functions to return
long long. Dead beef is too useful to switch to a different constant.
2018-03-09 20:15:03 +00:00
maya f076331dd4 Build less of the test code if there's no linker ifunc support.
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
2018-01-01 06:34:13 +00:00
martin d2225bb82b Skip all tests on architectures w/o ifunc linker/ld.elf_so support. 2017-12-30 16:53:34 +00:00
joerg da03f1ef14 init/fini for the main program is handled by crt0.o, so ifunc handling
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-11-06 21:16:03 +00:00
joerg 610e531ea3 Add sparc/sparc64 support for irelative relocations. 2017-08-12 09:03:27 +00:00
joerg e78cfb8eb8 Add IRELATIVE support for ARM, X86 and PowerPC. 2017-08-10 19:03:25 +00:00
joerg df826237c7 Avoid a race condition between dlclose and thread termination. 2017-07-21 16:39:20 +00:00
joerg e5678be828 Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
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-07-11 15:21:31 +00:00
christos c54cb81102 Don't play with "../.." in includes for h_macros.h; deal with it centrally.
Minor fixes.
2017-01-13 21:30:39 +00:00
joerg 6c18385369 Really revert to the original version. 2014-08-26 17:13:42 +00:00
joerg 497e202f2a Revert. There is no such thing as __HAVE_IFUNC and there should not be
one in first place.
2014-08-26 16:25:35 +00:00
christos 5a3404e066 effectively disable the test to fix the build and explain why. 2014-08-26 11:10:02 +00:00
joerg 7a1a6f1cf3 Add basic support for indirect functions. It allows providing a public
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-08-25 20:40:52 +00:00
he f693807fd8 Fix static linking for the tests: -lrump is also used by -lrumpuser,
so we also need -lrump after -lrumpuser.  Fixes build for sun2.
2014-06-10 04:28:39 +00:00
joerg d0ebb0ebfa ARM now works with integrated-as. 2014-02-14 20:33:32 +00:00
joerg 1fd04761e2 Disable integrated-assembler for clang on ARM for two files that are
victims of the @ comment mess on that platform. Add a reference to the
upstream PR.
2013-12-25 22:26:35 +00:00
joerg 71d0bcc69f Introduce __HAVE_NO___THREAD for sun2 and vax to disable the TLS usage.
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.
2012-01-17 20:34:57 +00:00
mrg 6520ba9809 avoid building stuff that depends upon pic objects if MKPIC == no. 2011-07-03 15:28:25 +00:00
mrg 8ab8bb438f only build the ld.elf_so tests if MKPIC != no. 2011-07-03 06:46:49 +00:00
nonaka c52f9a5df2 PR/45015: ld.elf_so: support ELF symbol versioning
Applied latest patch.
2011-06-25 05:45:10 +00:00
christos 2a18cea9f4 Turn warns on for all tests and fix all the bugs. 2011-06-11 18:03:17 +00:00
joerg e04e416493 Use proper format string 2011-05-24 15:24:28 +00:00
joerg b50095d784 Don't fail on platforms without TLS 2011-04-02 12:53:32 +00:00
joerg a7e14ae77f Add initial regression test for ld.elf_so locking. 2011-03-31 23:34:47 +00:00
pooka 030990eecf check that we can dlopen() the linkmap name, too 2011-03-25 14:47:31 +00:00
pooka b2e6db5028 check that dlopen()d dso shows up in the linkmap 2011-03-25 14:45:21 +00:00
skrll 267d99344b Blame where blame is due. 2011-03-17 15:59:32 +00:00
pooka 8498f8450d test helper program exit code, not test program exit code 2010-12-31 08:52:32 +00:00
skrll f1d73a2c94 Add support for DF_1_BIND_NOW, DF_1_NODELETE and DF_1_NOOPEN marked
objects, and the RTLD_NODELETE and RTLD_NOLOAD flags to dlopen(3).

Mark libpthread as DF_1_NOOPEN and use it to test the functionality.

Somewhat taken from FreeBSD.

Fixes PR 42029.

OK from christos and joerg.
2010-12-24 12:41:42 +00:00
skrll be2356ad6f Convert a couple of old regress tests to ATF.
Remove the regress/usr.bin/rtld/dlopen/dlopen.c test as well as it's
covered by existing ATF test(s).
2010-12-14 05:57:31 +00:00
christos 0f10aa9dce add Makefile.inc everywhere so that we can set WARNS=4 by default. Amazing
how many bugs this found :-)
2010-11-03 16:10:19 +00:00
jmmv 9d0b4b5bb8 Get rid of static Atffiles and let bsd.test.mk generate them on the fly. 2010-07-13 21:13:21 +00:00
pooka b4d274c027 add regression tests for dlinfo() 2009-09-24 21:33:45 +00:00