[PATCH] D83138: [ELF][ARM] Represent R_ARM_LDO32 as R_DTPREL instead of R_ABS

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 6 12:54:23 PDT 2020


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: lld/ELF/Relocations.cpp:241
   // Local-Dynamic relocs can be relaxed to Local-Exec.
-  if (expr == R_DTPREL && !config->shared) {
+  if (expr == R_DTPREL && canRelax && !config->shared) {
     c.relocations.push_back(
----------------
grimar wrote:
> I've noticed that `canRelax` is always used with `&& !config->shared` now.
> So can it be:
> 
> ```
>   bool canRelax = !config->shared && config->emachine != EM_ARM &&
>                   config->emachine != EM_HEXAGON &&
>                   config->emachine != EM_RISCV;
> ```
> 
> 
> 
I agree. `canRelax` does not capture the meaning precisely now. It actually means whether we can transit a TLS model for shared objects (general/local dynamic) to a TLS model for executables (initial/local exec). If we are going to rename the variable, that does not belong this change. I'll do that separately.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83138





More information about the llvm-commits mailing list