Commit Graph

119 Commits

Author SHA1 Message Date
christos 28ad8d2d4f include symver.c 2013-05-07 13:00:35 +00:00
matt 1c3095e278 If earm, include from lib/libexecinfo for unwind.h 2013-04-25 07:12:46 +00:00
macallan da8b2f53fd apply kludge to make this more or less work on mips64 with n32 userland
with this ldd can handle both 64 and n32 binaries ( previously it would do 64
only ), o32 support is still broken
Someone more familiar with this code needs to fix this properly.
2013-03-20 15:18:42 +00:00
matt 9a1cb11528 Make sure stuff using Obj_Entry is compiled correctly for ELF32 or ELF64. 2012-07-08 00:53:44 +00:00
matt 02a2e7c81a MIPS uses a variable page size now.
(pulled up from matt-nb5-mips64)
2012-02-17 08:13:18 +00:00
wiz 4cbd24b23f dependant -> dependent 2011-06-30 20:09:15 +00:00
joerg 9a1e56f24b Fix sign compare 2011-05-24 12:27:29 +00:00
plunky d1fbb9e17f move the build of ldd binary to a subdir in order to allow
explict ordering. This makes "make all" work the same as
"make dependall"
2011-04-15 08:47:02 +00:00
joerg 8fa6585514 Block signals when using the exclusive lock. 2011-03-29 20:56:35 +00:00
joerg cb1cd7e860 Add basic locking to ld.elf_so. 2011-03-25 18:07:04 +00:00
joerg aad599979d Add TLS support infrastructure. For dynamic binaries, ld.elf_so exports
_rtld_tls_allocate and _rtld_tls_free. libpthread uses this functions to
setup the thread private area of all new threads. ld.elf_so is
responsible for setting up the private area for the initial thread.
Similar functions are called from _libc_init for static binaries, using
dl_iterate_phdr to access the ELF Program Header.

Add test cases to exercise the different TLS storage models. Test cases
are compiled and installed on all platforms, but are skipped on
platforms not marked for TLS support.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.

It is inspired by the TLS support in FreeBSD by Doug Rabson and the
clean ups of the DragonFly port of the original FreeBSD modifications.
2011-03-09 23:10:05 +00:00
skrll e6cdac9c4b Implement dl_iterate_phdr.
Somewhat taken from FreeBSD. Manual page from OpenBSD.
2010-10-16 10:27:06 +00:00
roy 9033c3cfe7 Sync against new ld.elf_so 2010-02-27 11:17:05 +00:00
skrll 4931e61023 Mark each object as printed as visited and then print.
Fixes PR/42811.

As a side effect the libraries are printed in, imo, a better order.
2010-02-23 08:23:24 +00:00
mrg f4f977dbc5 make this actually build on mips64. 2009-12-15 04:06:43 +00:00
mrg 118cb193d7 - adjust the logic for compat ldd: add an elf32_compat module and arrange
for mips64 to build this with MLIBDIR set to o32
- make mips64 ldd call elf32_compat_ldd as well
- make mips64 elf64 set MLIBDIR to 64
- don't need ld.elf_so's Makefile.ld32 files anymore (they are going away
  soon anyway)

tested on amd64 and sparc64, and an earlier version tested on mips64.
2009-12-13 08:50:56 +00:00
skrll 77fd7698f3 Make _rtld_pagesz of type size_t.
Fixes round_down for alpha which made ldd(1) break.
2009-11-17 18:44:33 +00:00
wiz 82271cde5a New sentence, new line. 2009-09-07 20:06:21 +00:00
dholland 15a88044ca Add an -o option that behaves like nm -o. Implementation from a suggestion
by jmcneill (thanks!); ok mrg. Closes PR 41994.
2009-09-07 17:56:52 +00:00
dholland 1657935cd2 Sprinkle a little const. no object diffs 2009-09-07 04:49:03 +00:00
wiz 87e1425a46 Add missing word and bump date for previous. 2009-08-23 15:37:39 +00:00
mrg a9208fb155 kill ldd_aout. it didn't work anyway...not since i don't know when. 2009-08-22 06:52:15 +00:00
he 3b9a95def3 Um, the test for mips should use MACHINE_CPU, not MACHINE_ARCH. 2009-08-20 21:07:47 +00:00
he c93d22967f Don't try to call the (no longer defined) aout_ldd() function
if we're building for mips.
2009-08-20 21:06:17 +00:00
he b233b36efa Don't include <a.out.h> unless it's needed, and don't build
the aout subdir if on mips.  Fixes build for mips ports.
2009-08-20 19:17:19 +00:00
martin f842f249ac More missing <sys/exec_aout.h> 2009-08-16 18:43:08 +00:00
christos ebd7e1e10a catch up with rtld changes 2009-05-20 16:20:01 +00:00
lukem c1ceae17f0 Enable WARNS=4 by default for usr.bin, except for:
awk  bdes  checknr  compile_et  error  gss  hxtool  kgetcred  kinit
	klist  ldd  less  lex  locale  login  m4  man  menuc  mk_cmds
	mklocale  msgc  openssl  rpcgen  rpcinfo  sdiff  spell  ssh
	string2key  telnet  tn3270  verify_krb5_conf  xlint
2009-04-14 22:15:16 +00:00
abs 515e52158b Convert more MACHINE tests to MACHINE_ARCH 2009-02-14 13:50:50 +00:00
mrg e53a76c628 rework the main loop and handlers:
- open() and close() the file in the main loop
- pass the fd down into the handlers
- use _rtld_error() in ELFNAME(ldd)

this fixes PR#40543 and also makes error messages look better.
2009-02-03 03:01:02 +00:00
tron 31faff7381 Include "bsd.own.mk" to get the definition of "NETBSDSRCDIR" via
"/etc/mk.conf". This fixes manual use of "make cleandir".
2009-01-20 22:49:29 +00:00
christos 2567980901 another bsd.own.mk missing 2009-01-11 05:01:34 +00:00
christos da0b5ebdeb need bsd.own.mk for $NETBSDSRCDIR 2009-01-11 03:50:50 +00:00
mrg 0d6aaaf295 pull across the struct netbsd32_exec definition and use that in all
cases, since we never did 64 bit a.out.  now ldd on 32 bit a.out
at least tries to work, but fails (on sparc or sparc64, no idea yet
for x86) the same way that all dynamic a.out binaries fail.
2009-01-11 00:06:55 +00:00
mrg 32ae7959e8 make sure we set LIBISPRIVATE.
fixes build issues reported by moof.
2009-01-07 07:52:28 +00:00
mrg 9b688fed42 - rework this a bunch to make it work inside /rescue/ldd.
- fix alpha build.
2009-01-07 00:39:23 +00:00
mrg 648c936726 - get rid of building an a.out-happy ldd (but keep supporting a.out
binaries for the ELF version.)

- convert a.out, elf32 and elf64 support into convience libraries and
  link them right ones in.  if elf_ldd() fails on 64 bit platforms,
  try elf32_ldd() before aout_ldd().


now ldd on 64 bit platforms works for 32 bit binaries, aka PR#40199,
and it seems that all the issues from README are gone too.
2009-01-06 03:59:56 +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
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
christos 3833b1d829 call sysconf, before add paths. From Kurt Schreiner 2007-10-08 12:51:21 +00:00
christos 33631b9b4a call xfree instead of free so that we don't bring in libc's free. 2007-10-08 00:15:05 +00:00
christos be632c9205 make this compile again. Thanks Kurt Schreiner. 2007-05-19 15:35:04 +00:00
wiz 09cb1d6f1c s/existance/existence/, from Zafer. 2006-11-24 22:52:16 +00:00
ross 2f202b9b76 Make yet another ELF64 check work for powerpc64. 2006-07-08 06:51:36 +00:00
christos ceb6edafa6 Coverity CID 922: Fix check against NULL. 2006-04-02 03:50:38 +00:00
yamt 87a5de2d3d add rcsid. 2005-12-27 11:29:30 +00:00
enami 94265c64d4 Fix default format so that not to print NULL (e.g., ldd mozilla-bin). 2004-09-07 02:54:40 +00:00
skrll d44ea9e7e9 Bump the date. 2004-05-23 06:51:42 +00:00
skrll f835ef11b6 Implement %x for ELF. 2004-05-23 06:51:05 +00:00