1 # RUN: yaml2obj %s > %t 2 # RUN: llvm-objcopy --localize-symbol Global -L Local -L Weak %t %t2 3 # RUN: llvm-readobj -symbols %t2 | FileCheck %s 4 5 !ELF 6 FileHeader: 7 Class: ELFCLASS64 8 Data: ELFDATA2LSB 9 Type: ET_REL 10 Machine: EM_X86_64 11 Sections: 12 - Name: .text 13 Type: SHT_PROGBITS 14 Flags: [ SHF_ALLOC, SHF_EXECINSTR ] 15 Address: 0x1000 16 AddressAlign: 0x0000000000000010 17 Size: 64 18 - Name: .data 19 Type: SHT_PROGBITS 20 Flags: [ SHF_ALLOC ] 21 Address: 0x2000 22 AddressAlign: 0x0000000000000010 23 Content: "0000000000000000" 24 Symbols: 25 Local: 26 - Name: Local 27 Type: STT_FUNC 28 Section: .text 29 Value: 0x1000 30 Size: 8 31 Weak: 32 - Name: Weak 33 Type: STT_FUNC 34 Size: 8 35 Section: .text 36 Value: 0x1008 37 Global: 38 - Name: Global 39 Type: STT_FUNC 40 Size: 8 41 Section: .text 42 Value: 0x1010 43 44 #CHECK: Symbols [ 45 #CHECK-NEXT: Symbol { 46 #CHECK-NEXT: Name: 47 #CHECK-NEXT: Value: 0x0 48 #CHECK-NEXT: Size: 0 49 #CHECK-NEXT: Binding: Local 50 #CHECK-NEXT: Type: None 51 #CHECK-NEXT: Other: 0 52 #CHECK-NEXT: Section: Undefined 53 #CHECK-NEXT: } 54 #CHECK-NEXT: Symbol { 55 #CHECK-NEXT: Name: Local 56 #CHECK-NEXT: Value: 0x1000 57 #CHECK-NEXT: Size: 8 58 #CHECK-NEXT: Binding: Local 59 #CHECK-NEXT: Type: Function 60 #CHECK-NEXT: Other: 0 61 #CHECK-NEXT: Section: .text 62 #CHECK-NEXT: } 63 #CHECK-NEXT: Symbol { 64 #CHECK-NEXT: Name: Global 65 #CHECK-NEXT: Value: 0x1010 66 #CHECK-NEXT: Size: 8 67 #CHECK-NEXT: Binding: Local 68 #CHECK-NEXT: Type: Function 69 #CHECK-NEXT: Other: 0 70 #CHECK-NEXT: Section: .text 71 #CHECK-NEXT: } 72 #CHECK-NEXT: Symbol { 73 #CHECK-NEXT: Name: Weak 74 #CHECK-NEXT: Value: 0x1008 75 #CHECK-NEXT: Size: 8 76 #CHECK-NEXT: Binding: Local 77 #CHECK-NEXT: Type: Function 78 #CHECK-NEXT: Other: 0 79 #CHECK-NEXT: Section: .text 80 #CHECK-NEXT: } 81 #CHECK-NEXT:] 82