https://sourceware.org/bugzilla/show_bug.cgi?id=34060
Bug ID: 34060
Summary: nm: the -f (--format) option is incompatible with -f
("full") POSIX definition
Product: binutils
Version: 2.47 (HEAD)
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: binutils
Assignee: unassigned at sourceware dot org
Reporter: jscott at posteo dot net
Target Milestone: ---
Since Issue 7 and probably before, POSIX has prescribed the following meaning
for the -f option to nm when the XSI option is supported
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/nm.html#tag_20_88_04
> -f Produce full output. Write redundant symbols (.text, .data, and .bss),
> normally suppressed.
However, both the Binutils and elfutils version uses this for --format, to
request BSD, System V, or POSIX-style output. For this usage an option argument
specifying the flavor is mandatory:
https://forge.sourceware.org/binutils-gdb/binutils-gdb-mirror/src/branch/master/binutils/nm.c#L255
One way to support giving -f the POSIX-defined feature is to guard it behind
POSIXLY_CORRECT; I'd be happy with this. Technically it would be possible to
infer that a -f option is intended to have the POSIX functionality if -P were
used simultaneously, and/or there is no option argument for -f (i.e. if another
flag comes directly after -f, as in '-f -P', the user must've intended to get
the POSIX functionality). That kind of clever trickery might confuse more
people than it'd help, however.
So, I'd like the -f option ("full") to take on the POSIX meaning at least when
POSIXLY_CORRECT is set. nm may not have an equivalent option already though, in
which case that may need to be implemented.
--
You are receiving this mail because:
You are on the CC list for the bug.