summaryrefslogtreecommitdiffstats
path: root/lld/test/ELF/startstop-shared.s
blob: 80ccf3df0aad8dc07b5b743ad6a70f8fb332e4ac (plain)
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
// 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 -t %t.so | FileCheck  %s

        .data
        .quad __start_foo
        .section foo,"aw"

        .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:.*]]

// By default the symbol is visible and we need a dynamic reloc.
// CHECK:  R_X86_64_64 __start_foo 0x0

// CHECK:      Name: __start_bar
// CHECK-NEXT: Value: 0x[[ADDR]]
// CHECK-NEXT: Size:
// CHECK-NEXT: Binding: Local

// CHECK:      Name: __start_foo
// CHECK-NEXT: Value:
// CHECK-NEXT: Size:
// CHECK-NEXT: Binding: Global
OpenPOWER on IntegriCloud