Commit Graph

33 Commits

Author SHA1 Message Date
mycroft
ad8ccd6290 Minor cleanup. 2002-10-05 11:59:03 +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
0a20e1e977 We don't need to save r7, either... 2002-09-27 03:46:12 +00:00
mycroft
b95736d94a Put back the short-circuiting code -- Matt claims there are functions that rely
on it.
OTOH, don't bother saving r6 a second time.
2002-09-27 03:34:22 +00:00
mycroft
6d8d08304c 1) There is no reason to flush the I$ here, given that we do not modify any
instructions.  Function calls use GOT indirection, and we only patch the
   GOT.
2) The mask-comparison optimization always fails, because the saved mask
   always has 0x2000 set, and the PLT stub mask never does.  So, remove it.
2002-09-27 02:46:05 +00:00
mycroft
42fb5b53c2 Save one more instruction. 2002-09-27 02:14:38 +00:00
mycroft
06f9fa98b0 Save relocbase in %r10, not %r1.
Also, save one instruction.
2002-09-26 23:28:52 +00:00
mycroft
d437f6520b Implement a self-relocate function for the VAX. 2002-09-26 22:26:26 +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
729925dfb9 Push the _rtld_bind() interface into MD code -- it's just a trivial wrapper
anyway.
2002-09-25 07:27:49 +00:00
mycroft
b59c269424 Nuke reference to RTLD_RELOCATE_SELF. 2002-09-24 01:58:44 +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
d04429c6a7 Figure out the relocation offset and pass it to _rtld(). 2002-09-12 17:43:30 +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
matt
0ce5ca145f Change to use a register prefix. 2002-02-24 01:06:18 +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
matt
1ed7963458 Simplify some stuff. 2000-08-07 01:47:04 +00:00
matt
824a084272 More VAX ELF changes. 2000-07-17 02:55:52 +00:00
matt
63465d3193 No need for RELOCATE_SELF since the VAX does real PIC. Rewrite the bind
routine to deal with JMP .vs. CALLx differences.
2000-07-14 22:03:02 +00:00
matt
86d15d820b Update to current <machine/asm.h> 2000-07-03 03:31:47 +00:00
matt
0189702cee minor fix now that i've defined the plt0 entry. 2000-05-22 19:17:04 +00:00
matt
741f18b695 Initial VAX ELF32 support (mostly untested). It's checked primarily for
testing and archival for now.  I don't expect anyone to work with it
since the binutils and gas changes are still pending.  But you got to
crawl before you walk.
1999-08-21 19:26:18 +00:00