summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf
Commit message (Collapse)AuthorAgeFilesLines
* Description from Dan:mdodd2005-02-044-13/+93
| | | | | | | | | | | | | | | Another handy libmap patch. Lets you do stuff like this: LD_LIBMAP="libpthread.so.1=libthr.so.1" mythreadedapp If you already have a program-specific override in libmap.conf, note that you must use a program-specific override in LD_LIBMAP: LD_LIBMAP="[mythreadedapp],libpthread.so.1=libthr.so.1" mythreadedapp PR: bin/74471 Submitted by: Dan Nelson <dnelson AT allantgroup.com> MFC after: 2 weeks
* style(9)mdodd2005-02-041-4/+3
|
* Implement a dummy atomic_cmpset_32(). It should be safe to use it in rtld ascognet2004-11-231-0/+11
| | | | the signals are masked anyway.
* Remove 80386 support from the ELF run time linker.jhb2004-11-162-163/+0
|
* So do it like we do in usr.bin/tip/tip/Makefile. ;)ru2004-11-141-0/+2
|
* Revert previous commit. As ru explains:schweikh2004-11-141-1/+1
| | | | | | | | | | | In the old world (as the surrounding comment in makefile says), there was the /usr/libexec/ld-elf.so.1 binary which is now a symlink to /libexec/ld-elf.so.1. To symlink, we need to make sure that the _target_ (and the target is /usr/libexec/ld-elf.so.1) doesn't have "schg" flag set. A real solution is to protect the chflags call only if target exists, like we do in usr.bin/tip/tip/Makefile. Requested by: ru
* Avoid an (ignored) error by invoking chflags on the link target, not theschweikh2004-11-141-1/+1
| | | | | | | | symlink. PR: kern/73016 Submitted by: John E. Hein <jhein@timing.com> MFC after: 1 week
* Remove these unused files before any other archs include the same bogusjhb2004-11-126-1057/+0
| | | | file.
* The 32 bit compatability ld-elf32.so.1 cannot use i386_set_ldt() whenpeter2004-11-061-0/+6
| | | | | running on an amd64 kernel. Use the recently exposed direct %fs/%gs set routines instead for the TLS setup of 32 bit binaries.
* Introduce the PRECIOUSPROG knob in bsd.prog.mk, similarru2004-11-031-1/+2
| | | | | | | | to PRECIOUSLIB from bsd.lib.mk. The side effect of this is making installing the world under jail(8) possible by using another knob, NOFSCHG. Reviewed by: oliver
* Implement TLS relocations for powerpc.ssouhlal2004-11-022-3/+73
| | | | Approved by: grehan (mentor)
* Do the TLS offset allocations before relocations, as otherwise theressouhlal2004-11-021-11/+11
| | | | | | | can be overlap in the TLS offsets, if the relocations are done in a certain order. Approved by: dfr, grehan (mentor)
* For variables that are only checked with defined(), don't provideru2004-10-241-1/+1
| | | | any fake value.
* Don't try to relocate the dynamic loader in reloc_non_plt(). It has alreadycognet2004-09-281-1/+4
| | | | been done before.
* Use add instead of saving the sp in a register.cognet2004-09-281-2/+1
|
* Add stubs for TLS.cognet2004-09-234-16/+32
| | | | Arbitraly choose the 2nd variant until I figure out which one I should use.
* Add stubs for powerpc TLS.dfr2004-08-043-5/+43
| | | | Submitted by: ssouhlal
* Add support for Thread Local Storage.dfr2004-08-0314-2/+883
|
* Consistently use __inline instead of __inline__ as the former is an empty macrostefanf2004-07-041-2/+2
| | | | in <sys/cdefs.h> for compilers without support for inline.
* Fix the problem that surfaced with the new binutils import on sparc64tmm2004-06-183-4/+10
| | | | | | | | | | | | | | | | | | | | | | (and that is for now being worked around by a binutils patch). The rtld code tested &_DYNAMIC against 0 to see whether rtld itself was built as PIC or not. While the sparc64 MD code did not rely on the preset value of the GOT slot for _DYNAMIC any more due to previous binutils changes, it still used to not be 0, so that this check did work. The new binutils do however initialize this slot with 0. As a consequence, rtld would not properly initialize itself and crash. Fix that by introducing a new macro, RTLD_IS_DYNAMIC, to take the role of this test. For sparc64, it is implemented using the rtld_dynamic() code that was already there. If an architecture does not provide its own implementation, we default to the old check. While being there, mark _DYNAMIC as a weak symbol in the sparc64 rtld_start.S. This is needed in the LDSCRIPT case, which is however not currently supported for want of an actual ldscript. Sanity checked with md5 on alpha, amd64, i386 and ia64.
* This comment should have been removed in the previous commit.cognet2004-06-171-1/+0
| | | | Spotted out by: marcus, simon
* Woohoo !cognet2004-06-172-4/+0
| | | | the latest binutils import mades this gross hack useless, so just remove it.
* give out a little more information in case of a missing dependencyeik2004-05-281-1/+6
| | | | | | | | PR: 56549 Submitted by: edwin Reviewed by: joerg, ru Approved by: joerg MFC after: 2 weeks
* Support basename and path based constrained matches.mdodd2004-05-241-1/+29
| | | | | | | | | | | | | | | | | | eg: [foo] ... matches any executable 'foo' [/usr/bin/foo/] ... matches any executable under the directory /usr/bin/foo/ Exact matches continue to function as before. PR: bin/66769 Submitted-by: Dan Nelson
* Work around a problem somewhere with binutils (?) on arm, hopefully withoutcognet2004-05-152-0/+5
| | | | breaking any other arch this time.
* Fix breakage caused by alphabetically sorting SRCS: rtld_start.S must come ↵se2004-05-141-1/+2
| | | | | | first! The previous version made all shared binaries dump core.
* Import arm bits for rtld-elf.cognet2004-05-146-2/+684
| | | | Obtained from: NetBSD
* If we change obj_rtld.path after initialising __progname, make sure wedfr2004-03-291-0/+1
| | | | | change __progname to point at the new storage otherwise it ends up pointing at freed memory which leads to confusing garbled error messages.
* More stack alignment fixes. Arrange so we call _rtld() in ld-elf.so.1peter2004-03-211-8/+9
| | | | | | | | | with the correct alignment. This is important because this calls to library static constructors are made from here. The bug in the old crt*.s files hid this because in this case, two wrongs do indeed make a right. Also, call _rtld_bind() with the correct alignment, because it calls back into the pthread library locking functions. If things happen just the wrong way, we get a SIG10 due to the broken stack alignment.
* Add initial support for compiling a special 32 bit version ofpeter2004-03-216-19/+78
| | | | | | | ld-elf.so.1 on 64 bit systems. Most of this involves using alternate paths, environment variables and diagnostic messages. The build glue is seperate.
* Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)markm2004-03-051-4/+4
| | | | | | | | | | | | | | | that this provokes. "Wherever possible" means "In the kernel OR NOT C++" (implying C). There are places where (void *) pointers are not valid, such as for function pointers, but in the special case of (void *)0, agreement settles on it being OK. Most of the fixes were NULL where an integer zero was needed; many of the fixes were NULL where ascii <nul> ('\0') was needed, and a few were just "other". Tested on: i386 sparc64
* Do not depend on existence of _end symbol in obj_from_addr, usekan2004-02-251-8/+1
| | | | | | obj->mapbase and obj->mapsize instead. Prompted by: OpenOffice debugging session at last BSDCon.
* Fix "warning: value computed is not used".fjoe2004-02-031-1/+1
| | | | Found by: gcc 2.95.4 [FreeBSD]
* Initialise some uninitialised variables.dfr2003-12-311-0/+2
| | | | Thanks to: valgrind
* Fix dynamic linking a bit more.. enough that mozilla-firebird works if youpeter2003-12-121-3/+3
| | | | | | dig up the patches for amd64 support for it. Note to self: do not put a 64 bit value in a 32 bit space.
* Revert last change. ../rtld.c uses CACHE_LINE_SIZE too.peter2003-12-111-0/+2
| | | | | | Change it to 64 while here. Reported by: ps
* Only define CACHE_LINE_SIZE in one place..peter2003-12-111-2/+0
|
* CACHE_LINE_SIZE is 64 on athlon and amd64 chips, not 32. This shouldpeter2003-12-111-1/+1
| | | | | probably be 128 since that is what the hardware prefetch fill size is on both the p3, p4 and athlon* cpus.
* Sync comment with code's reality.tobez2003-11-141-1/+1
| | | | MFC after: 1 week
* Retire the WITH_LIBMAP compile knob; libmap is now a standard feature.mdodd2003-09-132-18/+1
|
* Change libmap.c:lm_init() to return a status value; 0 for successmdodd2003-09-133-5/+5
| | | | | | | | (libmap available) and 1 for failure. Assign this return to the global 'libmap_disable' variable in rtld.c. This totally prevents any libmap functions from being called after lm_init() if no config file is present.
* Very minor style nit: sort include files alphabetically.imp2003-08-221-1/+1
|
* Forgot one instance of ld-elf.so.1. Convert to ${PROG}gordon2003-08-171-1/+1
| | | | Pointed out by: obrien
* Don't forget to honor DESTDIR. Also switch over to using PROG instead ofgordon2003-08-171-2/+2
| | | | the binary name directly.
* Don't forget to chflags noschg the existing binary so we can symlinkgordon2003-08-171-0/+5
| | | | | | over it safely. Pointed out by: yosimoto@waishi.jp
* As long threatened, stage 2 of making a dynamically-linked root a reality.gordon2003-08-172-1/+3
| | | | Install rtld into /libexec.
* Prepend /lib to the builtin library search path in rtld.gordon2003-08-172-2/+2
|
* Avoid using the global offset table to get the address of _DYNAMIC injake2003-07-042-1/+18
| | | | | | | | | rtld. When _DYNAMIC is referenced normally from C the global offset table is used implicitly, but newer versions of binutils don't initialize it statically in the binary, so this doesn't work until rtld is relocated, which _DYNAMIC is needed for... So, as on other systems with the same problem, we disassemble a call instruction to _DYNAMIC in order to get its address.
* Fix warnings on 64 bit platforms.mdodd2003-06-191-9/+9
| | | | Noticed by: jake
* Add function prototypes.mdodd2003-06-191-0/+2
|
OpenPOWER on IntegriCloud