[PATCH] D73474: [LLD][ELF][ARM] Do not insert interworking thunks for non STT_FUNC symbols

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 10:40:13 PST 2020


MaskRay added inline comments.


================
Comment at: lld/test/ELF/arm-thumb-interwork-ifunc.s:6
+
+/// ifuncs are called via a PLT entry which is always Arm state, expect the
+/// ARM callers to go direct to the PLT entry, Thumb branches are
----------------
Non-preemptible ifuncs are called directly, not via a PLT entry.

```
// Relocations.cpp
  if (!sym.isPreemptible && (!sym.isGnuIFunc() || config->zIfuncNoplt)) {
    if (expr == R_GOT_PC && !isAbsoluteValue(sym)) {
      expr = target->adjustRelaxExpr(type, relocatedAddr, expr);
    } else {
      // The 0x8000 bit of r_addend of R_PPC_PLTREL24 is used to choose call
      // stub type. It should be ignored if optimized to R_PC.
      if (config->emachine == EM_PPC && expr == R_PPC32_PLTREL)
        addend &= ~0x8000;
      expr = fromPlt(expr); ///////////////// this optimizes R_PLT_PC to R_PC, but the code path is not exercised for ifunc.
    }
  }
```


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

https://reviews.llvm.org/D73474





More information about the llvm-commits mailing list