[PATCH] D74927: [MC][ARM] make Thumb function also if type attribute is set

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 18:21:28 PST 2021


MaskRay added inline comments.


================
Comment at: llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:597
+    unsigned Type = cast<MCSymbolELF>(Symbol)->getType();
+    if ((Type == ELF::STT_FUNC || Type == ELF::STT_GNU_IFUNC) &&
+        Symbol->isDefined())
----------------
MaskRay wrote:
> Needs an ifunc test.
> 
> Defining ifunc is usually two lines
> 
> ```
> .type ifunc, %gnu_indirect_function
> .set ifunc, resolver
> ```
> 
> For a STB_GLOBAL ifunc (common cases), add `.globl ifunc`
When there are multiple symbols, I usually prefer `llvm-readelf -s` which is much conciser.

I usually include the `Value  Size Type    Bind   Vis       Ndx Name` header line to let readers know the column meanings. You may omit some columns which are not useful (e.g. I often omit `Num:`)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74927/new/

https://reviews.llvm.org/D74927



More information about the llvm-commits mailing list