Bug 30080 - nm docs mention read-only twice
Summary: nm docs mention read-only twice
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Nick Clifton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-04 20:53 UTC by Tom Tromey
Modified: 2023-02-07 12:27 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2023-02-04 20:53:25 UTC
The nm docs say:

     'n'
          The symbol is in the read-only data section.
...
     'R'
     'r'
          The symbol is in a read only data section.

I think it would be useful if the difference between
'n' and 'r' was documented.
Comment 1 Nick Clifton 2023-02-06 13:40:25 UTC
Hi Tom,

  It is not clear to me how the 'n' symbol type is ever generated, but the code
  in bfd/syms.c:decode_section_type() makes it clear that the description in the
  documentation is wrong.  So how about this rewording:

   'n'
          The symbol is in a non-data, non-code read-only section.

Cheers
  Nick
Comment 2 Tom Tromey 2023-02-06 23:04:49 UTC
Thanks Nick.  That looks good to me.  I also wonder if that could
ever happen.  Maybe it's possible for some format but not ELF?
Comment 3 Sourceware Commits 2023-02-07 11:41:34 UTC
The master branch has been updated by Nick Clifton <nickc@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3a8be578d658b1cad3579aea0f5ce4883de21e6b

commit 3a8be578d658b1cad3579aea0f5ce4883de21e6b
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Feb 7 11:40:46 2023 +0000

    Fix documentation of the 'n' symbol type displayed by nm.
    
    PR 30080 * doc/binutils.texi (nm): Update description of the 'n' symbol type.
Comment 4 Nick Clifton 2023-02-07 11:43:18 UTC
Hi Tom,

  Yeah - I suspect some PE/COFF special symbol type, but I could not find any way actually trigger nm to output that type...

  Anyway I have checked in the suggested change, although I extended it to note that 'n' symbols are also not debugging symbols.

Cheers
  Nick
Comment 5 Andreas Schwab 2023-02-07 12:13:32 UTC
See commit a3b6428fe79.
Comment 6 Nick Clifton 2023-02-07 12:27:11 UTC
(In reply to Andreas Schwab from comment #5)
> See commit a3b6428fe79.

.comment and .note eh ?  I wonder why they would have symbols ?  Still fair enough, such symbols can obviously be produced.  I stand by the updated description of the 'n' symbol though.

Thanks for pointing out that commit Andreas.

Cheers
  Nick