Commit Graph

663 Commits

Author SHA1 Message Date
skrll 15653ebb45 ld.elf_so grew more PLABELS with dlinfo so bump HPPA_PLABEL_PRE. 2009-09-25 17:49:56 +00:00
pooka 4c1e54d82b Add Solarisa-like dlinfo() interface to the ELF dynamic linker.
Implement RTLD_DI_LINKMAP which returns a pointer to the linkmap
chain at the given object.  Other Solaris queries are currently
unimplemented.
2009-09-24 21:21:33 +00:00
skrll ffb28af545 Fix start symbol. I have no idea how this worked before. 2009-09-19 14:54:17 +00:00
skrll 4b849729b2 Fix the start symbol. 2009-09-12 07:22:16 +00:00
jmmv 2cb749c2fd Remove trailing \n in calls to _rtld_error: a newline is automatically
added by a call to the function.
2009-08-29 13:46:54 +00:00
he 45932f91e5 Apply fix borrowed from i386: Fix const issue (cast const pointers
to "const uint8_t *" instead of "caddr_t").
2009-05-24 20:35:41 +00:00
he 237687b934 Copy build fix from i386: Fix const issues (cast const pointers
to "const uint8_t *" instead of "caddr_t").
2009-05-24 18:29:03 +00:00
mjf 27cb8d0e73 After a recent WARNS= bump on ld.elf_so it fails to build on hppa,
complaining that we're "discarding qualifier from pointer target
type".

Use const char * instead of caddr_t to avoid the warning and get
distribution building on hppa again.
2009-05-23 17:50:34 +00:00
martin c131490c29 Use the new Elf_SOff (signed offset) type to fix a few signed/unsigned
problems.
2009-05-22 21:47:46 +00:00
christos b19e027aab fix signed/unsigned comparisons and const cast away (untested) 2009-05-20 22:31:46 +00:00
ad 51a76d6f11 Add a reminder about ldd depending on ld.so. 2009-05-20 19:38:38 +00:00
christos fa64a5bf9b warns=4 2009-05-19 20:44:52 +00:00
lukem e91bd42f43 Fix const issues (cast const pointers to "const uint8_t *" instead of "caddr_t") 2009-04-12 13:29:29 +00:00
lukem b4fba76b41 Fix const issues (cast const pointers to "const uint8_t *" instead of "caddr_t")
NOTE: change based on ../i386/mdreloc.c 1.27
XXX: not compile tested
2009-03-16 02:46:47 +00:00
lukem 337930db10 Fix const issues (cast const pointers to "const uint8_t *" instead of "caddr_t") 2009-03-16 02:44:47 +00:00
lukem 500db00274 Default to WARNS=4
Exceptions that need a lower level are:
	getty ld.elf_so lfs_cleanerd makewhatis telnetd tftpd
	hpropd ipropd-master ipropd-slave kadmind kpasswdd
2009-03-16 02:24:55 +00:00
lukem b8276deac1 rename a variable to avoid a compiler warning 2009-03-15 23:53:03 +00:00
mrg fb3cc85fef add some (uintptr_t) to some casts, so these compile with ELFSIZE=32
*and _LP64.  necessary for 32/64 bit combo ldd support.
2009-01-06 04:01:46 +00:00
mrg 9108f12f6b move the defines for RTLD_ARCH_SUBDIR into a sub-sub-makefile so we can
grab these values via reach-over more easily.
2009-01-06 02:15:06 +00:00
mrg 8679e33545 if LD32DIR is defined:
- look in src/compat/lib/libc for libc_pic.
- define RTLD_ARCH_SUBDIR to "i386" or "sparc" for amd64 and sparc64
  builds, respectively
if RTLD_ARCH_SUBDIR is defined, add this path before
RTLD_DEFAULT_LIBRARY_PATH in the default search path.
2008-10-26 07:11:54 +00:00
christos 3b55965a05 Never build this with PIE. 2008-10-16 14:36:20 +00:00
skrll 8c9056ada8 lib/39649: dlsym(3) does not follow dependencies
Pull across code from FreeBSD to do a search of the passed object and it's
NEEDED objects (dependencies).

Reviewed by gimpy.
2008-10-04 09:37:12 +00:00
macallan 982ae38f15 avoid usind __builtin_return_address(0) on PowerPC because it fails in
Xorg's module loader.
Should fix PR37812
2008-09-27 03:52:05 +00:00
matt 86d6d815ae Make sure to call dlerror() to clear any error messages after the relocations
are done and there are no errors.  This will prevent spurious undefined weak
symbol errors being returned by dlerror().

Fixes PR bin/39240.
2008-07-29 16:27:01 +00:00
skrll dccd9ddf7f RCSID police 2008-07-24 06:51:58 +00:00
matt 38bdc8954f Refactor common code to _rtld_relocate_plt_object to i386 and arm so they
act like the other versions.
In _rtld_bind, if the result is 0, call _rtld_die.
Initialize _rtld_sym_zero.st_value to -_rtld_objself.maprelocbase.  Now when
the symbol is resolved, st_value + maprelocbase will equal 0 and the above
check in _rtld_bind will fire and a call to NULL will be avoided.
2008-07-24 04:39:25 +00:00
christos d3b459e727 abort() if we are trying to use an undefined weak symbol from the plt. Remove
check from relocate_plt_object() since we cannot return _rtld_sym_zero anymore.
Code from gimpy.
2008-07-23 18:16:42 +00:00
christos 0d33a45b97 handle sym_zero like x86_64; other ports might need this too. 2008-07-22 22:27:07 +00:00
christos 56e895e29f deal specially with sym_zero, returned by a weak symbol that was not found,
by retrieving it's name instead of printing random garbage.
2008-07-21 20:19:28 +00:00
ad 156176be13 Fix error in previous. From nakayama@. 2008-06-05 00:03:20 +00:00
ad 53c5ea5da9 Don't bother unmapping the ELF header unless it overlaps the first load
section.
2008-06-03 19:32:32 +00:00
ad 9795e155ec __progname isn't const. 2008-06-03 19:22:07 +00:00
ad 36b49f84f3 Try read() on ld.so.conf. If the file is small, it avoids stat+mmap+munmap. 2008-06-03 18:36:59 +00:00
wiz 488200e6ea Remove trailing whitespace and superfluous .Pp. 2008-05-25 19:48:35 +00:00
martin 11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
yamt 8c93baa802 constify 2008-01-14 08:53:42 +00:00
yamt 8a58f724e1 tabify 2008-01-14 08:52:16 +00:00
christos 8fb14189dc make this compile again. 2007-12-29 01:44:03 +00:00
christos 716fde8fa0 simplify; mapbase == vaddrbase from the PaX author. 2007-12-28 19:36:21 +00:00
christos 8636ab52f6 Deal with ASLR PIE executables, by recognizing that phdr != phdr->v_addr
for PT_PHDR headers when the program has been loader to a vaddr other than
then one specified (a randomized one), and modifying the relocation base
address appropriately (idea from elad)
2007-12-26 21:14:41 +00:00
christos 8b0637156f No need for stack_protector.o if USE_FORT is no.
XXX: compiling a binary with -Wl,--dynamic-linker,${NETBSDSRCDIR}/libexec/...
results in stack overflow. Investigate!
2007-12-26 21:11:52 +00:00
christos 5ad1b72097 print the symbol we are seaching for [when debugging] 2007-12-26 21:10:03 +00:00
ad 558a5ffd0f rtld changes for PR bin/37347:
- Apply patch from J.T. Conklin to execute .init/.fini functions in order.
- Support DF_1_INITFIRST and mark libc with DF_1_INITFIRST. Shared libs
  should be recording a dependency on libc, but it's too late to do that.

Ok christos@.
2007-12-07 20:34:04 +00:00
christos 496f9be3e8 support %z 2007-11-24 18:32:26 +00:00
ad 71ac015ebf stack_protector.c has moved. 2007-11-13 15:34:51 +00:00
skrll 29353f93e2 Build a local copy of exit that doesn't call __cxa_finalize. It's not
needed and drags in a lot of libc via free.
2007-10-30 17:19:59 +00:00
christos ed1a8fea8d build stack protector locally so that we don't call syslog_ss that results
in 1/2 of libc dragged in.
2007-10-29 20:36:31 +00:00
ad bf4b000d16 - Don't use the names malloc/free/etc, since we can end up pulling in libc's
malloc which is not what we want.
- Remove ancient memory compaction hack. Realloc on free memory is now an
  error again (from joerg@).

Ok christos@.
2007-10-05 22:21:07 +00:00
christos 596c6ec5db provide xrealloc, and don't cast and use malloc and realloc directly. 2007-09-27 17:52:16 +00:00