[PATCH] D61594: [AMDGPU][test] Define local symbols used in amdgpu-relocs.s
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 6 06:39:55 PDT 2019
MaskRay created this revision.
MaskRay added reviewers: ruiu, tstellar, grimar.
Herald added subscribers: llvm-commits, arichardson, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D61594
Files:
test/ELF/amdgpu-relocs.s
Index: test/ELF/amdgpu-relocs.s
===================================================================
--- test/ELF/amdgpu-relocs.s
+++ test/ELF/amdgpu-relocs.s
@@ -2,7 +2,8 @@
# RUN: llvm-mc -filetype=obj -triple=amdgcn--amdhsa -mcpu=fiji %s -o %t.o
# RUN: ld.lld --hash-style=sysv -shared %t.o -o %t.so
# RUN: llvm-readobj -r %t.so | FileCheck %s
-# RUN: llvm-objdump -s %t.so | FileCheck %s --check-prefix=OBJDUMP
+# RUN: llvm-nm %t.so | FileCheck %s --check-prefix=NM
+# RUN: llvm-readelf -x .rodata -x nonalloc %t.so | FileCheck %s --check-prefix=HEX
.text
@@ -48,6 +49,9 @@
.local local_var0
.local local_var1
.local local_var2
+ local_var0:
+ local_var1:
+ local_var2:
# R_AMDGPU_ABS32:
.section nonalloc, "w", @progbits
@@ -68,6 +72,7 @@
.type temp2, @object
.local temp2
.size temp2, 4
+ temp2:
.type ptr2, @object
.globl ptr2
@@ -89,7 +94,7 @@
# linker.
# CHECK: Relocations [
# CHECK: .rela.dyn {
-# CHECK-NEXT: R_AMDGPU_RELATIVE64 - 0x0
+# CHECK-NEXT: R_AMDGPU_RELATIVE64 - 0x3008
# CHECK-NEXT: R_AMDGPU_ABS64 common_var0 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 common_var1 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 common_var2 0x0
@@ -109,9 +114,16 @@
# CHECK-NEXT: }
# CHECK-NEXT: ]
-# OBJDUMP: Contents of section .rodata:
-# OBJDUMP: 98f8ffff ffffffff
+# NM-DAG: 0000000000003008 d temp2
+# NM-DAG: 0000000000003010 B common_var0
+# NM-DAG: 0000000000003410 B common_var1
+# NM-DAG: 0000000000003810 B common_var2
-# OBJDUMP: Contents of section nonalloc:
-# OBJDUMP-NEXT: 0000 00000000 14380000 00000000 18340000
-# OBJDUMP-NEXT: 00000000 1c300000
+# temp2 - foo = 0x3008-0x768 = 0x28a0
+# HEX: section '.rodata':
+# HEX-NEXT: 0x00000768 a0280000 00000000
+
+# common_var2+4, common_var1+8, and common_var0+12.
+# HEX: section 'nonalloc':
+# HEX-NEXT: 0x00000000 00000000 14380000 00000000 18340000
+# HEX-NEXT: 0x00000010 00000000 1c300000
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61594.198263.patch
Type: text/x-patch
Size: 1909 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190506/2baf3ba8/attachment.bin>
More information about the llvm-commits
mailing list