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
|
2019-05-01 13:49:01 +08:00
|
|
|
// RUN: llvm-readobj -r --symbols %t.so | FileCheck %s
|
2015-10-17 03:57:42 +08:00
|
|
|
|
2016-05-05 04:25:19 +08:00
|
|
|
.data
|
2015-10-17 03:57:42 +08:00
|
|
|
.quad __start_foo
|
2016-05-05 04:25:19 +08:00
|
|
|
.section foo,"aw"
|
2015-10-17 03:57:42 +08:00
|
|
|
|
|
|
|
.hidden __start_bar
|
|
|
|
.quad __start_bar
|
|
|
|
.section bar,"a"
|
2016-08-19 23:36:32 +08:00
|
|
|
|
2018-03-20 22:22:10 +08:00
|
|
|
// CHECK: Relocations [
|
|
|
|
// CHECK-NEXT: Section {{.*}} .rela.dyn {
|
|
|
|
// CHECK-NEXT: R_X86_64_RELATIVE
|
|
|
|
// CHECK-NEXT: R_X86_64_RELATIVE
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
2016-08-19 23:36:32 +08:00
|
|
|
|
2018-03-20 22:22:10 +08:00
|
|
|
// Test that we are able to hide the symbol.
|
|
|
|
// By default the symbol is protected.
|
2015-10-17 03:57:42 +08:00
|
|
|
|
|
|
|
// CHECK: Name: __start_bar
|
2018-03-20 22:22:10 +08:00
|
|
|
// CHECK-NEXT: Value:
|
2016-04-06 06:08:39 +08:00
|
|
|
// CHECK-NEXT: Size:
|
|
|
|
// CHECK-NEXT: Binding: Local
|
2018-03-20 22:22:10 +08:00
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other [
|
|
|
|
// CHECK-NEXT: STV_HIDDEN
|
|
|
|
// CHECK-NEXT: ]
|
2016-04-06 06:08:39 +08:00
|
|
|
|
|
|
|
// CHECK: Name: __start_foo
|
2016-08-19 23:36:32 +08:00
|
|
|
// CHECK-NEXT: Value:
|
2016-04-06 06:08:39 +08:00
|
|
|
// CHECK-NEXT: Size:
|
2016-08-19 23:36:32 +08:00
|
|
|
// CHECK-NEXT: Binding: Global
|
2018-03-20 22:22:10 +08:00
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other [
|
|
|
|
// CHECK-NEXT: STV_PROTECTED
|
|
|
|
// CHECK-NEXT: ]
|