[PATCH] D91611: [PowerPC][LLD] Detecting and fixing missing TLS relocation on __tls_get_addr
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 8 09:37:02 PST 2020
MaskRay added inline comments.
================
Comment at: lld/ELF/Relocations.cpp:1324
+ // missing relocations.
+ if (config->fixPPC64TLSReloc) {
+ if ((type == R_PPC64_REL24 || type == R_PPC64_REL24_NOTOC) &&
----------------
The two if conditions can be combined.
================
Comment at: lld/ELF/Relocations.cpp:1328
+
+ bool disableTLSRelax = (i - start < 2);
+ if (!disableTLSRelax) {
----------------
The parens are unneeded.
================
Comment at: lld/ELF/Relocations.cpp:1331
+ const RelTy &prevRel = *(i - 2);
+ const RelType prevType = prevRel.getType(config->isMips64EL);
+ disableTLSRelax =
----------------
config->isMips64EL -> false
================
Comment at: lld/test/ELF/ppc64-call-tls-get-addr-exec.s:10
+## Since this is not a shared object we need to include a definition.
+__tls_get_addr:
+ blr
----------------
Add `.globl __tls_get_addr` to make it match the real case.
================
Comment at: lld/test/ELF/ppc64-call-tls-get-addr.s:1
+# REQUIRES: ppc
+# RUN: llvm-mc --triple=powerpc64le %s --filetype=obj -o %t1.o
----------------
Consider combining the two tests with split-file
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