brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.7 KiB · d4351d6 Raw
154 lines · plain
1## Check that we dump the unwind information for a non-relocatable input properly.2 3## Check that we correctly decode function addresses and that we are able to4## locate corresponding STT_FUNC symbols and dump function names properly.5# RUN: yaml2obj %s -o %t6# RUN: llvm-readobj -u %t | FileCheck --check-prefix=UNWIND %s7# RUN: llvm-readelf -u %t | FileCheck --check-prefix=UNWIND %s8 9# UNWIND:      UnwindInformation {10# UNWIND-NEXT:   UnwindIndexTable {11# UNWIND-NEXT:     SectionIndex: 212# UNWIND-NEXT:     SectionName: .ARM.exidx13# UNWIND-NEXT:     SectionOffset: 0x3414# UNWIND-NEXT:     Entries [15# UNWIND-NEXT:       Entry {16# UNWIND-NEXT:         FunctionAddress: 0x23017# UNWIND-NEXT:         FunctionName: func118# UNWIND-NEXT:         Model: Compact (Inline)19# UNWIND-NEXT:         PersonalityIndex: 020# UNWIND-NEXT:         Opcodes [21# UNWIND-NEXT:           0xB0      ; finish22# UNWIND-NEXT:           0xB0      ; finish23# UNWIND-NEXT:           0xB0      ; finish24# UNWIND-NEXT:         ]25# UNWIND-NEXT:       }26# UNWIND-NEXT:       Entry {27# UNWIND-NEXT:         FunctionAddress: 0x23428# UNWIND-NEXT:         FunctionName: func229# UNWIND-NEXT:         Model: Compact (Inline)30# UNWIND-NEXT:         PersonalityIndex: 031# UNWIND-NEXT:         Opcodes [32# UNWIND-NEXT:           0x9B      ; vsp = r1133# UNWIND-NEXT:           0x84 0x80 ; pop {fp, lr}34# UNWIND-NEXT:         ]35# UNWIND-NEXT:       }36# UNWIND-NEXT:       Entry {37# UNWIND-NEXT:         FunctionAddress: 0x24838# UNWIND-NEXT:         FunctionName: func339# UNWIND-NEXT:         Model: Compact (Inline)40# UNWIND-NEXT:         PersonalityIndex: 041# UNWIND-NEXT:         Opcodes [42# UNWIND-NEXT:           0xB0      ; finish43# UNWIND-NEXT:           0xB0      ; finish44# UNWIND-NEXT:           0xB0      ; finish45# UNWIND-NEXT:         ]46# UNWIND-NEXT:       }47# UNWIND-NEXT:       Entry {48# UNWIND-NEXT:         FunctionAddress: 0x24C49# UNWIND-NEXT:         Model: CantUnwind50# UNWIND-NEXT:       }51# UNWIND-NEXT:       Entry {52# UNWIND-NEXT:         FunctionAddress: 0x4000026B53# UNWIND-NEXT:         FunctionName: func454# UNWIND-NEXT:         Model: Compact (Inline)55# UNWIND-NEXT:         PersonalityIndex: 056# UNWIND-NEXT:         Opcodes [57# UNWIND-NEXT:           0xB0      ; finish58# UNWIND-NEXT:           0xB0      ; finish59# UNWIND-NEXT:           0xB0      ; finish60# UNWIND-NEXT:         ]61# UNWIND-NEXT:       }62# UNWIND-NEXT:       Entry {63# UNWIND-NEXT:         FunctionAddress: 0x25C64# UNWIND-NEXT:         FunctionName: func565# UNWIND-NEXT:         ExceptionHandlingTable: .ARM.extab66# UNWIND-NEXT:         TableEntryAddress: 0xAABE4467# UNWIND-NEXT:         Model: Generic68# UNWIND-NEXT:         PersonalityRoutineAddress: 0x33CCCF4469# UNWIND-NEXT:         PersonalityRoutineName: personality170# UNWIND-NEXT:       }71# UNWIND-NEXT:       Entry {72# UNWIND-NEXT:         FunctionAddress: 0x25C73# UNWIND-NEXT:         FunctionName: func574# UNWIND-NEXT:         ExceptionHandlingTable: .ARM.extab75# UNWIND-NEXT:         TableEntryAddress: 0xAABE4876# UNWIND-NEXT:         Model: Generic77# UNWIND-NEXT:         PersonalityRoutineAddress: 0xFFFFFFFFF811138C78# UNWIND-NEXT:       }79# UNWIND-NEXT:     ]80# UNWIND-NEXT:   }81# UNWIND-NEXT: }82 83--- !ELF84FileHeader:85  Class:   ELFCLASS3286  Data:    ELFDATA2LSB87  Type:    ET_DYN88  Machine: EM_ARM89Sections:90  - Name:    .text91    Type:    SHT_PROGBITS92    Address: 0x23093  - Name:    .ARM.exidx94    Type:    SHT_ARM_EXIDX95    Address: 0x24C96    Entries:97## A. Address of .ARM.exidx (0x24C) + entry offset (0) + 0x7fffffe4 (31 bit) == 0x230 (func1).98      - Offset: 0x7FFFFFE499        Value:  0x80B0B0B0 ## arbitrary opcodes.100## B. Address of .ARM.exidx (0x24C) + entry offset (8) + 0x7fffffe0 (31 bit) == 0x234 (func2).101      - Offset: 0x7FFFFFE0102        Value:  0x809B8480 ## arbitrary opcodes.103## C. Address of .ARM.exidx (0x24C) + entry offset (16) + 0x7fffffec (31 bit) == 0x248 (func3).104      - Offset: 0x7FFFFFEC105        Value:  0x80B0B0B0 ## arbitrary opcodes.106## D. Address of .ARM.exidx (0x24C) + entry offset (24) + 0x7fffffe8 (31 bit) == 0x24C.107      - Offset: 0x7FFFFFE8108        Value:  EXIDX_CANTUNWIND109## E. Address of .ARM.exidx (0x24C) + entry offset (32) + 0x3FFFFFFF (31 bit) == 0x4000026b (func4).110      - Offset: 0x3FFFFFFF111        Value:  0x80B0B0B0 ## arbitrary opcodes.112## F. Address of .ARM.exidx (0x24C) + entry offset (40) + 0x7FFFFFE8 (31 bit) == 0x25c (func5).113      - Offset: 0x7FFFFFE8114## Generic model. .ARM.exidx (0x24C) + entry offset (40 + 4) + 0x00AABBCC ==115##                0x00AABE44 == address of entry [0] in the .ARM.extab section.116##                0x00AABE44 + 0x33221100 (31 bit, signed, .ARM.extab entry [0] value) ==117##                  0x33cccf44 == personality1 routine address.118        Value:  0x00AABBCC119## G. Address of .ARM.exidx (0x24C) + entry offset (48) + 0x7FFFFFE0 (31 bit) == 0x25c (func5).120      - Offset: 0x7FFFFFE0121## Generic model. .ARM.exidx (0x24C) + entry offset (48 + 4) + 0x00AABBC8 ==122##                0x00AABE48 == address of entry [1] in the .ARM.extab section.123##                0x00AABE48 + 0x77665544 (31 bit, signed, .ARM.extab entry [1] value) ==124##                  0xFFFFFFFFF811138C == the address of a personality routine function that does not exist.125        Value:  0x00AABBC8126  - Name:    .ARM.extab127    Type:    SHT_PROGBITS128    Address: 0x00AABE44129    Content: "0011223344556677"130Symbols:131  - Name:    func1132    Type:    STT_FUNC133    Section: .text134    Value:   0x230135  - Name:    func2136    Type:    STT_FUNC137    Section: .text138    Value:   0x234139  - Name:    func3140    Type:    STT_FUNC141    Section: .text142    Value:   0x248143  - Name:    func4144    Type:    STT_FUNC145    Section: .text146    Value:   0x4000026b147  - Name:    func5148    Type:    STT_FUNC149    Section: .text150    Value:   0x25c151  - Name:  personality1152    Type:  STT_FUNC153    Value: 0x33cccf44154