https://bugs.llvm.org/show_bug.cgi?id=40773

            Bug ID: 40773
           Summary: llvm-readelf does not print section types if unknown
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-readobj
          Assignee: unassignedb...@nondot.org
          Reporter: jh7370.2...@my.bristol.ac.uk
                CC: jh7370.2...@my.bristol.ac.uk, llvm-bugs@lists.llvm.org

If llvm-readelf encounters a section type it does not recognise, rather than
printing something along the lines of "unknown" or listing the value as hex, it
leaves the space in the section header dump blank. This is not great at all,
and could break parsers too.

GNU readelf's behaviour is sensible, but varies depending on the exact value.
For values less than SHT_LOOS, the unknown tpye is printed something like this:
"00001000: <unkn"

For values in the OS/Processor/User ranges, it prints it in the form
LOOS/PROC/USER+X e.g:
LOOS+0 (for 0x60000000)
LOUSER+0x7fffff (for 0xffffffff)

We should do something sensible. Options include printing "Unknown (0x123456)"
like llvm-readobj, simply printing "0x123456" or matching GNU's behaviour. I
favour the latter, to make the output as close as possible to GNU's (though I
might suggest "00001000: <unknown>" for values lower than LOOS).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to