gnu/118415: nm -D fails if a file has no symbols

Nate Eldredge neldredge at ucsd.edu
Mon Dec 3 23:20:01 PST 2007


>Number:         118415
>Category:       gnu
>Synopsis:       nm -D fails if a file has no symbols
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 04 07:20:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Nate Eldredge
>Release:        6.2-RELEASE
>Organization:
>Environment:
FreeBSD vulcan.lan 6.2-RELEASE-p8 FreeBSD 6.2-RELEASE-p8 #24: Thu Nov 29 09:52:48 PST 2007     nate at vulcan.lan:/usr/obj/usr/src/sys/VULCAN  amd64
>Description:
If nm -D is given multiple files, one of which has no symbols (perhaps because it's statically linked), it exits after processing that file without processing the rest.  This is inconvenient and probably not what was intended.
>How-To-Repeat:
nate at vulcan:/tmp$ file /usr/bin/true /rescue/sh /usr/bin/false 
/usr/bin/true:  ELF 64-bit LSB executable, AMD x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), stripped
/rescue/sh:     ELF 64-bit LSB executable, AMD x86-64, version 1 (FreeBSD), statically linked, stripped
/usr/bin/false: ELF 64-bit LSB executable, AMD x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), stripped
nate at vulcan:/tmp$ nm -D /usr/bin/true /rescue/sh /usr/bin/false 

/usr/bin/true:
00000000005007b8 A _DYNAMIC
0000000000500910 A _GLOBAL_OFFSET_TABLE_
                 w _Jv_RegisterClasses
0000000000500940 A __bss_start
                 w __deregister_frame_info
00000000005006c0 D __progname
                 w __register_frame_info
0000000000500940 A _edata
0000000000500998 A _end
0000000000400618 T _fini
0000000000400448 T _init
                 U _init_tls
                 U atexit
0000000000500990 B environ
                 U exit

/rescue/sh:
nm: /rescue/sh: No symbols
nate at vulcan:/tmp$ nm -D /usr/bin/true  /usr/bin/false /rescue/sh 

/usr/bin/true:
00000000005007b8 A _DYNAMIC
0000000000500910 A _GLOBAL_OFFSET_TABLE_
                 w _Jv_RegisterClasses
0000000000500940 A __bss_start
                 w __deregister_frame_info
00000000005006c0 D __progname
                 w __register_frame_info
0000000000500940 A _edata
0000000000500998 A _end
0000000000400618 T _fini
0000000000400448 T _init
                 U _init_tls
                 U atexit
0000000000500990 B environ
                 U exit

/usr/bin/false:
00000000005007b8 A _DYNAMIC
0000000000500910 A _GLOBAL_OFFSET_TABLE_
                 w _Jv_RegisterClasses
0000000000500940 A __bss_start
                 w __deregister_frame_info
00000000005006c0 D __progname
                 w __register_frame_info
0000000000500940 A _edata
0000000000500998 A _end
0000000000400618 T _fini
0000000000400448 T _init
                 U _init_tls
                 U atexit
0000000000500990 B environ
                 U exit

/rescue/sh:
nm: /rescue/sh: No symbols

>Fix:
Probably simple, but didn't look.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list