| 1 | # RUN: yaml2obj %s -o %t -DMACHINE=HEXAGON |
| 2 | # RUN: obj2yaml %t | FileCheck %s -DMACHINE=HEXAGON -DNAME=SCOMMON_1 |
| 3 | # RUN: yaml2obj %s -o %t -DMACHINE=MIPS |
| 4 | # RUN: obj2yaml %t | FileCheck %s -DMACHINE=MIPS -DNAME=TEXT |
| 5 | |
| 6 | ## Test checks that we are able to handle symbols with special/reserved indices. |
| 7 | |
| 8 | # CHECK: Symbols: |
| 9 | # CHECK-NEXT: - Name: absolute |
| 10 | # CHECK-NEXT: Index: SHN_ABS |
| 11 | # CHECK-NEXT: Binding: STB_GLOBAL |
| 12 | # CHECK-NEXT: Value: 0x1234 |
| 13 | # CHECK-NEXT: - Name: common |
| 14 | # CHECK-NEXT: Index: SHN_COMMON |
| 15 | # CHECK-NEXT: Binding: STB_GLOBAL |
| 16 | # CHECK-NEXT: - Name: valid_index |
| 17 | # CHECK-NEXT: Section: .text |
| 18 | # CHECK-NEXT: Binding: STB_GLOBAL |
| 19 | # CHECK-NEXT: - Name: processor_specific_index |
| 20 | # CHECK-NEXT: Index: SHN_[[MACHINE]]_[[NAME]] |
| 21 | # CHECK-NEXT: Binding: STB_GLOBAL |
| 22 | # CHECK-NEXT: - Name: unknown_index |
| 23 | # CHECK-NEXT: Index: 0xFFFE |
| 24 | # CHECK-NEXT: Binding: STB_GLOBAL |
| 25 | |
| 26 | !ELF |
| 27 | FileHeader: |
| 28 | Class: ELFCLASS64 |
| 29 | Data: ELFDATA2LSB |
| 30 | Type: ET_EXEC |
| 31 | Machine: EM_[[MACHINE]] |
| 32 | Sections: |
| 33 | - Name: .text |
| 34 | Type: SHT_PROGBITS |
| 35 | Symbols: |
| 36 | - Name: absolute |
| 37 | Index: SHN_ABS |
| 38 | Value: 0x1234 |
| 39 | Binding: STB_GLOBAL |
| 40 | - Name: common |
| 41 | Index: SHN_COMMON |
| 42 | Binding: STB_GLOBAL |
| 43 | - Name: valid_index |
| 44 | Index: 0x1 |
| 45 | Binding: STB_GLOBAL |
| 46 | - Name: processor_specific_index |
| 47 | Index: 0xff01 |
| 48 | Binding: STB_GLOBAL |
| 49 | - Name: unknown_index |
| 50 | Index: 0xfffe |
| 51 | Binding: STB_GLOBAL |