This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump] --syms: print 'i' for STT_GNU_IFUNC
ClosedPublic

Authored by MaskRay on Mar 6 2020, 7:12 PM.

Diff Detail

Event Timeline

MaskRay created this revision.Mar 6 2020, 7:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2020, 7:12 PM

llvm::object::BasicSymbolRef::SF_Indirect exists but I don't think it is suitable.

In theory, I may be possible, but I cannot find any binutils test for I.

MaskRay updated this revision to Diff 248892.Mar 6 2020, 8:54 PM

Add a local STT_GNU_IFUNC

Harbormaster completed remote builds in B48433: Diff 248892.
This revision is now accepted and ready to land.Mar 6 2020, 10:38 PM
grimar accepted this revision.Mar 7 2020, 1:50 AM

I confirm this matches GNU objdump for me.

llvm/test/tools/llvm-objdump/ELF/symbol-table.test
44 ↗(On Diff #248894)

Perhaps it is not clear why there is an empty line between locals and globals.
I'd either remove it or add a comment.

llvm/tools/llvm-objdump/llvm-objdump.cpp
1911

nit: you do not need curly bracers.

MaskRay marked 2 inline comments as done.Mar 7 2020, 8:14 AM
MaskRay added inline comments.
llvm/tools/llvm-objdump/llvm-objdump.cpp
1911

It is to minimize diff for D75797 :)

jhenderson accepted this revision.Mar 9 2020, 2:57 AM

LGTM.

llvm::object::BasicSymbolRef::SF_Indirect exists but I don't think it is suitable.

In theory, I may be possible, but I cannot find any binutils test for I.

What would a I value represent?

MaskRay marked an inline comment as done.Mar 9 2020, 8:35 AM

LGTM.

llvm::object::BasicSymbolRef::SF_Indirect exists but I don't think it is suitable.

In theory, I may be possible, but I cannot find any binutils test for I.

What would a I value represent?

binutils-gdb/bfd/syms.c:bfd_print_symbol_vandr. The I character represents BFD_INDIRECT. By inspecting its references, it is only used by some intermediate representations (bfdlink.c). It cannot be produced when BFD parses an object file, so the rule in bfd_print_symbol_vandr may be dead.

MaskRay updated this revision to Diff 249117.Mar 9 2020, 8:41 AM

Rebase. Rename Indirect to Ifunc because the code path is only possible for STT_GNU_IFUNC.

jhenderson accepted this revision.Mar 10 2020, 2:58 AM

LGTM, with one suggestion.

llvm/tools/llvm-objdump/llvm-objdump.cpp
1907

Maybe IFunc rather than Ifunc, since it's short for "Indirect Function"?

jhenderson accepted this revision.Mar 13 2020, 2:46 AM
This revision was automatically updated to reflect the committed changes.