[llvm-bugs] [Bug 40773] New: llvm-readelf does not print section types if unknown

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Feb 19 07:36:59 PST 2019


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: unassignedbugs at nondot.org
          Reporter: jh7370.2008 at my.bristol.ac.uk
                CC: jh7370.2008 at my.bristol.ac.uk, llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190219/0ce9a308/attachment.html>


More information about the llvm-bugs mailing list