[PATCH] D91993: [ELF] Don't relax R_X86_64_GOTPCRELX if addend != -4

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 27 00:24:17 PST 2020


jhenderson added inline comments.


================
Comment at: lld/test/ELF/x86-64-gotpc-offset.s:7-11
+# CHECK-NEXT:  2021a8 {{.*}} 00000000
+
+# CHECK:      leal {{.*}}(%rip), %eax  # {{.*}} <foo>
+# CHECK-NEXT: movl {{.*}}(%rip), %eax  # 2021ac
+# CHECK-NEXT: movq {{.*}}(%rip), %rax  # 2021a9
----------------
Maybe worth using FileCheck numeric variables to caclulate the address values here, so that if LLD lays things out slightly differently in the future, the test doesn't need updating. It also helps make it easier to spot the value differences. See suggested edit for an example.

(I've also added a `{{^}}` to the start of the first line so that it doesn't accidentally match an address pattern elsewhere in the line)


================
Comment at: lld/test/ELF/x86-64-gotpc-offset.s:13
+
+  # movl foo at GOTPCREL(%rip), %eax
+  movl 0(%rip), %eax
----------------
Here and below. The single hash makes it look like the line has some sort of functional affect or is some commented out code that was accidentally left in.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91993



More information about the llvm-commits mailing list