1 ## If the section header index of a SHT_REL[A] section is smaller than the
2 ## section header index of the relocated section, we should handle it properly.
3 ## Normally it is not what compilers would emit, but some custom tools might
4 ## want to use this feature, which is not restricted by ELF gABI.
5 ## GNU ld supports this as well.
7 # RUN: yaml2obj %s -DTYPE=SHT_RELA -o %t1.o
8 # RUN: ld.lld -shared %t1.o -o %t1
9 # RUN: llvm-readelf --relocs %t1 | FileCheck %s
11 # RUN: yaml2obj %s -DTYPE=SHT_REL -o %t2.o
12 # RUN: ld.lld -shared %t2.o -o %t2
13 # RUN: llvm-readelf --relocs %t2 | FileCheck %s
15 ## Check we handle the relocation properly.
16 # CHECK: Relocation section '.rela.dyn' at offset 0x238 contains 1 entries:
17 # CHECK-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend
18 # CHECK-NEXT: 00000000000022f0 0000000100000001 R_X86_64_64 0000000000000000 foo + 0
35 Flags: [ SHF_ALLOC, SHF_WRITE ]