[PATCH] D79270: [test] Fix lld's ELF/linkerscript/thunk-gen-mips.s

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 17:17:50 PDT 2020


thopre created this revision.
thopre added reviewers: MaskRay, arichardson, ruiu, psmith, atanasyan.
thopre added a project: LLVM.
Herald added subscribers: jrtc27, sdardis, emaste.
Herald added a reviewer: espindola.
thopre edited the summary of this revision.
MaskRay added inline comments.


================
Comment at: lld/test/ELF/linkerscript/thunk-gen-mips.s:18
 # CHECK: SYMBOL TABLE:
-# CHECK-ANY: 00000000         .text           00000000 _start
-# CHECK-ANY: 0010000c l     F .text           00000010 __LA25Thunk_too_far
-# CHECK-ANY: 00100020 g     F .text           00000024 too_far
+# Ideally we'd use [[#%x, START_ADDR:<0x100000]] if it was supported by
+# FileCheck.
----------------
What does `[[#%x, START_ADDR:<0x100000]]` mean?

s/was/were/ I think


Lld test ELF/linkerscript/thunk-gen-mips.s was accidentally disabled due
to the use of wrong FileCheck directives. As a result the test seems to
have bitrotted as it fails to pass if fixing the directive. To ease
updates to the test in case of change of the __start address the checks
have been changed to use numeric variables to express all the addresses
based on the __start address. Should FileCheck provide numeric
inequality expression the definition of the __start address can be done
without hardcoding it.

Note: I'm not familiar with MIPS so please pay attention to whether the changes to the CHECK directives make sense. Here's the relevant output from llvm-objdump -t:

SYMBOL TABLE:
00000001 l       *ABS*  00000000 MAIN
00000001 l       *ABS*  00000000 TARGET
00108050 l       .got   00000000 .hidden _gp
0010003c l     F .text  00000010 __LA25Thunk_too_far
00000030 g       .text  00000000 _start
00100050 g     F .text  0000000c too_far


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79270

Files:
  lld/test/ELF/linkerscript/thunk-gen-mips.s


Index: lld/test/ELF/linkerscript/thunk-gen-mips.s
===================================================================
--- lld/test/ELF/linkerscript/thunk-gen-mips.s
+++ lld/test/ELF/linkerscript/thunk-gen-mips.s
@@ -15,9 +15,11 @@
 # RUN: ld.lld -o %t.exe --script %t.script %t %t1
 # RUN: llvm-objdump -t %t.exe | FileCheck %s
 # CHECK: SYMBOL TABLE:
-# CHECK-ANY: 00000000         .text           00000000 _start
-# CHECK-ANY: 0010000c l     F .text           00000010 __LA25Thunk_too_far
-# CHECK-ANY: 00100020 g     F .text           00000024 too_far
+# Ideally we'd use [[#%x, START_ADDR:<0x100000]] if it was supported by
+# FileCheck.
+# CHECK-DAG:                     [[#%x, START_ADDR:0x30]] g       .text           00000000 _start
+# CHECK-DAG: {{0*}}[[#THUNK_ADDR:START_ADDR+0x100000+12]] l     F .text           00000010 __LA25Thunk_too_far
+# CHECK-DAG:                     {{0*}}[[#THUNK_ADDR+20]] g     F .text           0000000c too_far
 
 .ifdef MAIN
 .global _start


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79270.261560.patch
Type: text/x-patch
Size: 984 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200502/16fb057c/attachment-0001.bin>


More information about the llvm-commits mailing list