misc/105542: on amd64, ldd produces bogus output for i386 executables

David Sanderson dsanderson at panasas.com
Tue Nov 14 21:20:03 UTC 2006


>Number:         105542
>Category:       misc
>Synopsis:       on amd64, ldd produces bogus output for i386 executables
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 14 21:20:02 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     David Sanderson
>Release:        FreeBSD 6.1 (amd64, i386)
>Organization:
Panasas
>Environment:
FreeBSD compute-6-29 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May  7 04:15:57 UTC 2006     root at bloom.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  amd64

>Description:
The problem seems to be that ldd isn't setting LD_32_* environment variables
along with the LD_* environment variables that it already sets:

: compute-6-29; ldd /usr/pan/bin/tclsh8.3
ldd: /usr/pan/bin/tclsh8.3: can't read program header
ldd: /usr/pan/bin/tclsh8.3: not a dynamic executable
: compute-6-29; ldd32 /usr/pan/bin/tclsh8.3
        libtcl83.so => /usr/pan/lib/libtcl83.so (0x28077000)
        libm.so.4 => /usr/lib32/libm.so.4 (0x280fb000)
        libc.so.6 => /usr/lib32/libc.so.6 (0x28112000)
: compute-6-29; cat $HOME/scripts/ldd32
#!/bin/sh
#-------
# This lets us see what's going on with loading 32-bit shared objects
# on FreeBSD 6.
#-------
export LD_32_TRACE_LOADED_OBJECTS; LD_32_TRACE_LOADED_OBJECTS=1
exec "$@"

>How-To-Repeat:
Use ldd on a dynamically loaded i386 executable on an amd64 freebsd6
system.
>Fix:
The fix would presumably be to go through the ldd code and have it
set LD_32_* in addition to LD_*, for each LD_* variable it currently
sets.  Some adjustments to how ldd examines the program header may also
be necessary.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list