2015-10-17 03:57:42 +08:00
|
|
|
// REQUIRES: x86
|
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
|
2015-11-18 14:11:01 +08:00
|
|
|
// RUN: ld.lld %t.o -o %t.so -shared
|
2015-10-17 03:57:42 +08:00
|
|
|
// RUN: llvm-readobj -r -t %t.so | FileCheck %s
|
|
|
|
|
|
|
|
.quad __start_foo
|
|
|
|
.section foo,"a"
|
|
|
|
// By default the symbol is visible and we need a dynamic reloc.
|
|
|
|
// CHECK: R_X86_64_64 __start_foo 0x0
|
|
|
|
|
|
|
|
.hidden __start_bar
|
|
|
|
.quad __start_bar
|
|
|
|
.section bar,"a"
|
|
|
|
// Test that we are able to hide the symbol.
|
|
|
|
// CHECK: R_X86_64_RELATIVE - 0x[[ADDR:.*]]
|
|
|
|
|
|
|
|
// CHECK: Name: __start_bar
|
|
|
|
// CHECK-NEXT: Value: 0x[[ADDR]]
|
2016-04-06 06:08:39 +08:00
|
|
|
// CHECK-NEXT: Size:
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
|
|
|
|
// CHECK: Name: __start_foo
|
|
|
|
// CHECK-NEXT: Value:
|
|
|
|
// CHECK-NEXT: Size:
|
|
|
|
// CHECK-NEXT: Binding: Global
|