startstop-shared.s
1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
// RUN: ld.lld %t.o -o %t.so -shared
// RUN: llvm-readobj -r --symbols %t.so | FileCheck %s
.data
.quad __start_foo
.section foo,"aw"
.hidden __start_bar
.quad __start_bar
.section bar,"a"
// CHECK: Relocations [
// CHECK-NEXT: Section {{.*}} .rela.dyn {
// CHECK-NEXT: R_X86_64_RELATIVE
// CHECK-NEXT: R_X86_64_RELATIVE
// CHECK-NEXT: }
// CHECK-NEXT: ]
// Test that we are able to hide the symbol.
// By default the symbol is protected.
// CHECK: Name: __start_bar
// CHECK-NEXT: Value:
// CHECK-NEXT: Size:
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
// CHECK-NEXT: Other [
// CHECK-NEXT: STV_HIDDEN
// CHECK-NEXT: ]
// CHECK: Name: __start_foo
// CHECK-NEXT: Value:
// CHECK-NEXT: Size:
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: None
// CHECK-NEXT: Other [
// CHECK-NEXT: STV_PROTECTED
// CHECK-NEXT: ]