[PATCH] D67206: [ELF][MC] Fix IFunc alias resolving issue

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 19:33:41 PDT 2019


MaskRay added inline comments.


================
Comment at: llvm/lib/MC/ELFObjectWriter.cpp:539
   uint8_t Type = Symbol.getType();
+  if (Type == ELF::STT_NOTYPE && isIFunc(Symbol))
+    Type = ELF::STT_GNU_IFUNC;
----------------
GNU as doesn't check the type of the alias

```
.type foo2, @function
.set foo2,foo   # foo2 is a STT_GNU_IFUNC
```


================
Comment at: llvm/test/MC/ELF/ifunc-alias.s:4
+
+.globl foo_impl
+.type  foo_impl, at function
----------------
`.globl` directives and instructions are not significant. You can simplify the test:

```
.type foo_resolver, at function
foo_resolver:

.type foo, at gnu_indirect_function
.set foo,foo_resolver

.set foo2,foo
.set foo3,foo2   # add another alias to show it is necessary to resolve it recursively
```


Repository:
  rL LLVM

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

https://reviews.llvm.org/D67206





More information about the llvm-commits mailing list