Bug 30908

Summary: [PATCH] Tweak ldd to provide more information if requested
Product: Base System Reporter: mwm
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description mwm 2001-09-29 09:10:01 UTC
	If one of the dynamically loaded libraries loads a library
	that's been updated, ldd provides almost no help in finding the
	library that's asking for an out-of-date library. The
	particular example that triggered this was galleon looking for
	both libpng.so.4 and libpng.so.5, because one of the libraries
	was looking for libpng.so.4 even though the binary proper was using
	libpng.so.4

Fix: The attached diff adds code to ld-elf.so.1 to check a new
	environment variable when tracing, and if it is set to print
	the name of each object before printing the objects that it
	needs. There are no changes if it isn't tracing loaded
	objects. The patch also adds a flag to ldd to cause it to set
	this environment variable and not print the name of the file
	being examined, as rt-elf.ld.so.1 will do that in this
	case. The patch also updates the manual pages to reflect these
	changes.
How-To-Repeat: 
	Try "ldd /usr/bin/k5admin" and note that it uses ncurses, even
	though the k5admin object doesn't refer to that library in
	any way. In this particular case, it's pretty obvious that
	libreadline is dragging it in. It isn't always quite so obvious,
	especially for large X programs.
Comment 1 David E. O'Brien freebsd_committer freebsd_triage 2002-02-17 06:53:15 UTC
State Changed
From-To: open->closed

Committed
Comment 2 edwin 2002-06-22 10:34:08 UTC
Although this PR has been closed, it hasn't been MFC-ed.

As a person who has submitted a similair patch I wouldn't mind if
it was MFC-ed so that it could be used in 4.7 (I was actually hoping
to see it work in 4.6 already, it would have saved me some serious
headaches today...)

Thanks in advance,
Edwin

-- 
Edwin Groothuis      |           Personal website: http://www.MavEtJu.org
edwin@mavetju.org    |        Interested in MUDs? Visit Fatal Dimensions:
bash$ :(){ :|:&};:   |                    http://www.FatalDimensions.org/