joerg
cb1cd7e860
Add basic locking to ld.elf_so.
2011-03-25 18:07:04 +00:00
joerg
854e6cd69f
Add TLS support for AMD64, i386 and SH3.
...
This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-03-12 22:54:36 +00:00
joerg
f40b256f09
Reduce header pollution for mdreloc.c. Make Obj_Entry argument of
...
_rtld_relocate_nonplt_objects non-const in preparation for TLS support.
2010-08-06 16:33:17 +00:00
christos
12bd4dbd45
PR/39240: Satoshi Suetake: Don't fail when attempting to resolve weak symbols
...
when we are doing immediate binding, leave them alone and they will be dealt
with later during lazy binding. From skrll@
2010-01-13 20:17:21 +00:00
jmmv
2cb749c2fd
Remove trailing \n in calls to _rtld_error: a newline is automatically
...
added by a call to the function.
2009-08-29 13:46:54 +00:00
lukem
b4fba76b41
Fix const issues (cast const pointers to "const uint8_t *" instead of "caddr_t")
...
NOTE: change based on ../i386/mdreloc.c 1.27
XXX: not compile tested
2009-03-16 02:46:47 +00:00
skrll
dccd9ddf7f
RCSID police
2008-07-24 06:51:58 +00:00
matt
38bdc8954f
Refactor common code to _rtld_relocate_plt_object to i386 and arm so they
...
act like the other versions.
In _rtld_bind, if the result is 0, call _rtld_die.
Initialize _rtld_sym_zero.st_value to -_rtld_objself.maprelocbase. Now when
the symbol is resolved, st_value + maprelocbase will equal 0 and the above
check in _rtld_bind will fire and a call to NULL will be avoided.
2008-07-24 04:39:25 +00:00
martin
ce099b4099
Remove clause 3 and 4 from TNF licenses
2008-04-28 20:22:51 +00:00
mrg
d677e4a13a
avoid more GCC4 uninitialised variable problems. (sh3 known, vax guessed.)
2006-05-21 04:17:35 +00:00
uwe
a35d2a5b09
Add some comments.
2006-01-11 22:24:34 +00:00
uwe
e7102691a2
Kill trailing whitespace.
...
Indent delay slots.
2006-01-11 22:05:27 +00:00
skrll
680596d08e
Add __RCSID.
2005-08-20 19:01:16 +00:00
lukem
3ed9ffcae1
Explicitly prefix ld(1) options in LDFLAGS with "-Wl," rather than
...
using the ${LDFLAGS:@F@-Wl,$F@} make substitution because that breaks
if LDFLAGS is already set.
2005-06-04 16:17:17 +00:00
skrll
9c5ec319c5
Support LD_BIND_NOW on sh3..
2005-05-31 19:30:38 +00:00
uwe
255de8f40e
Preserve r2 in _rtld_bind_start - in r2 functions that return
...
aggregate types are passed the address of the memory area to store the
returned result to.
Fixes PR port-sh3/26949.
2004-09-14 21:34:01 +00:00
skrll
b5330c98c7
Add the standard XXX about CPPFLAGS and -fpic here.
2004-02-21 16:02:06 +00:00
skrll
d93f13855a
Move common LDFLAGS into Makefile from arch/*/Makefile.inc
2004-02-21 15:56:03 +00:00
skrll
151426159b
Whitespace.
2004-02-20 20:58:24 +00:00
skrll
5f573ab68d
ANSIfy and de-__P().
2003-07-24 10:12:25 +00:00
marcus
fae2567c9b
Removed unused function.
2003-07-05 20:48:39 +00:00
tsutsui
0e65101f60
Add function prototype declarations.
2003-07-05 18:18:51 +00:00
marcus
a4878b4349
Bugfix: Don't pick addend both from reloc and contents at the same time.
2003-07-02 15:29:34 +00:00
marcus
6aeeb40d4a
Updated to work with current rtld code.
2003-06-30 00:50:46 +00:00
mycroft
4172074119
Skip the lazy PLT relocation if relocbase==0 (useful if libraries are loaded
...
at their VMA address).
2002-10-03 20:39:22 +00:00
mycroft
1c495430dd
Remove the `self' args to _rtld_relocate_objects() and
...
_rtld_relocate_nonplt_objects().
2002-09-26 20:42:10 +00:00
mycroft
9d8c69b929
Remove vestiges of VARPSZ.
2002-09-24 12:12:07 +00:00
mycroft
a3b892d178
Nuke -DRTLD_RELOCATE_SELF and `dodebug' from orbit.
2002-09-12 22:56:28 +00:00
mycroft
547bc13b97
_rtld_bind_start() is not used in MI code, so declare it in the MD code.
2002-09-12 20:20:58 +00:00
junyoung
b240241362
Add $NetBSD$.
2002-09-11 14:19:30 +00:00
mycroft
6f0fac5efa
Pass down an additional flag to _rtld_relocate_nonplt_objects() which
...
indicates whether we're relocating ld.elf_so itself. Use this in some places
rather than hackish tests on `dodebug'. (The Alpha and HPPA `dodebug' tests
were actually noops, because RTLD_RELOCATE_SELF is not set, and therefore
dodebug is always true.)
2002-09-06 15:17:53 +00:00
mycroft
0df8d18100
Introduce a new flag, `isdynamic', which is used to remember whether the
...
executable was of type ET_DYN. Use this instead of `mainprog' to determine
whether we need to do base-relative fixups of the PLT. (This allows loading
non-relocatable objects, should we desire to do that at some point...)
2002-09-06 13:20:29 +00:00
mycroft
b97e4047b7
Re-poison a lot of consts, now that the mark shite is gone.
2002-09-06 03:12:04 +00:00
mycroft
a04012e731
Split _rtld_relocate_plt_object() into two MD functions:
...
* _rtld_relocate_plt_lazy() fixes up all the relocs pointing to the PLT. (On
most platforms it just does a simple base-relative fixup; on SPARC it does
nothing.)
* _rtld_relocate_plt_object() does immediate binding for a PLT entry.
The basic gist is that this saves a bit of time on SPARC (where the iteration
through the pltrela table was gratuitous), and a little less time on all other
platforms. A whole lot of #ifdef'ed crap is moved out of reloc.c, too.
NOT tested on: hppa sh x86_64
2002-09-06 03:05:35 +00:00
mycroft
ac191986f3
Partially fix up some debug printf()s that don't need to use defobj.
2002-09-05 21:31:30 +00:00
mycroft
bdc2ac1520
A few things:
...
* Pass a symbol number to _rtld_find_symdef(), not a r_info.
* Don't try to do a symbol lookup when we find an unsupported relocation;
instead get the symbol name from the referencing object's strtab.
* Add preliminary support for `-z combreloc'-style startup optimization on
i386, `#ifdef COMBRELOC'.
2002-09-05 21:21:06 +00:00
mycroft
74444a2ddb
Rename _rtld_relocate_nonplt_object() to _rtld_relocate_nonplt_objects(),
...
and push the outer loop into it. This actually shaves a couple % off startup
time at least on PCs.
2002-09-05 20:08:14 +00:00
mycroft
00c3ad1f56
Split _rtld_relocate_nonplt_object() into separate MD files.
2002-09-05 18:25:45 +00:00
mycroft
2635aa544a
Make _rtld_setup_pltgot() a consistent interface on all platforms.
2002-09-05 15:38:22 +00:00
thorpej
cb2e377d4c
Whitespace cleanup.
2002-02-04 18:18:51 +00:00
thorpej
67b1884571
Add support for dynamic linking on the SuperH. From Marcus Comstedt,
...
with some bug fixes (namely, don't forget to consider the addend when
processing relocations) from me.
2002-02-03 23:34:42 +00:00