[PATCH] D91611: [PowerPC][LLD] Detecting and fixing missing TLS relocation on __tls_get_addr

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 08:23:05 PST 2020


sfertile added inline comments.


================
Comment at: lld/ELF/Relocations.cpp:1335
+        }
+        if (disableTLSRelax)
+          sec.file->ppc64DisableTLSRelax = true;
----------------
We still need to issue a diagnostic. While disabling tls relaxations allows us to produce a well formed binary, ideally the users would recompile the objects with invalid tls sequences. Without a warning they won't know some of the input files have problems.


================
Comment at: lld/test/ELF/ppc64-call-tls-get-addr-missing.s:7
+## complain about the callee being missing.
+# CHECK: error: undefined symbol: __tls_get_addr
+CallOnly:
----------------
I'm trying to figure out the utility of this test. Referencing an undefined symbol should obviously be an error. Is the test meant to show we don't perform tls relaxations? If so I think the other tests cover that.


================
Comment at: lld/test/ELF/ppc64-tls-add-missing-gdld.s:1
+# REQUIRES: ppc
+# RUN: split-file %s %t
----------------
The name of this file should be changed to match the direction change, or if it doesn't add anything that isn't already covered by `ppc64-tls-missing-gdld.s` it should be removed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91611



More information about the llvm-commits mailing list