brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · cda9b81 Raw
55 lines · plain
1# RUN: yaml2obj %s -o %t2# RUN: not llvm-objcopy -R .symtab %t %t2 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR1 -DINPUT=%t3# RUN: cp %t %t34# RUN: not llvm-strip --no-strip-all -R .symtab %t3 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR2 -DINPUT=%t35 6# RUN: yaml2obj -DTYPE=SHT_CREL %s -o %t.crel7# RUN: not llvm-objcopy -R .symtab %t.crel %t2.crel 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR1 -DINPUT=%t.crel8 9!ELF10FileHeader:11  Class:           ELFCLASS6412  Data:            ELFDATA2LSB13  Type:            ET_REL14  Machine:         EM_X86_6415Sections:16  - Name:            .text17    Type:            SHT_PROGBITS18    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]19    Address:         0x100020    AddressAlign:    0x000000000000001021    Content:         "0000000000000000"22  - Name:            .rel.text23    Type:            [[TYPE=SHT_REL]]24    Link:            .symtab25    Info:            .text26    Relocations:27      - Offset: 0x100028        Symbol: foo29        Type:   R_X86_64_PC3230 31Symbols:32  - Name:     foo33    Type:     STT_FUNC34    Size:     435    Binding:  STB_GLOBAL36 37# ERR1: error: '[[INPUT]]': symbol table '.symtab' cannot be removed because it is referenced by the relocation section '.rel.text'38# ERR2: error: '[[INPUT]]': symbol table '.symtab' cannot be removed because it is referenced by the relocation section '.rel.text'39 40# RUN: llvm-objcopy --allow-broken-links -R .symtab %t %t441# RUN: llvm-readobj --sections %t4 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.symtab42# RUN: cp %t %t543# RUN: llvm-strip --no-strip-all --allow-broken-links -R .symtab %t544# RUN: llvm-readobj --sections %t5 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.symtab45 46# RUN: llvm-objcopy --allow-broken-links -R .symtab %t.crel %t4.crel47# RUN: llvm-readobj --sections %t4.crel | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.symtab48# RUN: cp %t.crel %t5.crel49# RUN: llvm-strip --no-strip-all --allow-broken-links -R .symtab %t5.crel50# RUN: llvm-readobj --sections %t5.crel | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.symtab51 52# SECTIONS:        Name: .rel.text53# SECTIONS:        Link54# SECTIONS-SAME: : 055