2015-10-13 04:58:52 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o
|
2015-11-18 14:11:01 +08:00
|
|
|
// RUN: ld.lld -shared %t.o -o %t.so
|
2015-10-13 04:58:52 +08:00
|
|
|
// RUN: llvm-readobj -t -r -dyn-symbols %t.so | FileCheck %s
|
2015-10-13 05:11:53 +08:00
|
|
|
// REQUIRES: ppc
|
2015-10-13 04:58:52 +08:00
|
|
|
|
|
|
|
// Test that we create R_PPC64_RELATIVE relocations but don't put any
|
|
|
|
// symbols in the dynamic symbol table.
|
|
|
|
|
|
|
|
// CHECK: Relocations [
|
|
|
|
// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
|
|
|
|
// CHECK-NEXT: 0x[[FOO_ADDR:.*]] R_PPC64_RELATIVE - 0x[[FOO_ADDR]]
|
|
|
|
// CHECK-NEXT: 0x[[BAR_ADDR:.*]] R_PPC64_RELATIVE - 0x[[BAR_ADDR]]
|
2016-05-05 04:25:19 +08:00
|
|
|
// CHECK-NEXT: 0x20010 R_PPC64_RELATIVE - 0x20009
|
2015-10-13 04:58:52 +08:00
|
|
|
// CHECK-NEXT: 0x{{.*}} R_PPC64_RELATIVE - 0x[[ZED_ADDR:.*]]
|
|
|
|
// CHECK-NEXT: 0x{{.*}} R_PPC64_RELATIVE - 0x[[FOO_ADDR]]
|
2016-05-05 04:25:19 +08:00
|
|
|
// CHECK-NEXT: 0x20028 R_PPC64_ADDR64 external 0x0
|
2015-10-13 04:58:52 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
|
|
|
|
// CHECK: Symbols [
|
|
|
|
// CHECK: Name: foo
|
|
|
|
// CHECK-NEXT: Value: 0x[[FOO_ADDR]]
|
|
|
|
// CHECK: Name: bar
|
|
|
|
// CHECK-NEXT: Value: 0x[[BAR_ADDR]]
|
|
|
|
// CHECK: Name: zed
|
|
|
|
// CHECK-NEXT: Value: 0x[[ZED_ADDR]]
|
|
|
|
// CHECK: ]
|
|
|
|
|
|
|
|
// CHECK: DynamicSymbols [
|
|
|
|
// CHECK-NEXT: Symbol {
|
2016-11-02 05:26:28 +08:00
|
|
|
// CHECK-NEXT: Name: @
|
2015-10-13 04:58:52 +08:00
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: Undefined
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
|
|
|
// CHECK-NEXT: Name: external@
|
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Global
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: Undefined
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
|
2016-05-05 04:25:19 +08:00
|
|
|
.data
|
2015-10-13 04:58:52 +08:00
|
|
|
foo:
|
|
|
|
.quad foo
|
|
|
|
|
|
|
|
.hidden bar
|
|
|
|
.global bar
|
|
|
|
bar:
|
|
|
|
.quad bar
|
|
|
|
.quad bar + 1
|
|
|
|
|
|
|
|
.hidden zed
|
|
|
|
.comm zed,1
|
|
|
|
.quad zed
|
|
|
|
|
2016-04-30 08:49:10 +08:00
|
|
|
.section abc,"aw"
|
2015-10-13 04:58:52 +08:00
|
|
|
.quad foo
|
|
|
|
|
|
|
|
.quad external
|