67 lines · plain
1# REQUIRES: x86-registered-target2 3## Test that we report meaningful warnings when dumping4## broken Android's packed relocation sections.5 6# RUN: split-file %s %t7 8# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm1.s -o %t1.o9# RUN: llvm-readobj --relocations %t1.o 2>&1 | FileCheck %s -DFILE=%t1.o --check-prefix=ERR-HEADER10# RUN: llvm-readelf --relocations %t1.o 2>&1 | FileCheck %s -DFILE=%t1.o --check-prefix=ERR-HEADER11 12#--- asm1.s13.section .rela.dyn, "a", @0x6000000114.ascii "APS9"15 16# ERR-HEADER: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 3: invalid packed relocation header17 18# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm2.s -o %t2.o19# RUN: llvm-readobj --relocations %t2.o 2>&1 | FileCheck %s -DFILE=%t2.o --check-prefix=ERR-PAST-END20# RUN: llvm-readelf --relocations %t2.o 2>&1 | FileCheck %s -DFILE=%t2.o --check-prefix=ERR-PAST-END21 22#--- asm2.s23.section .rela.dyn, "a", @0x6000000124.ascii "APS2"25 26# ERR-PAST-END: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 3: unable to decode LEB128 at offset 0x{{([[:xdigit:]]{8})}}: malformed sleb128, extends past end27 28# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm3.s -o %t3.o29# RUN: llvm-readobj --relocations %t3.o 2>&1 | FileCheck %s -DFILE=%t3.o --check-prefix=ERR-PAST-END30# RUN: llvm-readelf --relocations %t3.o 2>&1 | FileCheck %s -DFILE=%t3.o --check-prefix=ERR-PAST-END31 32#--- asm3.s33.section .rela.dyn, "a", @0x6000000134.ascii "APS2"35.sleb128 4 ## Number of relocations36.sleb128 0 ## Initial offset37 38# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm4.s -o %t4.o39# RUN: llvm-readobj --relocations %t4.o 2>&1 | FileCheck %s -DFILE=%t4.o --check-prefix=ERR-PAST-END40# RUN: llvm-readelf --relocations %t4.o 2>&1 | FileCheck %s -DFILE=%t4.o --check-prefix=ERR-PAST-END41 42#--- asm4.s43.section .rela.dyn, "a", @0x6000000144.ascii "APS2"45.sleb128 4 ## Number of relocations46.sleb128 0 ## Initial offset47 48.sleb128 2 ## Number of relocations in group49.sleb128 2 ## RELOCATION_GROUPED_BY_OFFSET_DELTA_FLAG50.sleb128 8 ## offset delta51 52# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm5.s -o %t5.o53# RUN: llvm-readobj --relocations %t5.o 2>&1 | FileCheck %s -DFILE=%t5.o --check-prefix=ERR-LARGE54# RUN: llvm-readelf --relocations %t5.o 2>&1 | FileCheck %s -DFILE=%t5.o --check-prefix=ERR-LARGE55 56# ERR-LARGE: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 3: relocation group unexpectedly large57 58#--- asm5.s59.section .rela.dyn, "a", @0x6000000160.ascii "APS2"61.sleb128 4 ## Number of relocations62.sleb128 0 ## Initial offset63 64.sleb128 5 ## Number of relocations in group65.sleb128 2 ## RELOCATION_GROUPED_BY_OFFSET_DELTA_FLAG66.sleb128 8 ## offset delta67