Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Mar 1996 10:59:02 -0800
From:      John Polstra <jdp@polstra.com>
To:        freebsd-hackers@freebsd.org
Subject:   "nm -og": binutils vs. FreeBSD vs. SunOS vs. Posix
Message-ID:  <199603211859.KAA16365@austin.polstra.com>

next in thread | raw e-mail | index | archive | help
I need some advice about whether something in GNU binutils-2.6 is a bug
or not.  It has to do with the output of "nm -og *.o".

The "nm" from binutils-2.6 offers three different output formats, "bsd",
"sysv", and "posix".  Both the "bsd" and "posix" formats produce output
like this:

    bar.o:00000004 T _barproc
    bar.o:         U _printf
    foo.o:00000004 T _fooproc
    foo.o:         U _printf

But FreeBSD's "nm" produces output like this:

    bar.o:
    bar.o:00000004 T _barproc
    bar.o:         U _printf

    foo.o:
    foo.o:00000004 T _fooproc
    foo.o:         U _printf

The blank lines don't matter, but the "bar.o:" lines are crucial -- our
"lorder" relies on them.  I checked the bsd4.4-lite2 sources, and their
"lorder" is identical to ours, so I assume that their "nm" has the same
behavior as ours.

So, I would say that GNU's "nm" is not giving correct "bsd" output.
Except ... I also tried it on a SunOS-4.1 system, and their "nm" agrees
with GNU's.  So I don't know whether to report a bug to GNU or not.

Two questions:  What do other BSD-derived systems do?  And, what does
Posix say about it, if anything?

If SunOS is the odd man out, then I could create a fourth format
"sunos", fix the "bsd" behavior, and probably get GNU to accept the
changes.

Opinions, please.
--
   John Polstra                                       jdp@polstra.com
   John D. Polstra & Co., Inc.                Seattle, Washington USA
   "Self-knowledge is always bad news."                 -- John Barth



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603211859.KAA16365>