brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · e37a0ec Raw
59 lines · plain
1// REQUIRES: x862// RUN: rm -rf %t && split-file %s %t && cd %t3// RUN: llvm-mc -filetype=obj -triple=i386 --defsym X86_32=1 asm -o a.o4// RUN: ld.lld -T lds a.o -o a 2>&1 | FileCheck %s --implicit-check-not=warning:5// CHECK:      warning: {{.*}}.o:(.nonalloc1+0x1): has non-ABS relocation R_386_PC32 against symbol '_start'6// CHECK-NEXT: warning: {{.*}}.o:(.nonalloc1+0x6): has non-ABS relocation R_386_PC32 against symbol 'ifunc'7// CHECK-NEXT: warning: {{.*}}.o:(.nonalloc1+0xa): has non-ABS relocation R_386_PC32 against symbol ''8 9// RUN: llvm-objdump -D --no-show-raw-insn a | FileCheck --check-prefix=DISASM %s10// DISASM:      Disassembly of section .nonalloc:11// DISASM-EMPTY:12// DISASM-NEXT: <.nonalloc>:13// DISASM-NEXT:   0: nop14// DISASM-NEXT:   1: call{{.}} 0x015// DISASM-NEXT:   6: call{{.}} 0x516 17/// There is currently no error for -r. See also https://github.com/ClangBuiltLinux/linux/issues/193718// RUN: ld.lld -T lds -r a.o 2>&1 | FileCheck %s --check-prefix=REL-R --implicit-check-not=warning:19// REL-R: warning: {{.*}}:(.nonalloc1+0xa): has non-ABS relocation R_386_PC32 against symbol ''20 21// RUN: llvm-mc -filetype=obj -triple=x86_64 asm -o b.o22// RUN: ld.lld -T lds b.o -o b 2>&1 | FileCheck %s --check-prefix=CHECK2 --implicit-check-not=warning:23// RUN: llvm-objdump -D --no-show-raw-insn b | FileCheck --check-prefix=DISASM %s24// RUN: ld.lld -T lds -r b.o --fatal-warnings25// CHECK2:      warning: {{.*}}.o:(.nonalloc1+0x1): has non-ABS relocation R_X86_64_PC32 against symbol '_start'26// CHECK2-NEXT: warning: {{.*}}.o:(.nonalloc1+0x6): has non-ABS relocation R_X86_64_PC32 against symbol 'ifunc'27// CHECK2-NEXT: warning: {{.*}}.o:(.nonalloc1+0xa): has non-ABS relocation R_X86_64_PC32 against symbol ''28 29//--- lds30SECTIONS {31  .nonalloc 0 : { *(.nonalloc*) }32}33//--- asm34.globl _start35_start:36.L0:37  nop38 39resolver: ret40.type ifunc, @gnu_indirect_function41.set ifunc, resolver42 43.section .nonalloc044  nop45 46.section .nonalloc147  .byte 0xe848  .long _start - . - 449  .byte 0xe850  .long ifunc - .51  .long .nonalloc0 - .52 53// GCC may relocate DW_AT_GNU_call_site_value with R_386_GOTOFF.54// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=9894655.ifdef X86_3256.section .debug_random57  .long .L0@gotoff58.endif59