2 // RUN
: llvm-mc
-filetype
=obj
-triple
=x86_64-unknown-linux
%s
-o
%t.o
3 // RUN
: ld.lld
-shared
%t.o
-o
%t.so
4 // RUN
: llvm-readobj
--symbols
-r
--dyn-syms
%t.so | FileCheck
%s
6 // Test that we create R_X86_64_RELATIVE relocations but don
't put any
7 // symbols in the dynamic symbol table.
9 // CHECK: Relocations [
10 // CHECK-NEXT: Section ({{.*}}) .rela.dyn {
11 // CHECK-NEXT: 0x[[FOO_ADDR:.*]] R_X86_64_RELATIVE - 0x[[FOO_ADDR]]
12 // CHECK-NEXT: 0x[[#%X,BAR_ADDR:]] R_X86_64_RELATIVE
13 // CHECK-SAME: - 0x[[#BAR_ADDR]]
14 // CHECK-NEXT: 0x[[#BAR_ADDR + 8]] R_X86_64_RELATIVE - 0x[[#BAR_ADDR + 1]]
15 // CHECK-NEXT: 0x[[#BAR_ADDR + 16]] R_X86_64_RELATIVE - 0x[[ZED_ADDR:.*]]
16 // CHECK-NEXT: 0x[[#BAR_ADDR + 24]] R_X86_64_RELATIVE - 0x[[FOO_ADDR]]
17 // CHECK-NEXT: 0x[[#BAR_ADDR + 32]] R_X86_64_64 external 0x0
23 // CHECK-NEXT: Value: 0x[[FOO_ADDR]]
25 // CHECK-NEXT: Value: 0x[[#BAR_ADDR]]
27 // CHECK-NEXT: Value: 0x[[ZED_ADDR]]
30 // CHECK: DynamicSymbols [
31 // CHECK-NEXT: Symbol {
33 // CHECK-NEXT: Value: 0x0
34 // CHECK-NEXT: Size: 0
35 // CHECK-NEXT: Binding: Local
36 // CHECK-NEXT: Type: None
37 // CHECK-NEXT: Other: 0
38 // CHECK-NEXT: Section: Undefined
40 // CHECK-NEXT: Symbol {
41 // CHECK-NEXT: Name: external
42 // CHECK-NEXT: Value: 0x0
43 // CHECK-NEXT: Size: 0
44 // CHECK-NEXT: Binding: Global
45 // CHECK-NEXT: Type: None
46 // CHECK-NEXT: Other: 0
47 // CHECK-NEXT: Section: Undefined
70 // This doesn't need
a relocation.