43 lines · plain
1# REQUIRES: x862## Test relocations referencing non-STT_SECTION local symbols in SHF_ALLOC and non-SHF_ALLOC sections for -r.3 4# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o5# RUN: ld.lld -r -o %t %t.o %t.o6# RUN: llvm-readelf -r -x .nonalloc %t | FileCheck --check-prefix=RELA %s7 8# RUN: llvm-mc -filetype=obj -triple=i686 --defsym X86_32=1 %s -o %t1.o9# RUN: ld.lld -r -o %t1 %t1.o %t1.o10# RUN: llvm-readelf -r -x .nonalloc %t1 | FileCheck --check-prefix=REL %s11 12# RELA: Relocation section '.rela.data' at offset {{.*}} contains 2 entries:13# RELA: Offset Info Type Symbol's Value Symbol's Name + Addend14# RELA-NEXT: 0000000000000000 {{.*}} R_X86_64_32 0000000000000000 ifunc + 915# RELA-NEXT: 0000000000000004 {{.*}} R_X86_64_32 0000000000000004 ifunc + 916# RELA: Relocation section '.rela.nonalloc' at offset {{.*}} contains 2 entries:17# RELA: Offset Info Type Symbol's Value Symbol's Name + Addend18# RELA-NEXT: 0000000000000000 {{.*}} R_X86_64_32 0000000000000000 ifunc + 919# RELA-NEXT: 0000000000000004 {{.*}} R_X86_64_32 0000000000000004 ifunc + 920# RELA: Hex dump of section '.nonalloc':21# RELA-NEXT: 0x00000000 00000000 00000000 ........22 23# REL: Offset Info Type Sym. Value Symbol's Name24# REL-NEXT: 00000000 {{.*}} R_386_32 00000000 ifunc25# REL-NEXT: 00000004 {{.*}} R_386_32 00000004 ifunc26# REL-EMPTY:27# REL: Offset Info Type Sym. Value Symbol's Name28# REL-NEXT: 00000000 {{.*}} R_386_32 00000000 ifunc29# REL-NEXT: 00000004 {{.*}} R_386_32 00000004 ifunc30# REL: Hex dump of section '.nonalloc':31# REL-NEXT: 0x00000000 09000000 09000000 ........32 33resolver: ret34.type ifunc, @gnu_indirect_function35.set ifunc, resolver36 37.data38.long ifunc+939 40.section .nonalloc41## The relocation references ifunc instead of the STT_SECTION symbol.42.long ifunc+943