Commit Graph

31 Commits

Author SHA1 Message Date
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
mycroft
7cbba1750d Shorten rtld_start() by 2 instructions or 8 bytes, and make it not use GOT
entries.
2003-03-02 22:56:14 +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
a9c999925c We don't need to save quite as many registers in the stub. 2002-09-25 08:00:26 +00:00
mycroft
729925dfb9 Push the _rtld_bind() interface into MD code -- it's just a trivial wrapper
anyway.
2002-09-25 07:27:49 +00:00
junyoung
9754fa4d8e Make immediate binding work again by actually implementing
_rtld_relocate_plt_objects(). Note that this is for i386 only;
any efforts to make it work on other platforms are left to
those who are using them...
2002-09-17 07:29:46 +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
mycroft
ebf50cdfbc Update comments. 2002-09-12 17:18:37 +00:00
mycroft
5ee0e5e1c4 Pass the calculated relocation offset down to _rtld(). 2002-09-12 17:07:25 +00:00
mycroft
735f9f38c0 Split the `self' case out of _rtld_relocate_nonplt_objects, into a new function
_rtld_relocate_nonplt_self(), which is called from _rtld_start.
Now we're completely relocated before main() is called.
We also no longer need _GOT_END_, so junk the ld script.

This code assumes that ld.elf_so only contains RELATIVE relocs, but that's
supposed to be the case for -Bsymbolic anyway.
2002-09-11 17:23:23 +00:00
junyoung
b240241362 Add $NetBSD$. 2002-09-11 14:19:30 +00:00
mycroft
ae0c8dfbc2 Get rid of RTLD_RELOCATE_SELF on i386.
* Add a ld.so.script that exports _GOT_END_.
* Prebind the GOT in _rtld_start.
* Skip over GOT relocs in _rtld_relocate_nonplt_objects().
This makes debugging work better at least.
2002-09-09 14:08:07 +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
b3827960df Grumble. Put compiler options back into CPPFLAGS for now, since
they're needed to build .S files with the correct PIC options.

XXX Really needs cleanup in <bsd.*.mk> to do this properly.
2001-12-20 19:20:02 +00:00
thorpej
7dcc71da1d Don't put compiler options into CPPFLAGS. 2001-12-14 22:21:45 +00:00
christos
84cb65780e Cleanup global variable access so rtld can be self relocating. Also KNF
reloc.c and move md sparc parts to arch/sparc/mdreloc.c
Now we don't need to load at address 0 on the i386 and the mips should be
trivial to fix.
1999-02-24 18:31:00 +00:00
christos
98619fe771 Remove unneeded args for rtld (kleink) 1999-02-19 10:22:14 +00:00
christos
580ca245fd Be consistant about the .rtld_start and _rtld_start 1999-02-12 17:15:52 +00:00
christos
14d2402e4b Add i386 bits. Only works with -fpic or -fPIC compiled binaries since
COPY relocations don't work.
1999-01-10 18:21:24 +00:00