2 ## Check that we ignore R_MIPS_JALR relocations agains non-function symbols.
3 ## Older versions of clang were erroneously generating them for function pointers
4 ## loaded from any table (not just the GOT) as well as against TLS function
5 ## pointers (when using the local-dynamic model), so we need to ignore these
6 ## relocations to avoid generating binaries that crash when executed.
8 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o
9 ## Link in another object file with a .bss as a regression test:
10 ## Previously LLD asserted when skipping over .bss sections when determining the
11 ## location for a warning/error message. By adding another file with a .bss
12 ## section before the actual %t.o we can reproduce this case.
13 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %S/Inputs/common.s -o %t-common.o
14 # RUN: ld.lld -shared %t-common.o %t.o -o %t.so 2>&1 | FileCheck %s -check-prefix WARNING-MESSAGE
15 # RUN: llvm-objdump --no-show-raw-insn --no-leading-addr -d %t.so | FileCheck %s
19 .reloc .Ltmp1, R_MIPS_JALR, tls_obj
23 # WARNING-MESSAGE: warning: {{.+}}.tmp.o:(.text+0x0): found R_MIPS_JALR relocation against non-function symbol tls_obj. This is invalid and most likely a compiler bug.
25 .reloc .Ltmp2, R_MIPS_JALR, reg_obj
29 # WARNING-MESSAGE: warning: {{.+}}.tmp.o:(.text+0x8): found R_MIPS_JALR relocation against non-function symbol reg_obj. This is invalid and most likely a compiler bug.
31 .reloc .Ltmp3, R_MIPS_JALR, untyped
36 ## However, we do perform the optimization for untyped symbols:
41 .section .tbss,"awT",@nobits
50 # CHECK-LABEL: Disassembly of section .text:
57 # CHECK-NEXT: b 8 <untyped>