summaryrefslogtreecommitdiffstats
path: root/lld/test
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2015-12-13 06:49:14 +0000
committerSimon Atanasyan <simon@atanasyan.com>2015-12-13 06:49:14 +0000
commite4361859c0d1b039f6a5ddf369f8fb20bca292df (patch)
tree75f3b5083f721ba72be7ebb7a4b43c5deab3cad3 /lld/test
parentdddbeb7a46e8a2b688a7c863bd4ce51346faff35 (diff)
downloadbcm5719-llvm-e4361859c0d1b039f6a5ddf369f8fb20bca292df.tar.gz
bcm5719-llvm-e4361859c0d1b039f6a5ddf369f8fb20bca292df.zip
[ELF][MIPS] Ignore R_MIPS_JALR relocation for now
The `R_MIPS_JALR` is a relocation generated by gcc and gas. This relocation points to the `jalr` instruction which might be optimized and converted to the `b` instruction under some conditions. Now we just ignore this relocation and keep instructions unchanged. llvm-svn: 255453
Diffstat (limited to 'lld/test')
-rw-r--r--lld/test/ELF/mips-jalr.test47
1 files changed, 47 insertions, 0 deletions
diff --git a/lld/test/ELF/mips-jalr.test b/lld/test/ELF/mips-jalr.test
new file mode 100644
index 00000000000..4bdf8b6e7f0
--- /dev/null
+++ b/lld/test/ELF/mips-jalr.test
@@ -0,0 +1,47 @@
+# Check that lld ignores R_MIPS_JALR relocation for now.
+
+# RUN: yaml2obj -format elf %s -o %t.o
+# RUN: ld.lld %t.o -o %t.so -shared
+# RUN: llvm-objdump -d %t.so | FileCheck %s
+
+# REQUIRES: mips
+
+# CHECK: 10000: 09 f8 20 03 jalr $25
+
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_MIPS
+ Flags: [EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32]
+
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ AddressAlign: 16
+ Content: "09f82003"
+# ^-- jalr T1
+
+ - Name: .rel.text
+ Type: SHT_REL
+ Link: .symtab
+ Info: .text
+ Relocations:
+ - Offset: 0
+ Symbol: T1
+ Type: R_MIPS_JALR
+
+Symbols:
+ Local:
+ - Name: T1
+ Type: STT_FUNC
+ Section: .text
+ Value: 0
+ Size: 4
+ Global:
+ - Name: __start
+ Type: STT_FUNC
+ Section: .text
+ Value: 0
+ Size: 4
OpenPOWER on IntegriCloud