45 lines · plain
1# REQUIRES: loongarch2# RUN: rm -rf %t && split-file %s %t3 4# RUN: llvm-mc --filetype=obj --triple=loongarch32 %t/32.s -o %t/32.o5# RUN: llvm-mc --filetype=obj --triple=loongarch64 %t/64.s -o %t/64.o6# RUN: ld.lld -shared %t/32.o -o %t/32.so7# RUN: llvm-nm %t/32.so | FileCheck --check-prefix=NM32 %s8# RUN: llvm-readobj -r %t/32.so | FileCheck --check-prefix=RELOC32 %s9# RUN: ld.lld -shared %t/64.o -o %t/64.so10# RUN: llvm-nm %t/64.so | FileCheck --check-prefix=NM64 %s11# RUN: llvm-readobj -r %t/64.so | FileCheck --check-prefix=RELOC64 %s12 13## R_LARCH_32 and R_LARCH_64 are absolute relocation types.14## In PIC mode, they create relative relocations if the symbol is non-preemptable.15 16# NM32: 000301fc d b17# NM64: 00030350 d b18 19# RELOC32: .rela.dyn {20# RELOC32-NEXT: 0x301FC R_LARCH_RELATIVE - 0x301FC21# RELOC32-NEXT: 0x301F8 R_LARCH_32 a 022# RELOC32-NEXT: }23# RELOC64: .rela.dyn {24# RELOC64-NEXT: 0x30350 R_LARCH_RELATIVE - 0x3035025# RELOC64-NEXT: 0x30348 R_LARCH_64 a 026# RELOC64-NEXT: }27 28#--- 32.s29.globl a, b30.hidden b31 32.data33.long a34b:35.long b36 37#--- 64.s38.globl a, b39.hidden b40 41.data42.quad a43b:44.quad b45