[lld] r239179 - [Mips] Add test to check relocation result shifting in case of N64 ABI
Simon Atanasyan
simon at atanasyan.com
Fri Jun 5 11:26:38 PDT 2015
Author: atanasyan
Date: Fri Jun 5 13:26:38 2015
New Revision: 239179
URL: http://llvm.org/viewvc/llvm-project?rev=239179&view=rev
Log:
[Mips] Add test to check relocation result shifting in case of N64 ABI
Added:
lld/trunk/test/elf/Mips/n64-rel-shift.test
Added: lld/trunk/test/elf/Mips/n64-rel-shift.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/n64-rel-shift.test?rev=239179&view=auto
==============================================================================
--- lld/trunk/test/elf/Mips/n64-rel-shift.test (added)
+++ lld/trunk/test/elf/Mips/n64-rel-shift.test Fri Jun 5 13:26:38 2015
@@ -0,0 +1,48 @@
+# Check that LLD shift right relocation result after calculation
+# each relocations in N64 relocation chain.
+
+# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: lld -flavor gnu -target mips64el -shared -o %t.so %t.o
+# RUN: llvm-objdump -s %t.so | FileCheck %s
+
+# CHECK: Contents of section .text:
+# CHECK-NEXT: {{[0-9a-f]+}} 00000000 01000000 00000000 00000000
+
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_MIPS
+ Flags: [EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64R2]
+
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ AddressAlign: 16
+ Size: 16
+
+ - Name: .rela.text
+ Type: SHT_RELA
+ Link: .symtab
+ AddressAlign: 8
+ Info: .text
+ Relocations:
+ - Offset: 4
+ Symbol: T1
+ Addend: 8
+ Type: R_MIPS_PC19_S2
+ Type2: R_MIPS_64
+
+Symbols:
+ Global:
+ - Name: T1
+ Type: STT_FUNC
+ Section: .text
+ Value: 0
+ Size: 8
+ - Name: bar
+ Type: STT_FUNC
+ Section: .text
+ Value: 8
+ Size: 8
More information about the llvm-commits
mailing list