Commit Graph

1680 Commits

Author SHA1 Message Date
mycroft
fb3dfbb81b Add a comment about the function pointer nonsense. 2002-09-24 20:27:07 +00:00
mycroft
216a20fcc4 Put back the `in_plt' nonsense for now.
It turns out there is some deep-seated wackiness WRT function pointer
comparisons...
2002-09-24 20:23:11 +00:00
mycroft
9d1d2c30c8 Reverse the previous patch, but make the dbg()s more informative. 2002-09-24 18:28:42 +00:00
mycroft
8510028476 Touch up a little more -- some of the dbg()s never actually printed anything. 2002-09-24 18:25:54 +00:00
mycroft
1ad20cb78f Previous change was done wrong. 2002-09-24 18:23:14 +00:00
junyoung
d0e76e42b6 G/c dbg()'s. 2002-09-24 18:03:46 +00:00
junyoung
5afbf1cbce Make sure that dbg() is disabled if LD_DEBUG is not defined. Now
debugging is easier with RTLD_DEBUG_RELOC.
2002-09-24 17:51:11 +00:00
mycroft
64d3d6215a Ignore JMP_SLOT relocs when doing non-PLT relocations. The relalim trimming
hack doesn't always work, because ld(1) sometimes puts the sections in the
wrong order.
2002-09-24 15:04:48 +00:00
mycroft
bddb0d021d Similarly, remove support for short arguments. 2002-09-24 14:09:43 +00:00
mycroft
fa344ccc4b Remove quad support. We don't need it, and it wastes a lot of space. (It
pulls in {,u}{div,mod}di3() and qdivrem().)
2002-09-24 14:05:33 +00:00
mycroft
56288dc0e5 %ld -> %p 2002-09-24 13:59:31 +00:00
mycroft
fa5df29420 Include xassert() only if DEBUG, like the real assert().
Also, xassert() calls abort(), so there's no need to do it in all of the
callers.
2002-09-24 13:06:07 +00:00
mycroft
7f44855294 Remove the SVR4_LIBDIR madness. 2002-09-24 12:52:20 +00:00
mycroft
3c16ffb1dd Woops, unmap the first page in the `win' case, too.
Tidy up a bit.
2002-09-24 12:44:58 +00:00
mycroft
72b0e512c3 Change the comment about l_offs. 2002-09-24 12:18:32 +00:00
mycroft
9d8c69b929 Remove vestiges of VARPSZ. 2002-09-24 12:12:07 +00:00
junyoung
175c20cbcf Nuke PAGESIZE. 2002-09-24 09:45:59 +00:00
junyoung
4b4a707c66 Use _rtld_pagesz instead of PAGESIZE. 2002-09-24 09:35:13 +00:00
junyoung
d190613fbb space -> tab. 2002-09-24 09:26:43 +00:00
junyoung
93f2d9023a Don't need to use union any longer. 2002-09-24 09:22:51 +00:00
junyoung
272e959468 Remove '\n' at the end of dbg strings. 2002-09-24 08:56:30 +00:00
junyoung
61e1361da6 END_SYM is no longer used. 2002-09-24 06:43:14 +00:00
mycroft
97aed9957d -I${.CURDIR} is done at the top-level, so there's no need to do it here. 2002-09-24 01:59:44 +00:00
mycroft
b59c269424 Nuke reference to RTLD_RELOCATE_SELF. 2002-09-24 01:58:44 +00:00
mycroft
c3ece2a45f Use/require AT_PAGESZ on all platforms. (The kernel has exported it for ~3
years now.)  Use _rtld_pagesz instead of getpagesize() to determine the page
size in our local malloc().  Saves a system call.

Also, since we're now relocated early, we don't need to be careful to avoid
globals, so most of the VARPSZ hacks are eliminated.
2002-09-24 01:24:44 +00:00
mycroft
d1351c627c Um, a little bit of sanity here:
l_addr is always supposed to be obj->relocbase -- or so says the GDB code that
uses it.  So, set it to this on all platforms.  It already was on VAX
explicitly, and on everything else except MIPS implicitly (because
mapbase==relocbase for all existing shlibs).  For some silly/stupid reason, a
new field was created that the MIPS GDB currently uses.
Another MD #ifdef bites it.
2002-09-24 00:33:39 +00:00
mycroft
f1184d192e Very minor cleanup of the previous. 2002-09-24 00:02:46 +00:00
mycroft
86103e2f0e Several small changes that shave 7-8% off the simple-exec-loop test:
* Rename _rtld_find_library() to _rtld_load_library().  It now calls
  _rtld_load_object() if necessary to actually load the object, rather
  than having the caller do it.  To do this, it also takes the `mode'
  argument that gets passed to _rtld_load_object().

* On a related note, remove _rtld_check_library(), and instead call
  _rtld_load_object() to instead try actually loading the object.  We
  save two extra namei's and a bunch of redundant work (almost
  literally the same code) this way.

* In _rtld_map_object(), mmap(2) the first page read-only, rather than
  read(2)ing it.

* In _rtld_symlook_obj(), compare the *second* character of the symbol
  name before calling strcmp().  (This first character is too
  frequently `_', and turns out to not be helpful, in libc.)

* Also in _rtld_symlook_obj(), remove the bogus STT_FUNC special case
  -- this also allows removing the `in_plt' argument to
  _rtld_symlook_list() and _rtld_symlook_obj().

Also:

* In _rtld_obj_from_addr(), rather than trying to look up `_end' in
  the each object, instead use obj->mapsize as the upper bound.
2002-09-23 23:56:46 +00:00
mycroft
aae6c28cf9 null commit 2002-09-23 12:44:34 +00:00
itojun
a9fc5f306a poll.h, not sys/poll.h 2002-09-23 03:32:34 +00:00
mycroft
c3a2d8b7ba Add combreloc code here too. 2002-09-21 17:51:44 +00:00
junyoung
930998f892 Print the name of dynamic linker actually loaded. 2002-09-21 05:24:17 +00:00
mycroft
9a36a8340f Use the argument to stilloob() for the poll... 2002-09-20 19:13:24 +00:00
mycroft
e62e5a8b1a Remove dead code. 2002-09-20 19:11:17 +00:00
mycroft
49ac051d58 Remove a small piece of dead code. 2002-09-20 19:07:34 +00:00
junyoung
48910dcfc1 Cosmetic changes (long lines). 2002-09-20 03:39:22 +00:00
itojun
89b1e287f7 find_user() in process.c does an unbounded copy into a destination
buffer that is smaller in size than the source buffer.

also, there is no guarantee that any of the string components of
the request packet are null terminated.

in some cases, not all elements of the response buffer are
explicitly set. specifically pad and addr. a talk client can spy to
see which host is talking to which host by sending out regular
packets, to which talkd responds without clearing the addr element.

from xs@kittenz.org
2002-09-19 14:39:51 +00:00
junyoung
18139870a5 Cosmetic changes. 2002-09-19 14:05:37 +00:00
christos
6d0f752a65 don't core dump setting progname if argv[0] == NULL. From xs@kittenz.org 2002-09-19 13:59:46 +00:00
lukem
e3b1a0e70b use NETBSDSRCDIR as appropriate 2002-09-19 03:17:50 +00:00
mycroft
720a68f0ca select() -> poll() 2002-09-18 20:58:56 +00:00
mycroft
51581bcb01 select() -> poll() 2002-09-18 20:37:11 +00:00
mycroft
015ea63be5 Fix an error message. 2002-09-18 20:20:28 +00:00
mycroft
315144beb5 select() -> poll() 2002-09-18 20:17:55 +00:00
mycroft
5580adb284 select() -> poll() and nanosleep() 2002-09-18 20:04:51 +00:00
junyoung
a5390eb121 _rtld_setup_pltgot() belongs to reloc.c. 2002-09-18 07:35:40 +00:00
lukem
bafe5da620 use bsd.own.mk instead of the (obvious typo of) bsd.obj.mk 2002-09-18 06:24:33 +00:00
lukem
99fe9d3e76 minor makefile delint 2002-09-18 06:17:38 +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
thorpej
7e6d181789 No PC24 relocs will ever be unaligned. Pointed out by mycroft. 2002-09-15 01:08:04 +00:00