Commit Graph

91 Commits

Author SHA1 Message Date
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
wiz fd08660c9a \*[Gt] instead of >; sort SEE ALSO. 2004-05-14 22:07:21 +00:00
christos 2f5db2d55d s/notreached/noreturn/ 2004-05-14 22:04:01 +00:00
christos b4b51ab090 Document and implement -f for elf objects. 2004-05-14 21:56:45 +00:00
jmc 214b8c2d1e Add -f arguments into usage 2003-12-19 19:57:18 +00:00
jmc 66e9f52056 Start on adding support for -f flags as ldd did for a.out. PR#17786.
First, parse arguments correctly so -f isn't taken as a file name. For ELF
don't do anything yet, but for a.out compat, pass formats along when
exec'ing binary.
2003-12-19 19:56:56 +00:00
skrll d900731978 Resolve dlsym(3) and friends directly so that dlsym(RTLD_NEXT,...) works.
Previously dlsym resolved to the version in crt0.o or libc which would
mean that the caller's shared object couldn't be determined correctly
using __builtin_return_address(0).

Mainly from FreeBSD, but adapted by me. Benefits of this solutions are:

	- backward comptibility maintained
	- existing broken binaries are fixed with a new ld.elf_so
	- __mainprog_obj can be removed from crt0.o
	- we do the same thing as FreeBSD

Fixes PR 22067.

OKed by Jason and Christos.
2003-08-12 09:18:38 +00:00
dsl b5a44ece1f Look at mode of program being run, not of ldd when deciding whether to
use LD_LIBRARY_PATH.
2003-05-28 20:45:39 +00:00
wiz 64ef7a20ff Sort sections, sort SEE ALSO, bump date for last. 2003-04-24 12:06:56 +00:00
mycroft e7a1f4e518 Catch up with ld.elf_so. 2003-04-23 21:39:08 +00:00
christos ec5141c96b PR/3046: Chris G. Demetriou: ldd actually runs target programs.
This is the case only with a.out programs, and the manual page has been
changed to reflect that in the BUGS section. Since most our architectures
have been converted to elf, this is not an issue anymore.
2003-04-19 23:45:44 +00:00
perry 6c607318b5 depedencies->dependencies (Igor Sobrado, PR misc/19700) + recognised->recognized 2003-03-31 01:57:39 +00:00
fvdl 3e5d4ebe28 Get stat info and pass it to the object map function. 2003-02-06 12:40:21 +00:00
junyoung d293fed282 Remove KNF from TODO list. 2002-12-02 14:08:17 +00:00
junyoung 2b65911602 KNF. 2002-12-02 14:05:11 +00:00
nathanw 83be8543f2 Add a _rtld_dlerror() function, since it it now needed by search.c,
and otherwise make the error routines look more like what's currently
in rtld.c (so *this* is where _rtld_error_message was hiding...).
2002-11-15 22:39:17 +00:00
nathanw d9b9596c8d Pass _rtld_map_object a heap-allocated path, since it will free the
path on failure. Prevents calling free() on a stack address if you run
ldd on an unrecognized file format.
2002-10-09 15:43:34 +00:00
junyoung 578b2b0e36 Make use of _rtld_pagesz. 2002-09-24 09:58:03 +00:00
lukem 5d4973fe97 makefile delint. use NETBSDSRCDIR as appropriate 2002-09-18 14:00:33 +00:00
tron 57a909560e Adapt to changes in "rtld.h". 2002-09-13 08:40:05 +00:00
lukem ed401558f2 Implement MKDYNAMICROOT, which currently defaults to "no", but will
be changed in the future to "yes".

If MKDYNAMICROOT == "no", there is no change from existing behaviour
of a static /bin and /sbin (and a few programs in elsewhere).

If MKDYNAMICROOT == "yes", the following changes occur:
    in <bsd.own.mk>:
	SHLIBDIR?=     /lib
	SHLINKDIR?=	/lib
    in various Makefiles, the following entry is DISABLED.
	LDSTATIC?=-static
This results in all programs (except those "standalone" programs built
in sys/arch/*/stand) are linked dynamically, the shared linker is moved
from /usr/libexec to /lib (with a compat symlink), and the shared
libraries used by /bin and /sbin programs are moved from /usr/lib to
/lib (with compat symlinks).
2002-08-27 14:46:11 +00:00
thorpej 7e8a4549fd Update ELFSIZE and VARPSZ arch lists. 2002-01-23 01:38:57 +00:00
thorpej 892294e9f7 xref ld.elf_so(1) 2001-12-20 06:43:00 +00:00
matt 5f1585220e arm is variable page size. 2001-07-13 17:00:35 +00:00
cgd a8ec668ddf convert to use getprogname() 2001-02-19 23:03:42 +00:00
simonb 36636551b6 Lift the internals of the a.out ldd, and try that if _rtld_map_object()
can't map the target as an ELF file.  Tested in hp300 and i386.
2000-12-12 11:16:02 +00:00
mycroft 0581ae5bad Make ldd(1) build again. 2000-11-10 23:53:04 +00:00
mycroft 8401b85a70 Unmap from mapbase, not relocbase. 2000-07-26 19:39:07 +00:00
eeh 6697064b0d Make this compile on sparc64. 2000-07-10 22:45:25 +00:00