brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · d9557dc Raw
40 lines · plain
1## Check we report warnings when relocations are broken.2 3# RUN: yaml2obj --docnum=1 %s -o %t14# RUN: llvm-readobj --relocs --expand-relocs %t1 2>&1 | \5# RUN:   FileCheck %s -DFILE=%t1 --check-prefix=INVALID-REL6 7# INVALID-REL:      Relocations [8# INVALID-REL-NEXT:   warning: '[[FILE]]': The end of the file was unexpectedly encountered: relocations with offset 0x222 and size 0x0 go past the end of the file9# INVALID-REL-NEXT: ]10 11--- !XCOFF12FileHeader:13  MagicNumber:   0x1DF14Sections:15  - Name:        .text16    Flags:       [ STYP_TEXT ]17## Case 1: Incorrect offset to relocation entries.18    FileOffsetToRelocations: 0x22219 20# RUN: yaml2obj --docnum=2 %s -o %t221# RUN: llvm-readobj --relocs --expand-relocs %t2 2>&1 | \22# RUN:   FileCheck %s -DFILE=%t2 --check-prefix=INVALID-SYM23 24# INVALID-SYM:      Relocations [25# INVALID-SYM-NEXT:   Section (index: 1) .text {26# INVALID-SYM-NEXT:     warning: '[[FILE]]': symbol index 33 exceeds symbol count 027# INVALID-SYM-NEXT:   }28# INVALID-SYM-NEXT: ]29 30--- !XCOFF31FileHeader:32  MagicNumber:   0x1DF33Sections:34  - Name:        .text35    Flags:       [ STYP_TEXT ]36    Relocations:37      - Address: 0x8038## Case 2: There is no symbol with index 0x21.39        Symbol:  0x2140