Commit Graph

1555 Commits

Author SHA1 Message Date
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
junyoung 3ffe941c3a Remove typedef which was never used. Meaningless comment as well. 2002-09-06 13:27:48 +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 69b9a24021 More const poisoning. Now the entire _rtld_bind() path useds a const Obj_Entry. 2002-09-06 12:00:40 +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 c59ffb0cc4 Remove all of the `mark' code. This is responsible for the `undefined PLT
symbol' errors, probably because the increment gets interrupted occasionally by
a signal.  In general, _rtld_bind() should not modify ANY internal state.
2002-09-05 21:57:09 +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 1fa950d044 Fix one indentation error. 2002-09-05 20:12:43 +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 b4a8cd2dbf Split MIPS relocation goo into mips_reloc.c. 2002-09-05 17:58:02 +00:00
mycroft ae16986458 Simplify a couple of tests to !__mips__. 2002-09-05 17:06:11 +00:00
mycroft 9e3442dc47 Combine the code that skips COPY relocs on most platforms (other than MIPS).
Remove the code that skips JMP_SLOT relocs (thus making ld.elf_so bomb if it
hits one in the non-PLT relocation table).
2002-09-05 17:01:13 +00:00
mycroft cf2d41da85 If REL(A)SZ extends into .rel(a).plt, trim rel(a)lim. This is actually due to
what is arguably a bug in BFD on some platforms (at least PPC and SPARC), but
I can't fix old binaries.
2002-09-05 16:58:16 +00:00
junyoung 515622e6db Remove unused arguments of _rtld_find_symdef(). 2002-09-05 16:33:57 +00:00
mycroft 1ea7e8253b Remove support for PowerPC static relocations, which are not present in shared
objects, and in any case are implemented WRONG.  (They're symbol-relative, not
base-relative.)
2002-09-05 15:47:52 +00:00
mycroft f4cbd3d6e2 Remove unused prototypes (including one for a non-existant function!). 2002-09-05 15:45:54 +00:00
mycroft 2635aa544a Make _rtld_setup_pltgot() a consistent interface on all platforms. 2002-09-05 15:38:22 +00:00
mycroft 1e06edb63b There is no need to do an imb after each call to the binder, because we only
patch the GOT, not the PLT.  However, do an imb when setting up the PLT thunk,
just in case.
2002-09-04 19:13:00 +00:00
junyoung 937e5f4f83 Previous commit broke the normal build; this should really fix the
problem, toolchain/18020. From Frederick Bruckman <fredb@immanent.net>.
2002-09-04 16:57:47 +00:00
junyoung 9cc71f17e2 Fix a problem that 'make obj' doesn't work within tools/makewhatis. 2002-09-04 06:39:58 +00:00
mycroft 1b6aaa02a2 Turn off DEBUG by default, and compile with -O3. (Tested on Alpha, ARM,
x86 and PowerPC.)
2002-08-31 18:18:14 +00:00
lukem 3b473ec283 xerrx() needs to output a trailing newline as well 2002-08-27 10:37:33 +00:00
christos 23c8380404 save 4 system calls by using AT_{R,E}{U,G}ID. 2002-08-26 21:09:55 +00:00
itojun b46a0ef5ae use strlcpy. minor style fixes 2002-08-22 07:23:27 +00:00
christos d5935a17be enable utmpx support. this doesn't work correctly for chrooted ftpd's, but
I am leaving it to luke to fix.
2002-08-22 00:09:38 +00:00
christos 7c266e1884 support utmpx 2002-08-20 14:01:49 +00:00
christos 9d7f515ba2 add some more ifdefs, so that we don't define variables we don't use. 2002-08-20 13:58:22 +00:00
christos 7d62d2a173 utmpx support 2002-08-20 13:56:50 +00:00
christos c0b21fbbf7 Disable UTMPX support for now, because ftpd might chroot and we need
to keep files open.
2002-08-20 13:55:58 +00:00
christos 4b476b1883 utmpx support 2002-08-20 13:51:09 +00:00
christos 6c99012e39 PR/17999: FUKAUMI Naoki: Support wtmpx entries. 2002-08-20 13:12:00 +00:00
lukem f794aa60bb Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path 2002-08-19 13:54:34 +00:00
itojun 2abe377059 defend against malicious line in ut_line, which could cause unwanted
writes to anything under /dev.  revoke setuid/gid privs earlier.
From: xs@kittenz.org
2002-08-16 20:21:48 +00:00
abs d88a5fe209 If the peer closes the connection in ttloop()
syslog(LOG_ERR, "ttloop:  peer died: %m");
is a little console spammingly excessive. Switch to LOG_INFO.
2002-08-12 09:19:00 +00:00
thorpej 9c104401d1 Build for "armeb". 2002-08-10 01:59:33 +00:00
soren 642c31b4a3 Remove extraneous \n's in {err,warn}{,x}. 2002-08-09 10:01:53 +00:00
soren 236006d5dc Remove extraneous \n's in {err,warn}{,x} that used to be printfs. 2002-08-08 13:24:12 +00:00
jmcneill 00a0bebf72 Include string.h so this application compiles. 2002-08-05 15:36:51 +00:00
christos f660736fac It is pointless to limit the login name for utmp's purposes here. 2002-08-01 18:52:06 +00:00
christos 5ba367f315 err, fix arg to warn. 2002-07-29 00:36:44 +00:00
christos 5e254dfcd4 jeez, this program included almost everything in /usr/include! 2002-07-29 00:35:49 +00:00
christos aa3ec0641b Add utmp_update 2002-07-28 22:38:50 +00:00
grant 6742cb1812 sweep of errx/warnx, remove unnecessary trailing \n 2002-07-20 08:36:17 +00:00
abs c2fcad8607 If /etc/ld.so.conf contains an invalid sysctl name any dynamically
executable that uses the library on that line has the rather cryptic
"sysctl" printed when it starts executing.

Switch to (_PATH_LD_HINTS": unknown sysctl for %s", name);

Discovered after someone copied /etc from an i386 to a sparc64 box.
2002-07-18 14:46:11 +00:00