30 lines · plain
1## This test checks that if a section has a sh_link field, and one or more2## sections are removed such that the target section index changes, then3## llvm-objcopy correctly updates the sh_link field.4 5# RUN: yaml2obj %s -o %t.o6# RUN: llvm-objcopy --remove-section .foo %t.o %t2.o7# RUN: llvm-readobj --section-headers %t2.o | FileCheck %s8 9--- !ELF10FileHeader:11 Class: ELFCLASS6412 Data: ELFDATA2LSB13 Type: ET_EXEC14 Machine: EM_X86_6415Sections:16 - Name: .foo17 Type: SHT_PROGBITS18 - Name: .bar19 Type: SHT_PROGBITS20 - Name: .baz21 Type: SHT_PROGBITS22 Link: .bar23 24# CHECK: Index: 125# CHECK-NEXT: Name: .bar26# CHECK: Name: .baz27## Find the next "Link" line, then check the value is exactly the index of .bar.28# CHECK: Link29# CHECK-SAME: : 1{{$}}30