This is an archive of the discontinued LLVM Phabricator instance.

llvm-objdump: Print symbol name if it's address is the same as the next one's
AbandonedPublic

Authored by kzhuravl on Mar 15 2018, 2:32 PM.

Details

Reviewers
espindola
Summary

Currently, if 2 symbols have the same address, the first symbol name is not
printed during disassembly, therefore missing it completely in the disassembled
text. This patch changes it to print first symbol's name in the case described.

Diff Detail

Event Timeline

kzhuravl created this revision.Mar 15 2018, 2:32 PM
espindola requested changes to this revision.Mar 15 2018, 3:52 PM

Given

foo:
bar:

nop

gnu objdump will print

0000000000000000 <bar>:

0:   90                      nop

With this patch we would print both foo and bar, correct? Why is this better? Should we report a bug on gnu objdump?

This revision now requires changes to proceed.Mar 15 2018, 3:52 PM

Why is this better?

I know I've hit aliased functions in the past and had to run nm or something to find out where they are instead of just grepping the disassembly. So I'm definitely in favour.

espindola accepted this revision.Mar 19 2018, 10:01 AM

Why is this better?

I know I've hit aliased functions in the past and had to run nm or something to find out where they are instead of just grepping the disassembly. So I'm definitely in favour.

As a compromise, LGTM if you first report a bug on GNU objdump so that we find out if they have any rationale for printing only one of the symbols.

This revision is now accepted and ready to land.Mar 19 2018, 10:01 AM
kzhuravl abandoned this revision.Apr 2 2019, 12:43 PM