[PATCH] D75793: [llvm-objdump] --syms: print 'i' for STT_GNU_IFUNC
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 6 20:55:06 PST 2020
MaskRay updated this revision to Diff 248892.
MaskRay added a comment.
Add a local STT_GNU_IFUNC
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75793/new/
https://reviews.llvm.org/D75793
Files:
llvm/test/tools/llvm-objdump/ELF/symbol-table.test
llvm/tools/llvm-objdump/llvm-objdump.cpp
Index: llvm/tools/llvm-objdump/llvm-objdump.cpp
===================================================================
--- llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -1896,6 +1896,10 @@
bool Absolute = Flags & SymbolRef::SF_Absolute;
bool Common = Flags & SymbolRef::SF_Common;
bool Hidden = Flags & SymbolRef::SF_Hidden;
+ char Indirect = ' ';
+ if (auto *ELF = dyn_cast<ELFObjectFileBase>(O))
+ if (ELFSymbolRef(*I).getELFType() == ELF::STT_GNU_IFUNC)
+ Indirect = 'i';
char GlobLoc = ' ';
if ((Section != O->section_end() || Absolute) && !Weak)
@@ -1918,7 +1922,7 @@
<< (Weak ? 'w' : ' ') // Weak?
<< ' ' // Constructor. Not supported yet.
<< ' ' // Warning. Not supported yet.
- << ' ' // Indirect reference to another symbol.
+ << Indirect // Indirect reference to another symbol.
<< Debug // Debugging (d) or dynamic (D) symbol.
<< FileFunc // Name of function (F), file (f) or object (O).
<< ' ';
Index: llvm/test/tools/llvm-objdump/ELF/symbol-table.test
===================================================================
--- llvm/test/tools/llvm-objdump/ELF/symbol-table.test
+++ llvm/test/tools/llvm-objdump/ELF/symbol-table.test
@@ -7,12 +7,13 @@
# CHECK-NEXT:0000000000001fff l F .text 0000000000000000 local_func
# CHECK-NEXT:0000000000002000 l O .data 0000000000000000 local_object
# CHECK-NEXT:0000000000000000 l *ABS* 0000000000000000 local_abs
+# CHECK-NEXT:0000000000000000 l i .text 0000000000000000 local_ifunc
# CHECK-NEXT:0000000000000000 g F .text 000000000000000f func
# CHECK-NEXT:0000000000000000 g O .data 0000000000000010 object
# CHECK-NEXT:0000000000000000 *UND* 0000000000000000 undef
# CHECK-NEXT:0000000000000000 g *ABS* 0000000000000000 abs
# CHECK-NEXT:0000000000000000 *COM* 0000000000000000 common
-# CHECK-NEXT:0000000000000000 g .text 0000000000000000 ifunc
+# CHECK-NEXT:0000000000000000 g i .text 0000000000000000 ifunc
# CHECK-NEXT:0000000000000000 g O .data 0000000000000000 gnu_unique
--- !ELF
@@ -37,6 +38,9 @@
Value: 0x2000
- Name: local_abs
Index: SHN_ABS
+ - Name: local_ifunc
+ Type: STT_GNU_IFUNC
+ Section: .text
- Name: func
Type: STT_FUNC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75793.248892.patch
Type: text/x-patch
Size: 2395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200307/8146486d/attachment.bin>
More information about the llvm-commits
mailing list