[llvm-dev] RFC: Use section name or <first-symbol>-<offset> as the section start symbol

via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 24 12:33:08 PDT 2019


Since `llvm-objdump –disassemble` is performed symbol by symbol, when dissembling a section that don’t have a symbol at its start address, we need to figure out a proxy symbol name for the address. `.plt` is a typical case where entry zero has no symbol. Currently llvm-objdump choose to use section name as the proxy symbol across all targets for all sections (including special section like .plt etc.) whereas GNU objdump uses “<first-symbol>-<offset>”. I submitted a patch to improve the compatibility with GNU.

Before the patch:

bar2 at plt:
        jmp  -32 <.plt>

after the patch:

bar2 at plt-0x10:
bar2 at plt:
        jmp  -32 <bar2 at plt-0x10>

Fangrui and Peter think the code looks verbose and not aesthetically appealing, suggested we not to adopt GNU behaviour. For disassembly, do we want to exactly match the output of GNU objdump, if there are possible improvements?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190624/a3870a40/attachment.html>

More information about the llvm-dev mailing list