1# REQUIRES: x86 2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t 3# RUN: ld.lld -pie %t -o %t.out 4# RUN: llvm-readobj --symbols --dyn-syms %t.out | FileCheck %s 5 6# CHECK: Symbols [ 7# CHECK: Symbol { 8# CHECK: Name: hidden 9# CHECK-NEXT: Value: [[ADDR:.*]] 10# CHECK-NEXT: Size: 0 11# CHECK-NEXT: Binding: Local 12# CHECK-NEXT: Type: None 13# CHECK-NEXT: Other [ 14# CHECK-NEXT: STV_HIDDEN 15# CHECK-NEXT: ] 16# CHECK-NEXT: Section: .text 17# CHECK-NEXT: } 18# CHECK: Symbol { 19# CHECK: Name: internal 20# CHECK-NEXT: Value: [[ADDR]] 21# CHECK-NEXT: Size: 0 22# CHECK-NEXT: Binding: Local 23# CHECK-NEXT: Type: None 24# CHECK-NEXT: Other [ 25# CHECK-NEXT: STV_INTERNAL 26# CHECK-NEXT: ] 27# CHECK-NEXT: Section: .text 28# CHECK-NEXT: } 29# CHECK: Symbol { 30# CHECK: Name: default 31# CHECK-NEXT: Value: [[ADDR]] 32# CHECK-NEXT: Size: 0 33# CHECK-NEXT: Binding: Global 34# CHECK-NEXT: Type: None 35# CHECK-NEXT: Other: 0 36# CHECK-NEXT: Section: .text 37# CHECK-NEXT: } 38# CHECK: Symbol { 39# CHECK: Name: protected 40# CHECK-NEXT: Value: [[ADDR]] 41# CHECK-NEXT: Size: 0 42# CHECK-NEXT: Binding: Global 43# CHECK-NEXT: Type: None 44# CHECK-NEXT: Other [ 45# CHECK-NEXT: STV_PROTECTED 46# CHECK-NEXT: ] 47# CHECK-NEXT: Section: .text 48# CHECK-NEXT: } 49# CHECK-NEXT: ] 50 51# CHECK: DynamicSymbols [ 52# CHECK-NEXT: Symbol { 53# CHECK-NEXT: Name: 54# CHECK-NEXT: Value: 0x0 55# CHECK-NEXT: Size: 0 56# CHECK-NEXT: Binding: Local 57# CHECK-NEXT: Type: None 58# CHECK-NEXT: Other: 0 59# CHECK-NEXT: Section: Undefined 60# CHECK-NEXT: } 61# CHECK-NEXT: ] 62 63.text 64.globl _start 65_start: 66 67.global default 68default: 69 70.global protected 71.protected protected 72protected: 73 74.global hidden 75.hidden hidden 76hidden: 77 78.global internal 79.internal internal 80internal: 81