[lld] r199514 - [Mips] Provide default name of MIPS-specific interpreter.
Simon Atanasyan
simon at atanasyan.com
Fri Jan 17 13:18:15 PST 2014
Author: atanasyan
Date: Fri Jan 17 15:18:14 2014
New Revision: 199514
URL: http://llvm.org/viewvc/llvm-project?rev=199514&view=rev
Log:
[Mips] Provide default name of MIPS-specific interpreter.
Added:
lld/trunk/test/elf/Mips/interpreter.test
Modified:
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h
lld/trunk/test/elf/Mips/base-address.test
lld/trunk/test/elf/Mips/entry-name.test
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp?rev=199514&r1=199513&r2=199514&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp Fri Jan 17 15:18:14 2014
@@ -46,6 +46,10 @@ StringRef MipsLinkingContext::entrySymbo
return _entrySymbolName;
}
+StringRef MipsLinkingContext::getDefaultInterpreter() const {
+ return "/lib/ld.so.1";
+}
+
void MipsLinkingContext::addPasses(PassManager &pm) {
auto pass = createMipsRelocationPass(*this);
if (pass)
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h?rev=199514&r1=199513&r2=199514&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h Fri Jan 17 15:18:14 2014
@@ -37,6 +37,7 @@ public:
virtual bool isLittleEndian() const;
virtual uint64_t getBaseAddress() const;
virtual StringRef entrySymbolName() const;
+ virtual StringRef getDefaultInterpreter() const;
virtual void addPasses(PassManager &pm);
};
Modified: lld/trunk/test/elf/Mips/base-address.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/base-address.test?rev=199514&r1=199513&r2=199514&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/base-address.test (original)
+++ lld/trunk/test/elf/Mips/base-address.test Fri Jan 17 15:18:14 2014
@@ -7,9 +7,9 @@
# CHECK: DynamicSection [ (15 entries)
# CHECK: Tag Type Name/Value
-# CHECK: 0x00000004 HASH 0x400110
-# CHECK: 0x00000005 STRTAB 0x400130
-# CHECK: 0x00000006 SYMTAB 0x400120
+# CHECK: 0x00000004 HASH 0x400104
+# CHECK: 0x00000005 STRTAB 0x400124
+# CHECK: 0x00000006 SYMTAB 0x400114
# CHECK: 0x0000000A STRSZ 1 (bytes)
# CHECK: 0x0000000B SYMENT 16 (bytes)
# CHECK: 0x0000001A FINI_ARRAY 0x0
@@ -52,8 +52,8 @@
# CHECK: }
# CHECK: ProgramHeader {
# CHECK: Type: PT_DYNAMIC (0x2)
-# CHECK: Offset: 0x138
-# CHECK: VirtualAddress: 0x400138
+# CHECK: Offset: 0x12C
+# CHECK: VirtualAddress: 0x40012C
# CHECK: }
# CHECK: ]
Modified: lld/trunk/test/elf/Mips/entry-name.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/entry-name.test?rev=199514&r1=199513&r2=199514&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/entry-name.test (original)
+++ lld/trunk/test/elf/Mips/entry-name.test Fri Jan 17 15:18:14 2014
@@ -4,7 +4,7 @@
# RUN: llvm-objdump -t %t2 | FileCheck %s
# CHECK: SYMBOL TABLE:
-# CHECK: 00400134 g F .text 00000004 main
+# CHECK: 00400128 g F .text 00000004 main
# CHECK: 00000000 *UND* 00000000 __start
.global main
Added: lld/trunk/test/elf/Mips/interpreter.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/interpreter.test?rev=199514&view=auto
==============================================================================
--- lld/trunk/test/elf/Mips/interpreter.test (added)
+++ lld/trunk/test/elf/Mips/interpreter.test Fri Jan 17 15:18:14 2014
@@ -0,0 +1,13 @@
+# Check program interpreter setup.
+# RUN: llvm-mc -triple=mipsel -filetype=obj -o=%t1 %s
+# RUN: lld -flavor gnu -target mipsel -e main -o %t2 %t1
+# RUN: llvm-objdump -s %t2 | FileCheck %s
+
+# CHECK: Contents of section .interp:
+# CHECK-NEXT: 4000f4 2f6c6962 2f6c642e 736f2e31 00 /lib/ld.so.1.
+
+ .global main
+ .ent main
+main:
+ nop
+ .end main
More information about the llvm-commits
mailing list