Commit Graph

48 Commits

Author SHA1 Message Date
skrll 5f573ab68d ANSIfy and de-__P(). 2003-07-24 10:12:25 +00:00
mycroft 33131cb294 Update copyright. 2003-03-01 15:14:59 +00:00
mycroft eea1001a73 Adjust for the fact that the GOT is all 0s in new binutils -- do the trick of
disassembling a call to _DYNAMIC to determine its real address, and using the
first entry of the GOT as its base-relative address.

It's evil, but it works.
2003-02-27 05:39:42 +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 723a5f8a50 Remove a meaningless bit from a rdbg(). 2002-09-26 02:51:27 +00:00
mycroft f1c792d648 Make the stack frame 96 bytes, like GCC does. 2002-09-26 02:05:41 +00:00
mycroft bde7a965da Tweak the save instruction in the PLT stub rather than adding an instruction
to the binder entry stub...
2002-09-26 01:59:16 +00:00
mycroft d314d82b47 Allocate space for the argument space area in both _rtld_start() and
_rtld_bind_start().  Not needed normally, but if we compile ld.elf_so with
-g, it blows up without this.
2002-09-26 01:54:52 +00:00
mycroft 6bff9ffc3d For consistency, use Elf_Word* to point to code, not Elf_Addr*. 2002-09-25 22:33:54 +00:00
mycroft 9e31b44846 There is no need to save and restore a second register window in the binder
stub.
2002-09-25 14:38:51 +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 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
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 e46eb805f1 This ld script is no longer necessary. 2002-09-11 19:46:04 +00:00
mycroft aa1330ce71 Do the _rtld_relocate_nonplt_self() thing for SPARC. 2002-09-11 19:11:05 +00:00
mycroft d22977bb61 Indent branch delay instructions. 2002-09-09 19:01:52 +00:00
mycroft c127ff08fb Nuke RTLD_RELOCATE_SELF for SPARC. 2002-09-09 18:10:20 +00:00
mycroft 492895a9f9 Expand the comment about the R_TYPE(RELATIVE) special-case, as it's not quite
obvious from the code.  Also, just do it all the time, as an optimization.
2002-09-06 15:51:23 +00:00
mycroft 3eee01c5b9 Make the reloc tables const. 2002-09-06 15:32:56 +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 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 5f016a11ef Repair a slight biff I made earlier -- do not exit the loop in
_rtld_relocate_nonplt_objects() early.
2002-09-06 02:01:39 +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
junyoung 515622e6db Remove unused arguments of _rtld_find_symdef(). 2002-09-05 16:33:57 +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
kleink 63ccd3db5b Sync with <sys/exec_elf.h> rev. 1.45: ElfNN_RelA -> ElfNN_Rela. 2001-04-25 12:24:50 +00:00
mycroft bbe4b07983 Make this more likely to compile with ld.elf_so changes. (But this is
untested.)
1999-11-07 08:08:15 +00:00
christos 00e5621847 We need to compile with -DVARPSZ, because the sparc has a variable page
size depending on arch. Make it an error to compile without it. This
caused -lposix linked programs to fail.
1999-06-22 16:28:22 +00:00
christos c346a6827a fix rdbg macro args. 1999-03-01 18:59:31 +00:00
christos 26475619ed KNF 1999-03-01 16:40:07 +00:00
christos 77aa6b2a64 - Use c style comments.
- & -> and
- align 4 in both functions for consistency.
1999-03-01 14:40:32 +00:00
kim 62b98a9670 Make mkdep succeed (use matching quotes in comment). 1999-03-01 03:39:39 +00:00
pk e81b9ed433 * Make changing the PLT slot entry (lazy function binding) thread-safe.
* Insert `iflush' instructions for the patched words in PLT entries.
1999-02-27 17:12:13 +00:00
pk 4e7849055a Add comment on the necessity of having to look at implicit memory addends
even though the sparc architecture uses `Elf_Rela' structures exclusively.
1999-02-27 11:36:02 +00:00
pk 5c519e8777 Target bitmask for RELOC_RELATIVE should be a full word.
Also for RELOC_RELATIVEs, add in the memory contents in addition to r_addend.
1999-02-27 10:24:52 +00:00
christos ddadb71e4e Relative relocations should use addend. 1999-02-26 22:50:03 +00:00
pk 22001aee9c Take care of `load address relative' relocations.
Ignore JMP_SLOTs in non-plt relocations.
1999-02-26 22:13:49 +00:00
pk 801d8e5b9d Implement rtld_bind() stub.
Fix startup code.
1999-02-26 22:01:31 +00:00
christos 62926e7ee2 Work in progress (does not work yet). 1999-02-24 18:25:40 +00:00