[lld] r243626 - [Mips] Implement definition of DT_MIPS_RLD_MAP dynamic tag, .rld_map section, and __RLD_MAP symbol
Simon Atanasyan
simon at atanasyan.com
Thu Jul 30 00:45:55 PDT 2015
Author: atanasyan
Date: Thu Jul 30 02:45:55 2015
New Revision: 243626
URL: http://llvm.org/viewvc/llvm-project?rev=243626&view=rev
Log:
[Mips] Implement definition of DT_MIPS_RLD_MAP dynamic tag, .rld_map section, and __RLD_MAP symbol
Added:
lld/trunk/test/elf/Mips/rld_map.test
Modified:
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
lld/trunk/test/elf/Mips/base-address-64.test
lld/trunk/test/elf/Mips/base-address.test
lld/trunk/test/elf/Mips/dynamic-sym.test
lld/trunk/test/elf/Mips/exe-dynamic.test
lld/trunk/test/elf/Mips/exe-fileheader-micro-64.test
lld/trunk/test/elf/Mips/exe-fileheader-micro.test
lld/trunk/test/elf/Mips/got-page-32-micro.test
lld/trunk/test/elf/Mips/got-page-32.test
lld/trunk/test/elf/Mips/got-page-64-micro.test
lld/trunk/test/elf/Mips/got-page-64.test
lld/trunk/test/elf/Mips/hilo16-1.test
lld/trunk/test/elf/Mips/hilo16-2.test
lld/trunk/test/elf/Mips/hilo16-8-micro.test
lld/trunk/test/elf/Mips/jalx.test
lld/trunk/test/elf/Mips/la25-stub-be.test
lld/trunk/test/elf/Mips/la25-stub-micro-be.test
lld/trunk/test/elf/Mips/la25-stub-micro.test
lld/trunk/test/elf/Mips/la25-stub-npic-01.test
lld/trunk/test/elf/Mips/la25-stub-npic-02.test
lld/trunk/test/elf/Mips/la25-stub-pic.test
lld/trunk/test/elf/Mips/la25-stub.test
lld/trunk/test/elf/Mips/n64-rel-chain.test
lld/trunk/test/elf/Mips/r26-2-micro.test
lld/trunk/test/elf/Mips/r26-2.test
lld/trunk/test/elf/Mips/rel-copy-micro.test
lld/trunk/test/elf/Mips/rel-copy-pc.test
lld/trunk/test/elf/Mips/rel-copy.test
lld/trunk/test/elf/Mips/rel-dynamic-01-micro.test
lld/trunk/test/elf/Mips/rel-dynamic-01.test
lld/trunk/test/elf/Mips/rel-dynamic-12.test
lld/trunk/test/elf/Mips/rel-gprel32-64.test
lld/trunk/test/elf/Mips/rel-gprel32.test
lld/trunk/test/elf/Mips/rel-high-01.test
lld/trunk/test/elf/Mips/rel-high-02.test
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h Thu Jul 30 02:45:55 2015
@@ -30,6 +30,10 @@ public:
// Version id for the Runtime Linker Interface.
this->addEntry(DT_MIPS_RLD_VERSION, 1);
+ // The .rld_map section address.
+ if (this->_ctx.isDynamic() && this->_ctx.getOutputELFType() == ET_EXEC)
+ _dt_rldmap = this->addEntry(DT_MIPS_RLD_MAP, 0);
+
// MIPS flags.
this->addEntry(DT_MIPS_FLAGS, RHF_NOTPOT);
@@ -78,6 +82,9 @@ public:
if (const auto *sec = _targetLayout.findOutputSection(".MIPS.options"))
this->_entries[_dt_options].d_un.d_ptr = sec->virtualAddr();
+
+ if (const auto *sec = _targetLayout.findOutputSection(".rld_map"))
+ this->_entries[_dt_rldmap].d_un.d_ptr = sec->virtualAddr();
}
int64_t getGotPltTag() override { return DT_MIPS_PLTGOT; }
@@ -99,6 +106,7 @@ private:
std::size_t _dt_pltgot;
std::size_t _dt_baseaddr;
std::size_t _dt_options;
+ std::size_t _dt_rldmap;
MipsTargetLayout<ELFT> &_targetLayout;
};
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp Thu Jul 30 02:45:55 2015
@@ -426,6 +426,24 @@ public:
StringRef customSectionName() const override { return ".got"; }
};
+template <typename ELFT> class MipsRldAtom : public SimpleELFDefinedAtom {
+public:
+ MipsRldAtom(const File &f) : SimpleELFDefinedAtom(f) {}
+
+ Scope scope() const override { return scopeGlobal; }
+ SectionChoice sectionChoice() const override { return sectionCustomRequired; }
+ StringRef customSectionName() const override { return ".rld_map"; }
+ ContentType contentType() const override { return typeData; }
+ uint64_t size() const override { return rawContent().size(); }
+ ContentPermissions permissions() const override { return permRW_; }
+ Alignment alignment() const override { return rawContent().size(); }
+ StringRef name() const override { return "__RLD_MAP"; }
+ ArrayRef<uint8_t> rawContent() const override {
+ return llvm::makeArrayRef(mipsGot0AtomContent)
+ .slice(ELFT::Is64Bits ? 0 : 4);
+ }
+};
+
class RelocationPassFile : public SimpleFile {
public:
RelocationPassFile(const ELFLinkingContext &ctx)
@@ -598,6 +616,12 @@ std::error_code RelocationPass<ELFT>::pe
uint64_t ordinal = 0;
+ if (_ctx.isDynamic() && _ctx.getOutputELFType() == ET_EXEC) {
+ auto rlda = new (_file._alloc) MipsRldAtom<ELFT>(_file);
+ rlda->setOrdinal(ordinal++);
+ mf.addAtom(*rlda);
+ }
+
if (!_localGotVector.empty() || !_globalGotVector.empty() ||
!_tlsGotVector.empty()) {
SimpleDefinedAtom *ga = new (_file._alloc) MipsGlobalOffsetTableAtom(_file);
Modified: lld/trunk/test/elf/Mips/base-address-64.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/base-address-64.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/base-address-64.test (original)
+++ lld/trunk/test/elf/Mips/base-address-64.test Thu Jul 30 02:45:55 2015
@@ -5,7 +5,7 @@
# RUN: lld -flavor gnu -target mips64el --noinhibit-exec -o %t.exe %t.o
# RUN: llvm-readobj -dynamic-table -program-headers %t.exe | FileCheck %s
-# CHECK: DynamicSection [ (13 entries)
+# CHECK: DynamicSection [ (14 entries)
# CHECK: Tag Type Name/Value
# CHECK-NEXT: 0x0000000000000004 HASH 0x{{[0-9A-F]+}}
# CHECK-NEXT: 0x0000000000000005 STRTAB 0x{{[0-9A-F]+}}
@@ -13,6 +13,7 @@
# CHECK-NEXT: 0x000000000000000A STRSZ 1 (bytes)
# CHECK-NEXT: 0x000000000000000B SYMENT 24 (bytes)
# CHECK-NEXT: 0x0000000070000001 MIPS_RLD_VERSION 1
+# CHECK-NEXT: 0x0000000070000016 MIPS_RLD_MAP 0x120002000
# CHECK-NEXT: 0x0000000070000005 MIPS_FLAGS NOTPOT
# CHECK-NEXT: 0x0000000070000006 MIPS_BASE_ADDRESS 0x120000000
# CHECK-NEXT: 0x000000007000000A MIPS_LOCAL_GOTNO 2
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=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/base-address.test (original)
+++ lld/trunk/test/elf/Mips/base-address.test Thu Jul 30 02:45:55 2015
@@ -5,7 +5,7 @@
# RUN: lld -flavor gnu -target mipsel --noinhibit-exec -o %t.exe %t.o
# RUN: llvm-readobj -dynamic-table -program-headers %t.exe | FileCheck %s
-# CHECK: DynamicSection [ (13 entries)
+# CHECK: DynamicSection [ (14 entries)
# CHECK: Tag Type Name/Value
# CHECK-NEXT: 0x00000004 HASH 0x{{[0-9A-F]+}}
# CHECK-NEXT: 0x00000005 STRTAB 0x{{[0-9A-F]+}}
@@ -13,6 +13,7 @@
# CHECK-NEXT: 0x0000000A STRSZ 1 (bytes)
# CHECK-NEXT: 0x0000000B SYMENT 16 (bytes)
# CHECK-NEXT: 0x70000001 MIPS_RLD_VERSION 1
+# CHECK-NEXT: 0x70000016 MIPS_RLD_MAP 0x402000
# CHECK-NEXT: 0x70000005 MIPS_FLAGS NOTPOT
# CHECK-NEXT: 0x70000006 MIPS_BASE_ADDRESS 0x400000
# CHECK-NEXT: 0x7000000A MIPS_LOCAL_GOTNO 2
Modified: lld/trunk/test/elf/Mips/dynamic-sym.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/dynamic-sym.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/dynamic-sym.test (original)
+++ lld/trunk/test/elf/Mips/dynamic-sym.test Thu Jul 30 02:45:55 2015
@@ -16,7 +16,7 @@
# EXE: Sections:
# EXE: Idx Name Size Address Type
-# EXE: 6 .dynamic 00000068 00000000[[ADDR:[0-9a-f]+]]
+# EXE: 6 .dynamic 00000070 00000000[[ADDR:[0-9a-f]+]]
# EXE: SYMBOL TABLE:
# EXE: [[ADDR]] g .dynamic 00000000 _DYNAMIC
Modified: lld/trunk/test/elf/Mips/exe-dynamic.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/exe-dynamic.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/exe-dynamic.test (original)
+++ lld/trunk/test/elf/Mips/exe-dynamic.test Thu Jul 30 02:45:55 2015
@@ -13,8 +13,8 @@
# CHECK: Arch: mipsel
# CHECK: AddressSize: 32bit
# CHECK: LoadName:
-# CHECK: DynamicSection [ (18 entries)
-# CHECK: Tag Type Name/Value
+# CHECK: DynamicSection [ (19 entries)
+# CHECK: Tag Type Name/Value
# CHECK-NEXT: 0x00000004 HASH 0x{{[0-9A-F]+}}
# CHECK-NEXT: 0x00000005 STRTAB 0x{{[0-9A-F]+}}
# CHECK-NEXT: 0x00000006 SYMTAB 0x{{[0-9A-F]+}}
@@ -25,6 +25,7 @@
# CHECK-NEXT: 0x00000014 PLTREL REL
# CHECK-NEXT: 0x00000017 JMPREL 0x{{[0-9A-F]+}}
# CHECK-NEXT: 0x70000001 MIPS_RLD_VERSION 1
+# CHECK-NEXT: 0x70000016 MIPS_RLD_MAP 0x40200C
# CHECK-NEXT: 0x70000005 MIPS_FLAGS NOTPOT
# CHECK-NEXT: 0x70000006 MIPS_BASE_ADDRESS 0x400000
# CHECK-NEXT: 0x7000000A MIPS_LOCAL_GOTNO 2
Modified: lld/trunk/test/elf/Mips/exe-fileheader-micro-64.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/exe-fileheader-micro-64.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/exe-fileheader-micro-64.test (original)
+++ lld/trunk/test/elf/Mips/exe-fileheader-micro-64.test Thu Jul 30 02:45:55 2015
@@ -22,7 +22,7 @@
# CHECK: Type: Executable (0x2)
# CHECK: Machine: EM_MIPS (0x8)
# CHECK: Version: 1
-# CHECK: Entry: 0x1200001A1
+# CHECK: Entry: 0x{{[0-9A-F]+}}
# CHECK: ProgramHeaderOffset: 0x{{[0-9A-F]+}}
# CHECK: SectionHeaderOffset: 0x{{[0-9A-F]+}}
# CHECK: Flags [ (0x82000007)
@@ -34,10 +34,10 @@
# CHECK: ]
# CHECK: HeaderSize: 64
# CHECK: ProgramHeaderEntrySize: 56
-# CHECK: ProgramHeaderCount: 5
+# CHECK: ProgramHeaderCount: 6
# CHECK: SectionHeaderEntrySize: 64
-# CHECK: SectionHeaderCount: 11
-# CHECK: StringTableSectionIndex: 8
+# CHECK: SectionHeaderCount: 12
+# CHECK: StringTableSectionIndex: 9
# CHECK: }
# o.o
Modified: lld/trunk/test/elf/Mips/exe-fileheader-micro.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/exe-fileheader-micro.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/exe-fileheader-micro.test (original)
+++ lld/trunk/test/elf/Mips/exe-fileheader-micro.test Thu Jul 30 02:45:55 2015
@@ -23,7 +23,7 @@
# CHECK-NEXT: Type: Executable (0x2)
# CHECK-NEXT: Machine: EM_MIPS (0x8)
# CHECK-NEXT: Version: 1
-# CHECK-NEXT: Entry: 0x400109
+# CHECK-NEXT: Entry: 0x{{[0-9A-F]+[13579bdf]}}
# CHECK-NEXT: ProgramHeaderOffset: 0x{{[0-9A-F]+}}
# CHECK-NEXT: SectionHeaderOffset: 0x{{[0-9A-F]+}}
# CHECK-NEXT: Flags [ (0x72001005)
@@ -35,10 +35,10 @@
# CHECK-NEXT: ]
# CHECK-NEXT: HeaderSize: 52
# CHECK-NEXT: ProgramHeaderEntrySize: 32
-# CHECK-NEXT: ProgramHeaderCount: 5
+# CHECK-NEXT: ProgramHeaderCount: 6
# CHECK-NEXT: SectionHeaderEntrySize: 40
-# CHECK-NEXT: SectionHeaderCount: 11
-# CHECK-NEXT: StringTableSectionIndex: 8
+# CHECK-NEXT: SectionHeaderCount: 12
+# CHECK-NEXT: StringTableSectionIndex: 9
# CHECK-NEXT: }
# o.o
Modified: lld/trunk/test/elf/Mips/got-page-32-micro.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/got-page-32-micro.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/got-page-32-micro.test (original)
+++ lld/trunk/test/elf/Mips/got-page-32-micro.test Thu Jul 30 02:45:55 2015
@@ -11,19 +11,19 @@
# GOT: Symbol {
# GOT: Name: LT3
-# GOT-NEXT: Value: 0x40018D
+# GOT-NEXT: Value: 0x[[LT3:[0-9A-F]+]]
# GOT: Symbol {
# GOT: Name: LT4
-# GOT-NEXT: Value: 0x400191
+# GOT-NEXT: Value: 0x{{[0-9A-F]+}}
# GOT: Symbol {
# GOT: Name: T0
-# GOT-NEXT: Value: 0x40015D
+# GOT-NEXT: Value: 0x{{[0-9A-F]+}}
# GOT: Symbol {
# GOT: Name: LT1
-# GOT-NEXT: Value: 0x400185
+# GOT-NEXT: Value: 0x[[LT1:[0-9A-F]+]]
# GOT: Symbol {
# GOT: Name: LT2
-# GOT-NEXT: Value: 0x400189
+# GOT-NEXT: Value: 0x{{[0-9A-F]+}}
# GOT: Symbol {
# GOT: Name: T1@
# GOT-NEXT: Value: 0x0
@@ -51,7 +51,7 @@
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x401008
# GOT-NEXT: Access: -32744
-# GOT-NEXT: Initial: 0x400185
+# GOT-NEXT: Initial: 0x[[LT1]]
# GOT-NEXT: }
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x40100C
@@ -66,7 +66,7 @@
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x401014
# GOT-NEXT: Access: -32732
-# GOT-NEXT: Initial: 0x40018D
+# GOT-NEXT: Initial: 0x[[LT3]]
# GOT-NEXT: }
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x401018
@@ -108,12 +108,12 @@
# ^ -32736 (PAGE)
# ^ T1 OFST
# ^ T2 OFST
-# RAW-NEXT: {{[0-9a-f]+}} 00008501 00008901 00002480 00002880
+# RAW-NEXT: {{[0-9a-f]+}} 0000a501 0000a901 00002480 00002880
# ^ LT1 OFST
# ^ LT2 OFST
# ^ = -32732 (LT3)
# ^ -32728 (PAGE)
-# RAW-NEXT: {{[0-9a-f]+}} 00009101 00000000
+# RAW-NEXT: {{[0-9a-f]+}} 0000b101 00000000
# ^ LT4 OFST
# so.o
Modified: lld/trunk/test/elf/Mips/got-page-32.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/got-page-32.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/got-page-32.test (original)
+++ lld/trunk/test/elf/Mips/got-page-32.test Thu Jul 30 02:45:55 2015
@@ -10,19 +10,19 @@
# GOT: Symbol {
# GOT: Name: LT3 (12)
-# GOT-NEXT: Value: 0x400184
+# GOT-NEXT: Value: 0x[[LT3:[0-9A-F]+]]
# GOT: Symbol {
# GOT: Name: LT4 (16)
-# GOT-NEXT: Value: 0x400188
+# GOT-NEXT: Value: 0x{{[0-9A-F]+}}
# GOT: Symbol {
# GOT: Name: T0 (1)
-# GOT-NEXT: Value: 0x400154
+# GOT-NEXT: Value: 0x{{[0-9A-F]+}}
# GOT: Symbol {
# GOT: Name: LT1 (4)
-# GOT-NEXT: Value: 0x40017C
+# GOT-NEXT: Value: 0x[[LT1:[0-9A-F]+]]
# GOT: Symbol {
# GOT: Name: LT2 (8)
-# GOT-NEXT: Value: 0x400180
+# GOT-NEXT: Value: 0x{{[0-9A-F]+}}
# GOT: Symbol {
# GOT: Name: T1@ (1)
# GOT-NEXT: Value: 0x0
@@ -50,7 +50,7 @@
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x401008
# GOT-NEXT: Access: -32744
-# GOT-NEXT: Initial: 0x40017C
+# GOT-NEXT: Initial: 0x[[LT1]]
# GOT-NEXT: }
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x40100C
@@ -65,7 +65,7 @@
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x401014
# GOT-NEXT: Access: -32732
-# GOT-NEXT: Initial: 0x400184
+# GOT-NEXT: Initial: 0x[[LT3]]
# GOT-NEXT: }
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x401018
@@ -97,23 +97,23 @@
# GOT-NEXT: }
# RAW: Contents of section .text:
-# RAW-NEXT: 400154 2c800000 18800000 2c800000 30800000
-# ^ = -32724 (T1)
-# ^ = -32744 (LT1)
-# ^ -32724 (T1)
-# ^ -32720 (T2)
-# RAW-NEXT: 400164 1c800000 20800000 00000000 00000000
-# ^ -32740 (PAGE)
-# ^ -32736 (PAGE)
-# ^ T1 OFST
-# ^ T2 OFST
-# RAW-NEXT: 400174 7c010000 80010000 24800000 28800000
-# ^ LT1 OFST
-# ^ LT2 OFST
-# ^ = -32732 (LT3)
-# ^ -32728 (PAGE)
-# RAW-NEXT: 400184 88010000 00000000
-# ^ LT4 OFST
+# RAW-NEXT: {{[0-9a-f]+}} 2c800000 18800000 2c800000 30800000
+# ^ = -32724 (T1)
+# ^ = -32744 (LT1)
+# ^ -32724 (T1)
+# ^ -32720 (T2)
+# RAW-NEXT: {{[0-9a-f]+}} 1c800000 20800000 00000000 00000000
+# ^ -32740 (PAGE)
+# ^ -32736 (PAGE)
+# ^ T1 OFST
+# ^ T2 OFST
+# RAW-NEXT: {{[0-9a-f]+}} 9c010000 a0010000 24800000 28800000
+# ^ LT1 OFST
+# ^ LT2 OFST
+# ^ = -32732 (LT3)
+# ^ -32728 (PAGE)
+# RAW-NEXT: {{[0-9a-f]+}} a8010000 00000000
+# ^ LT4 OFST
# so.o
---
Modified: lld/trunk/test/elf/Mips/got-page-64-micro.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/got-page-64-micro.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/got-page-64-micro.test (original)
+++ lld/trunk/test/elf/Mips/got-page-64-micro.test Thu Jul 30 02:45:55 2015
@@ -11,13 +11,13 @@
# GOT: Symbol {
# GOT: Name: T0
-# GOT-NEXT: Value: 0x1200001F9
+# GOT-NEXT: Value: 0x{{[0-9A-F]+}}
# GOT: Symbol {
# GOT: Name: LT1
-# GOT-NEXT: Value: 0x120000221
+# GOT-NEXT: Value: 0x[[LT1:[0-9A-F]+]]
# GOT: Symbol {
# GOT: Name: LT2
-# GOT-NEXT: Value: 0x120000225
+# GOT-NEXT: Value: 0x{{[0-9A-F]+}}
# GOT: Symbol {
# GOT: Name: T1@
# GOT-NEXT: Value: 0x0
@@ -45,7 +45,7 @@
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x120001010
# GOT-NEXT: Access: -32736
-# GOT-NEXT: Initial: 0x120000221
+# GOT-NEXT: Initial: 0x[[LT1]]
# GOT-NEXT: }
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x120001018
@@ -92,7 +92,7 @@
# ^ -32720 (PAGE)
# ^ T1 OFST
# ^ T2 OFST
-# RAW-NEXT: {{[0-9a-f]+}} 21020000 25020000 00000000 00000000
+# RAW-NEXT: {{[0-9a-f]+}} 59020000 5d020000 00000000 00000000
# ^ LT1 OFST
# ^ LT2 OFST
Modified: lld/trunk/test/elf/Mips/got-page-64.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/got-page-64.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/got-page-64.test (original)
+++ lld/trunk/test/elf/Mips/got-page-64.test Thu Jul 30 02:45:55 2015
@@ -10,13 +10,13 @@
# GOT: Symbol {
# GOT: Name: T0 (1)
-# GOT-NEXT: Value: 0x1200001F0
+# GOT-NEXT: Value: 0x{{[0-9A-F]+}}
# GOT: Symbol {
# GOT: Name: LT1 (4)
-# GOT-NEXT: Value: 0x120000218
+# GOT-NEXT: Value: 0x[[LT1:[0-9A-F]+]]
# GOT: Symbol {
# GOT: Name: LT2 (8)
-# GOT-NEXT: Value: 0x12000021C
+# GOT-NEXT: Value: 0x{{[0-9A-F]+}}
# GOT: Symbol {
# GOT: Name: T1@ (1)
# GOT-NEXT: Value: 0x0
@@ -44,7 +44,7 @@
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x120001010
# GOT-NEXT: Access: -32736
-# GOT-NEXT: Initial: 0x120000218
+# GOT-NEXT: Initial: 0x[[LT1]]
# GOT-NEXT: }
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x120001018
@@ -81,19 +81,19 @@
# GOT-NEXT: }
# RAW: Contents of section .text:
-# RAW-NEXT: 1200001f0 38800000 20800000 38800000 40800000 8... ...8... at ...
-# ^ = -32712 (T1)
-# ^ = -32736 (LT1)
-# ^ -32712 (T1)
-# ^ -32704 (T2)
-# RAW-NEXT: 120000200 28800000 30800000 00000000 00000000 (...0...........
-# ^ -32728 (PAGE)
-# ^ -32720 (PAGE)
-# ^ T1 OFST
-# ^ T2 OFST
-# RAW-NEXT: 120000210 18020000 1c020000 00000000 00000000 ................
-# ^ LT1 OFST
-# ^ LT2 OFST
+# RAW-NEXT: {{[0-9a-f]+}} 38800000 20800000 38800000 40800000
+# ^ = -32712 (T1)
+# ^ = -32736 (LT1)
+# ^ -32712 (T1)
+# ^ -32704 (T2)
+# RAW-NEXT: {{[0-9a-f]+}} 28800000 30800000 00000000 00000000
+# ^ -32728 (PAGE)
+# ^ -32720 (PAGE)
+# ^ T1 OFST
+# ^ T2 OFST
+# RAW-NEXT: {{[0-9a-f]+}} 50020000 54020000 00000000 00000000
+# ^ LT1 OFST
+# ^ LT2 OFST
# so.o
---
Modified: lld/trunk/test/elf/Mips/hilo16-1.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/hilo16-1.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/hilo16-1.test (original)
+++ lld/trunk/test/elf/Mips/hilo16-1.test Thu Jul 30 02:45:55 2015
@@ -1,77 +1,40 @@
+# REQUIRES: mips
+
# Check handling multiple HI16 relocation followed by a single LO16 relocation.
-# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: llvm-mc -arch=mipsel -filetype=obj -o=%t.o %s
# RUN: lld -flavor gnu -target mipsel -e T0 -o %t.exe %t.o
-# RUN: llvm-objdump -s -t %t.exe | FileCheck %s
+# RUN: llvm-objdump -d -t %t.exe | FileCheck %s
-# CHECK: Contents of section .text:
-# CHECK-NEXT: 400110 4000083c 4000083c 4000083c 4000083c
-# CHECK-NEXT: 400120 4200083c 3e00083c 4002083c 40fe083c
-# CHECK-NEXT: 400130 35010885 00000000
+# CHECK: Disassembly of section .text:
+# CHECK-NEXT: T0:
+# CHECK-NEXT: 400180: 40 00 08 3c lui $8, 64
+# CHECK-NEXT: {{[0-9a-f]+}}: 40 00 08 3c lui $8, 64
+# CHECK-NEXT: {{[0-9a-f]+}}: 40 00 08 3c lui $8, 64
+# CHECK-NEXT: {{[0-9a-f]+}}: 40 00 08 3c lui $8, 64
+# CHECK-NEXT: {{[0-9a-f]+}}: 42 00 08 3c lui $8, 66
+# CHECK-NEXT: {{[0-9a-f]+}}: 3e 00 08 3c lui $8, 62
+# CHECK-NEXT: {{[0-9a-f]+}}: 40 02 08 3c lui $8, 576
+# CHECK-NEXT: {{[0-9a-f]+}}: 40 fe 08 3c lui $8, 65088
+# CHECK-NEXT: {{[0-9a-f]+}}: a5 01 08 25 addiu $8, $8, 421
# CHECK: SYMBOL TABLE:
-# CHECK: 00400110 g F .text 00000024 T0
-# CHECK: 00400134 g F .text 00000004 T1
+# CHECK: 00400180 g F .text 00000024 T0
+# CHECK: 004001a4 g F .text 00000004 T1
-FileHeader:
- Class: ELFCLASS32
- Data: ELFDATA2LSB
- Type: ET_REL
- Machine: EM_MIPS
- Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2]
-
-Sections:
-- Name: .text
- Type: SHT_PROGBITS
- Content: "0000083c0000083c0000083c0000083c0200083cfeff083c0002083c00fe083c0100088500000000"
-# ^ %hi(T1+1) ^ %hi(T1+0x1ff) ^ %hi(T1+0x1ffff) ^ %hi(T1-0x1ffffff)
-# ^ %hi(T1-1) ^ %hi(T1-0x1ff) ^ %hi(T1-0x1ffff) ^ %lo(T1-0x1ffffff)
-# ^ %hi(T1+0x1ffffff)
- AddressAlign: 16
- Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
-
-- Name: .rel.text
- Type: SHT_REL
- Info: .text
- AddressAlign: 4
- Relocations:
- - Offset: 0x0
- Symbol: T1
- Type: R_MIPS_HI16
- - Offset: 0x4
- Symbol: T1
- Type: R_MIPS_HI16
- - Offset: 0x8
- Symbol: T1
- Type: R_MIPS_HI16
- - Offset: 0xC
- Symbol: T1
- Type: R_MIPS_HI16
- - Offset: 0x10
- Symbol: T1
- Type: R_MIPS_HI16
- - Offset: 0x14
- Symbol: T1
- Type: R_MIPS_HI16
- - Offset: 0x18
- Symbol: T1
- Type: R_MIPS_HI16
- - Offset: 0x1C
- Symbol: T1
- Type: R_MIPS_HI16
- - Offset: 0x20
- Symbol: T1
- Type: R_MIPS_LO16
-
-Symbols:
- Global:
- - Name: T0
- Section: .text
- Type: STT_FUNC
- Value: 0
- Size: 36
- - Name: T1
- Section: .text
- Type: STT_FUNC
- Value: 36
- Size: 4
+ .text
+ .globl T0
+T0:
+ lui $8, %hi(T1+1)
+ lui $8, %hi(T1-1)
+ lui $8, %hi(T1+0x1ff)
+ lui $8, %hi(T1+(-0x1ff))
+ lui $8, %hi(T1+0x1ffff)
+ lui $8, %hi(T1+(-0x1ffff))
+ lui $8, %hi(T1+0x1ffffff)
+ lui $8, %hi(T1+(-0x1ffffff))
+ addiu $8, $8, %lo(T1+(-0x1ffffff))
+
+ .globl T1
+T1:
+ nop
Modified: lld/trunk/test/elf/Mips/hilo16-2.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/hilo16-2.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/hilo16-2.test (original)
+++ lld/trunk/test/elf/Mips/hilo16-2.test Thu Jul 30 02:45:55 2015
@@ -1,131 +1,70 @@
+# REQUIRES: mips
+
# Check handling of HI16 and LO16 relocations for regular symbol.
#
# R_MIPS_HI16: (AHL + S) - (short)(AHL + S)
# R_MIPS_LO16: AHL + S
# where AHL = (AHI << 16) + ALO
-# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: llvm-mc -arch=mipsel -filetype=obj -o=%t.o %s
# RUN: lld -flavor gnu -target mipsel -e T0 -o %t.exe %t.o
-# RUN: llvm-objdump -s -t %t.exe | FileCheck %s
+# RUN: llvm-objdump -d %t.exe | FileCheck %s
+
+# CHECK: Disassembly of section .text:
+# CHECK-NEXT: T0:
+# CHECK-NEXT: 400180: 40 00 08 3c lui $8, 64
+# CHECK-NEXT: {{[0-9a-f]+}}: c1 01 08 25 addiu $8, $8, 449
+# CHECK-NEXT: {{[0-9a-f]+}}: 40 00 08 3c lui $8, 64
+# CHECK-NEXT: {{[0-9a-f]+}}: bf 01 08 25 addiu $8, $8, 447
+# CHECK-NEXT: {{[0-9a-f]+}}: 40 00 08 3c lui $8, 64
+# CHECK-NEXT: {{[0-9a-f]+}}: bf 03 08 25 addiu $8, $8, 959
+# CHECK-NEXT: {{[0-9a-f]+}}: 40 00 08 3c lui $8, 64
+# CHECK-NEXT: {{[0-9a-f]+}}: c1 ff 08 25 addiu $8, $8, -63
+#
+# CHECK: T1:
+# CHECK-NEXT: 4001a0: 42 00 08 3c lui $8, 66
+# CHECK-NEXT: {{[0-9a-f]+}}: bf 01 08 25 addiu $8, $8, 447
+# CHECK-NEXT: {{[0-9a-f]+}}: 3e 00 08 3c lui $8, 62
+# CHECK-NEXT: {{[0-9a-f]+}}: c1 01 08 25 addiu $8, $8, 449
+# CHECK-NEXT: {{[0-9a-f]+}}: 40 02 08 3c lui $8, 576
+# CHECK-NEXT: {{[0-9a-f]+}}: bf 01 08 25 addiu $8, $8, 447
+# CHECK-NEXT: {{[0-9a-f]+}}: 40 fe 08 3c lui $8, 65088
+# CHECK-NEXT: {{[0-9a-f]+}}: c1 01 08 25 addiu $8, $8, 449
+#
+# CHECK: T2:
+# CHECK-NEXT: 4001c0: 00 00 00 00 nop
-# CHECK: Contents of section .text:
-# CHECK-NEXT: 400110 4000083c 51010885 4000083c 4f010885
-# CHECK-NEXT: 400120 4000083c 4f030885 4000083c 51ff0885
-# CHECK-NEXT: 400130 4200083c 4f010885 3e00083c 51010885
-# CHECK-NEXT: 400140 4002083c 4f010885 40fe083c 51010885
-# CHECK-NEXT: 400150 00000000
-
-# CHECK: SYMBOL TABLE:
-# CHECK: 00400110 g F .text 00000020 T0
-# CHECK: 00400130 g F .text 00000020 T1
-# CHECK: 00400150 g F .text 00000004 T2
-
-FileHeader:
- Class: ELFCLASS32
- Data: ELFDATA2LSB
- Type: ET_REL
- Machine: EM_MIPS
- Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2]
-
-Sections:
-- Name: .text.1
- Type: SHT_PROGBITS
- Content: "0000083c010008850000083cffff08850000083cff0108850000083c01fe0885"
-# ^ %hi(T2+1) ^ %hi(T2-1) ^ %hi(T2+0x1ff) ^ %hi(T2-0x1ff)
-# ^ %lo(T2+1) ^ %lo(T2-1) ^ %lo(T2+0x1ff) ^ %lo(T2-0x1ff)
- AddressAlign: 16
- Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
-
-- Name: .rel.text.1
- Type: SHT_REL
- Info: .text.1
- AddressAlign: 4
- Relocations:
- - Offset: 0x0
- Symbol: T2
- Type: R_MIPS_HI16
- - Offset: 0x4
- Symbol: T2
- Type: R_MIPS_LO16
- - Offset: 0x8
- Symbol: T2
- Type: R_MIPS_HI16
- - Offset: 0xC
- Symbol: T2
- Type: R_MIPS_LO16
- - Offset: 0x10
- Symbol: T2
- Type: R_MIPS_HI16
- - Offset: 0x14
- Symbol: T2
- Type: R_MIPS_LO16
- - Offset: 0x18
- Symbol: T2
- Type: R_MIPS_HI16
- - Offset: 0x1C
- Symbol: T2
- Type: R_MIPS_LO16
-
-- Name: .text.2
- Type: SHT_PROGBITS
- Content: "0200083cffff0885feff083c010008850002083cffff088500fe083c01000885"
-# ^ %hi(T2+0x1ffff) ^ %hi(T2+0x1ffffff)
-# ^ %lo(T2+0x1ffff) ^ %lo(T2+0x1ffffff)
-# ^ %hi(T2-0x1ffff) ^ %hi(T2-0x1ffffff)
-# ^ %lo(T2-0x1ffff) ^ %lo(T2-0x1ffffff)
- AddressAlign: 16
- Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
-
-- Name: .rel.text.2
- Type: SHT_REL
- Info: .text.2
- AddressAlign: 4
- Relocations:
- - Offset: 0x0
- Symbol: T2
- Type: R_MIPS_HI16
- - Offset: 0x4
- Symbol: T2
- Type: R_MIPS_LO16
- - Offset: 0x8
- Symbol: T2
- Type: R_MIPS_HI16
- - Offset: 0xC
- Symbol: T2
- Type: R_MIPS_LO16
- - Offset: 0x10
- Symbol: T2
- Type: R_MIPS_HI16
- - Offset: 0x14
- Symbol: T2
- Type: R_MIPS_LO16
- - Offset: 0x18
- Symbol: T2
- Type: R_MIPS_HI16
- - Offset: 0x1C
- Symbol: T2
- Type: R_MIPS_LO16
-
-- Name: .text.3
- Type: SHT_PROGBITS
- Content: "00000000"
- AddressAlign: 16
- Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
-
-Symbols:
- Global:
- - Name: T0
- Section: .text.1
- Type: STT_FUNC
- Value: 0
- Size: 64
- - Name: T1
- Section: .text.2
- Type: STT_FUNC
- Value: 0
- Size: 64
- - Name: T2
- Section: .text.3
- Type: STT_FUNC
- Value: 0
- Size: 4
+ .section .text.1,"ax", at progbits
+ .align 4
+ .globl T0
+T0:
+ lui $8, %hi(T2+1)
+ addiu $8, $8, %lo(T2+1)
+ lui $8, %hi(T2+(-1))
+ addiu $8, $8, %lo(T2+(-1))
+ lui $8, %hi(T2+0x1ff)
+ addiu $8, $8, %lo(T2+0x1ff)
+ lui $8, %hi(T2+(-0x1ff))
+ addiu $8, $8, %lo(T2+(-0x1ff))
+ .size T0, .-T0
+
+ .section .text.2,"ax", at progbits
+ .align 4
+ .globl T1
+T1:
+ lui $8, %hi(T2+0x1ffff)
+ addiu $8, $8, %lo(T2+0x1ffff)
+ lui $8, %hi(T2+(-0x1ffff))
+ addiu $8, $8, %lo(T2+(-0x1ffff))
+ lui $8, %hi(T2+0x1ffffff)
+ addiu $8, $8, %lo(T2+0x1ffffff)
+ lui $8, %hi(T2+(-0x1ffffff))
+ addiu $8, $8, %lo(T2+(-0x1ffffff))
+ .size T1, .-T1
+
+ .section .text.3,"ax", at progbits
+ .align 4
+ .globl T2
+T2:
+ nop
+ .size T2, .-T2
Modified: lld/trunk/test/elf/Mips/hilo16-8-micro.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/hilo16-8-micro.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/hilo16-8-micro.test (original)
+++ lld/trunk/test/elf/Mips/hilo16-8-micro.test Thu Jul 30 02:45:55 2015
@@ -1,159 +1,81 @@
+# REQUIRES: mips
+
# Check calculation of AHL addendums for R_MICROMIPS_HI16 / R_MICROMIPS_LO16
# relocations for a regular symbol.
-# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: llvm-mc -arch=mipsel -filetype=obj -mattr=micromips -o=%t.o %s
# RUN: lld -flavor gnu -target mipsel -e T0 -o %t.exe %t.o
-# RUN: llvm-objdump -s -t %t.exe | FileCheck %s
+# RUN: llvm-objdump -d -mattr=micromips %t.exe | FileCheck %s
-# CHECK: Contents of section .text:
-# CHECK-NEXT: 400110 a8414000 083d5201 a8414100 083d5081
-# CHECK-NEXT: 400120 a8414100 083dd181 a8414200 083d5181
-# CHECK-NEXT: 400130 a8414040 083d5101 a8414080 083d5101
-# CHECK-NEXT: 400140 a841c180 083dd181 00000000 00000000
-# CHECK-NEXT: 400150 a8414000 a8414000 a8414100 a8414200
-# CHECK-NEXT: 400160 a8414040 a8414080 a841c180 083d9181
-
-# CHECK: SYMBOL TABLE:
-# CHECK: 00400110 g F .text 00000020 T0
-# CHECK: 00400130 g F .text 00000018 T1
-# CHECK: 00400150 g F .text 00000020 T2
-
-FileHeader:
- Class: ELFCLASS32
- Data: ELFDATA2LSB
- Type: ET_REL
- Machine: EM_MIPS
- Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2, EF_MIPS_MICROMIPS]
-
-Sections:
-- Name: .text.1
- Type: SHT_PROGBITS
- Content: "A8410000083D0100A8410000083DFF7FA8410100083D8080A8410200083D0080"
-# ^ %hi(T2+1) ^ %hi(T2+0x7fff) ^ %lo(T2+0x8080)
-# ^ %lo(T2+1) ^ %lo(T2+0x7fff) ^ %hi(T2+0x18000)
-# ^ %hi(T2+0x8080) ^ %lo(T2+0x18000)
- AddressAlign: 16
- Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
-
-- Name: .rel.text.1
- Type: SHT_REL
- Info: .text.1
- AddressAlign: 4
- Relocations:
- - Offset: 0x0
- Symbol: T2
- Type: R_MICROMIPS_HI16
- - Offset: 0x4
- Symbol: T2
- Type: R_MICROMIPS_LO16
- - Offset: 0x8
- Symbol: T2
- Type: R_MICROMIPS_HI16
- - Offset: 0xC
- Symbol: T2
- Type: R_MICROMIPS_LO16
- - Offset: 0x10
- Symbol: T2
- Type: R_MICROMIPS_HI16
- - Offset: 0x14
- Symbol: T2
- Type: R_MICROMIPS_LO16
- - Offset: 0x18
- Symbol: T2
- Type: R_MICROMIPS_HI16
- - Offset: 0x1C
- Symbol: T2
- Type: R_MICROMIPS_LO16
-
-- Name: .text.2
- Type: SHT_PROGBITS
- Content: "A8410040083D0000A8410080083D0000A8418180083D8080"
-# ^ %hi(T2+0x40000000) ^ %lo(T2+0x80000000)
-# ^ %lo(T2+0x40000000) ^ %hi(T2+0x80808080)
-# ^ %hi(T2+0x80000000) ^ %lo(T2+0x80808080)
- AddressAlign: 16
- Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
-
-- Name: .rel.text.2
- Type: SHT_REL
- Info: .text.2
- AddressAlign: 4
- Relocations:
- - Offset: 0x0
- Symbol: T2
- Type: R_MICROMIPS_HI16
- - Offset: 0x4
- Symbol: T2
- Type: R_MICROMIPS_LO16
- - Offset: 0x8
- Symbol: T2
- Type: R_MICROMIPS_HI16
- - Offset: 0xC
- Symbol: T2
- Type: R_MICROMIPS_LO16
- - Offset: 0x10
- Symbol: T2
- Type: R_MICROMIPS_HI16
- - Offset: 0x14
- Symbol: T2
- Type: R_MICROMIPS_LO16
-
-- Name: .text.3
- Type: SHT_PROGBITS
- Content: "A8410000A8410000A8410100A8410200A8410040A8410080A8418180083D8080"
-# ^ %hi(T0+0x1) ^ %hi(T0+0x8080) ^ %hi(T0+0x80000000)
-# ^ %hi(T0+0x7fff) ^ %hi(T0+0x40000000) ^ %lo(T0+0x80808080)
-# ^ %hi(T0+0x18000) ^ %hi(T0+0x80808080)
- AddressAlign: 16
- Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
-
-- Name: .rel.text.3
- Type: SHT_REL
- Info: .text.3
- AddressAlign: 4
- Relocations:
- - Offset: 0x0
- Symbol: T0
- Type: R_MICROMIPS_HI16
- - Offset: 0x4
- Symbol: T0
- Type: R_MICROMIPS_HI16
- - Offset: 0x8
- Symbol: T0
- Type: R_MICROMIPS_HI16
- - Offset: 0xC
- Symbol: T0
- Type: R_MICROMIPS_HI16
- - Offset: 0x10
- Symbol: T0
- Type: R_MICROMIPS_HI16
- - Offset: 0x14
- Symbol: T0
- Type: R_MICROMIPS_HI16
- - Offset: 0x18
- Symbol: T0
- Type: R_MICROMIPS_HI16
- - Offset: 0x1C
- Symbol: T0
- Type: R_MICROMIPS_LO16
-
-Symbols:
- Global:
- - Name: T0
- Section: .text.1
- Type: STT_FUNC
- Value: 0
- Size: 32
- Other: [STO_MIPS_MICROMIPS]
- - Name: T1
- Section: .text.2
- Type: STT_FUNC
- Value: 0
- Size: 24
- Other: [STO_MIPS_MICROMIPS]
- - Name: T2
- Section: .text.3
- Type: STT_FUNC
- Value: 0
- Size: 32
- Other: [STO_MIPS_MICROMIPS]
+# CHECK: Disassembly of section .text:
+# CHECK-NEXT: T0:
+# CHECK-NEXT: 400180: a8 41 40 00 lui $8, 64
+# CHECK-NEXT: 400184: 08 31 c1 01 addiu $8, $8, 449
+# CHECK-NEXT: 400188: a8 41 41 00 lui $8, 65
+# CHECK-NEXT: 40018c: 08 31 bf 81 addiu $8, $8, -32321
+# CHECK-NEXT: 400190: a8 41 41 00 lui $8, 65
+# CHECK-NEXT: 400194: 08 31 40 82 addiu $8, $8, -32192
+# CHECK-NEXT: 400198: a8 41 42 00 lui $8, 66
+# CHECK-NEXT: 40019c: 08 31 c0 81 addiu $8, $8, -32320
+#
+# CHECK: T1:
+# CHECK-NEXT: 4001a0: a8 41 40 40 lui $8, 16448
+# CHECK-NEXT: 4001a4: 08 31 c0 01 addiu $8, $8, 448
+# CHECK-NEXT: 4001a8: a8 41 40 80 lui $8, 32832
+# CHECK-NEXT: 4001ac: 08 31 c0 01 addiu $8, $8, 448
+# CHECK-NEXT: 4001b0: a8 41 c1 80 lui $8, 32961
+# CHECK-NEXT: 4001b4: 08 31 40 82 addiu $8, $8, -32192
+# CHECK-NEXT: 4001b8: 00 00 00 00 nop
+# CHECK-NEXT: 4001bc: 00 00 00 00 nop
+#
+# CHECK: T2:
+# CHECK-NEXT: 4001c0: 00 00 00 00 nop
+# CHECK-NEXT: 4001c4: a8 41 40 00 lui $8, 64
+# CHECK-NEXT: 4001c8: a8 41 40 00 lui $8, 64
+# CHECK-NEXT: 4001cc: a8 41 41 00 lui $8, 65
+# CHECK-NEXT: 4001d0: a8 41 42 00 lui $8, 66
+# CHECK-NEXT: 4001d4: a8 41 40 40 lui $8, 16448
+# CHECK-NEXT: 4001d8: a8 41 40 80 lui $8, 32832
+# CHECK-NEXT: 4001dc: a8 41 c1 80 lui $8, 32961
+# CHECK-NEXT: 4001e0: 08 31 00 82 addiu $8, $8, -32256
+
+ .section .text.1,"ax", at progbits
+ .align 4
+ .globl T0
+T0:
+ lui $8, %hi(T2+1)
+ addiu $8, $8, %lo(T2+1)
+ lui $8, %hi(T2+0x7fff)
+ addiu $8, $8, %lo(T2+0x7fff)
+ lui $8, %hi(T2+0x8080)
+ addiu $8, $8, %lo(T2+0x8080)
+ lui $8, %hi(T2+0x18000)
+ addiu $8, $8, %lo(T2+0x18000)
+ .size T0, .-T0
+
+ .section .text.2,"ax", at progbits
+ .align 4
+ .globl T1
+T1:
+ lui $8, %hi(T2+0x40000000)
+ addiu $8, $8, %lo(T2+0x40000000)
+ lui $8, %hi(T2+0x80000000)
+ addiu $8, $8, %lo(T2+0x80000000)
+ lui $8, %hi(T2+0x80808080)
+ addiu $8, $8, %lo(T2+0x80808080)
+ .size T1, .-T1
+
+ .section .text.3,"ax", at progbits
+ .align 4
+ .globl T2
+T2:
+ nop
+ lui $8, %hi(T0+0x1)
+ lui $8, %hi(T0+0x7fff)
+ lui $8, %hi(T0+0x8080)
+ lui $8, %hi(T0+0x18000)
+ lui $8, %hi(T0+0x40000000)
+ lui $8, %hi(T0+0x80000000)
+ lui $8, %hi(T0+0x80808080)
+ addiu $8, $8, %lo(T0+0x80808080)
+ .size T2, .-T2
Modified: lld/trunk/test/elf/Mips/jalx.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/jalx.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/jalx.test (original)
+++ lld/trunk/test/elf/Mips/jalx.test Thu Jul 30 02:45:55 2015
@@ -6,12 +6,12 @@
# RUN: llvm-nm %t.exe | FileCheck -check-prefix=SYM %s
# RAW: Contents of section .text:
-# RAW-NEXT: 400110 00000000 44001074 10f04500 46001074
+# RAW-NEXT: 400130 00000000 4c001074 10f04d00 4e001074
-# SYM: 00400118 T M1
-# SYM: 00400110 T M2
-# SYM: 0040011c T T1
-# SYM: 00400114 T T2
+# SYM: 00400138 T M1
+# SYM: 00400130 T M2
+# SYM: 0040013c T T1
+# SYM: 00400134 T T2
FileHeader:
Class: ELFCLASS32
Modified: lld/trunk/test/elf/Mips/la25-stub-be.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/la25-stub-be.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/la25-stub-be.test (original)
+++ lld/trunk/test/elf/Mips/la25-stub-be.test Thu Jul 30 02:45:55 2015
@@ -9,10 +9,10 @@
# RUN: llvm-objdump -disassemble %t.exe | FileCheck %s
-# CHECK: 400150: 3c 19 00 40 lui $25, 64
-# CHECK-NEXT: 400154: 08 10 00 48 j 4194592
-# CHECK-NEXT: 400158: 27 39 01 20 addiu $25, $25, 288
-# CHECK-NEXT: 40015c: 00 00 00 00 nop
+# CHECK: 400170: 3c 19 00 40 lui $25, 64
+# CHECK-NEXT: 400174: 08 10 00 50 j 4194624
+# CHECK-NEXT: 400178: 27 39 01 40 addiu $25, $25, 320
+# CHECK-NEXT: 40017c: 00 00 00 00 nop
# npic.o
---
Modified: lld/trunk/test/elf/Mips/la25-stub-micro-be.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/la25-stub-micro-be.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/la25-stub-micro-be.test (original)
+++ lld/trunk/test/elf/Mips/la25-stub-micro-be.test Thu Jul 30 02:45:55 2015
@@ -9,10 +9,10 @@
# RUN: llvm-objdump -disassemble -mattr=micromips %t.exe | FileCheck %s
-# CHECK: 400150: 41 be 00 40 lui $fp, 64
-# CHECK-NEXT: 400154: d4 20 00 90 j 4194592
-# CHECK-NEXT: 400158: 33 39 01 21 addiu $25, $25, 289
-# CHECK-NEXT: 40015c: 00 00 00 00 nop
+# CHECK: 400170: 41 be 00 40 lui $fp, 64
+# CHECK-NEXT: 400174: d4 20 00 a0 j 4194624
+# CHECK-NEXT: 400178: 33 39 01 41 addiu $25, $25, 321
+# CHECK-NEXT: 40017c: 00 00 00 00 nop
---
FileHeader:
Modified: lld/trunk/test/elf/Mips/la25-stub-micro.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/la25-stub-micro.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/la25-stub-micro.test (original)
+++ lld/trunk/test/elf/Mips/la25-stub-micro.test Thu Jul 30 02:45:55 2015
@@ -8,29 +8,25 @@
# RUN: lld -flavor gnu -target mipsel -e glob -o %t.exe \
# RUN: %t-npic.o %t-pic.o %t-main.o
-# RUN: llvm-readobj -t %t.exe | FileCheck -check-prefix=SYM %s
+# RUN: llvm-nm %t.exe | FileCheck -check-prefix=SYM %s
# RUN: llvm-objdump -s %t.exe | FileCheck -check-prefix=ASM %s
-# SYM: Name: loc (13)
-# SYM-NEXT: Value: 0x400135
-# SYM: Name: T1N (1)
-# SYM-NEXT: Value: 0x400111
-# SYM: Name: T1 (5)
-# SYM-NEXT: Value: 0x400121
-# SYM: Name: glob (8)
-# SYM-NEXT: Value: 0x400125
+# SYM: 00400140 T T1
+# SYM: 00400130 T T1N
+# SYM: 00400144 T glob
+# SYM: 00400154 t loc
# ASM: Contents of section .text:
-# ASM-NEXT: 400110 00000000 00000000 00000000 00000000
-# ASM-NEXT: 400120 00000000 00000000 00000000 10f04900
-# 0x100049 << 2 == 0x400125 (jalx glob) --^
-# ASM-NEXT: 400130 00000000 20f49200 00000000 20f48800
-# ^-- 0x100049 << 2 == 0x400124 (jal glob)
-# 0x100044 << 2 == 0x400110 (jal T1N) --^
-# ASM-NEXT: 400140 00000000 20f4a800 00000000 00000000
-# ^-- 0x100054 << 2 == 0x400150 (jal T1 stub)
-# ASM-NEXT: 400150 b9414000 20d49000 39332101 00000000
-# ^-- j 0x400120 (T1)
+# ASM-NEXT: 400130 00000000 00000000 00000000 00000000
+# ASM-NEXT: 400140 00000000 00000000 00000000 10f05100
+# 0x100055 << 2 == 0x400154 (jalx glob) --^
+# ASM-NEXT: 400150 00000000 20f4a200 00000000 20f49800
+# ^-- 0x100055 << 2 == 0x400154 (jal glob)
+# 0x10004c << 2 == 0x400130 (jal T1N) --^
+# ASM-NEXT: 400160 00000000 20f4b800 00000000 00000000
+# ^-- 0x100054 << 2 == 0x400170 (jal T1 stub)
+# ASM-NEXT: 400170 b9414000 20d4a000 39334101 00000000
+# ^-- j 0x400140 (T1)
# npic.o
---
Modified: lld/trunk/test/elf/Mips/la25-stub-npic-01.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/la25-stub-npic-01.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/la25-stub-npic-01.test (original)
+++ lld/trunk/test/elf/Mips/la25-stub-npic-01.test Thu Jul 30 02:45:55 2015
@@ -11,26 +11,26 @@
# CHECK-NOT: Contents of section .plt:
# CHECK: Contents of section .text:
-# CHECK-NEXT: 400110 54001000 0f000000 0e000000 0d000000
-# ^ T0 ^ .pic.T1 (0x400150)
-# ^ 0x400114 + 0x3c = 0x400150
+# CHECK-NEXT: 400130 5c001000 0f000000 0e000000 0d000000
+# ^ T0 ^ .pic.T1 (0x400170)
+# ^ 0x400134 + 0x3c = 0x400170
# ^ ...
-# CHECK-NEXT: 400120 2000b000 1e000000 1c000000 00001a00
+# CHECK-NEXT: 400140 2000c000 1e000000 1c000000 00001a00
# ^ T3 ^ .pic.T2
# ^ ...
-# CHECK-NEXT: 400130 00000c00 00000000 00000000 00000000
-# CHECK-NEXT: 400140 00000000 00000000 00000000 00000000
+# CHECK-NEXT: 400150 00000c00 00000000 00000000 00000000
+# CHECK-NEXT: 400160 00000000 00000000 00000000 00000000
# ^ T1 ^ T2
-# CHECK-NEXT: 400150 4000193c 50001008 40013927 00000000
+# CHECK-NEXT: 400170 4000193c 58001008 60013927 00000000
# ^ .pic.T1
-# CHECK-NEXT: 400160 b9414000 20d4a200 39334501 00000000
+# CHECK-NEXT: 400180 b9414000 20d4b200 39336501 00000000
# ^ .pic.T2
# CHECK: SYMBOL TABLE:
-# CHECK: 00400110 g F .text 00000010 T0
-# CHECK: 00400120 g F .text 00000014 T3
-# CHECK: 00400140 g F .text 00000004 T1
-# CHECK: 00400144 g F .text 00000004 T2
+# CHECK: 00400130 g F .text 00000010 T0
+# CHECK: 00400140 g F .text 00000014 T3
+# CHECK: 00400160 g F .text 00000004 T1
+# CHECK: 00400164 g F .text 00000004 T2
# pic.o
---
Modified: lld/trunk/test/elf/Mips/la25-stub-npic-02.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/la25-stub-npic-02.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/la25-stub-npic-02.test (original)
+++ lld/trunk/test/elf/Mips/la25-stub-npic-02.test Thu Jul 30 02:45:55 2015
@@ -10,21 +10,21 @@
# CHECK-NOT: Contents of section .plt:
# CHECK: Contents of section .text:
-# CHECK-NEXT: 400110 00000000 00000000 50001000 09000000
-# ^ T1 ^ T2 ^ .pic.T1 (0x400140)
-# CHECK-NEXT: 400120 08000000 07000000 2000a800 12000000
-# ^ .pic.T2 (0x400150)
-# CHECK-NEXT: 400130 10000000 00000e00 00000600 00000000
-# CHECK-NEXT: 400140 4000193c 44001008 10013927 00000000
+# CHECK-NEXT: 400130 00000000 00000000 58001000 09000000
+# ^ T1 ^ T2 ^ .pic.T1 (0x400160)
+# CHECK-NEXT: 400140 08000000 07000000 2000b800 12000000
+# ^ .pic.T2 (0x400170)
+# CHECK-NEXT: 400150 10000000 00000e00 00000600 00000000
+# CHECK-NEXT: 400160 4000193c 4c001008 30013927 00000000
# ^ .pic.T1
-# CHECK-NEXT: 400150 b9414000 20d48a00 39331501 00000000
+# CHECK-NEXT: 400170 b9414000 20d49a00 39333501 00000000
# ^ .pic.T2
# CHECK: SYMBOL TABLE:
-# CHECK: 00400110 g F .text 00000004 T1
-# CHECK: 00400114 g F .text 00000004 T2
-# CHECK: 00400118 g F .text 00000010 T0
-# CHECK: 00400128 g F .text 00000014 T3
+# CHECK: 00400130 g F .text 00000004 T1
+# CHECK: 00400134 g F .text 00000004 T2
+# CHECK: 00400138 g F .text 00000010 T0
+# CHECK: 00400148 g F .text 00000014 T3
# 1.o
---
Modified: lld/trunk/test/elf/Mips/la25-stub-pic.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/la25-stub-pic.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/la25-stub-pic.test (original)
+++ lld/trunk/test/elf/Mips/la25-stub-pic.test Thu Jul 30 02:45:55 2015
@@ -10,17 +10,17 @@
# CHECK-NOT: Contents of section .plt:
# CHECK: Contents of section .text:
-# CHECK-NEXT: 400110 00000000 00000000 44001000 fdff0000
-# ^ T1 ^ T2 ^ T1 (0x400110)
-# ^ 0x40011c - 12 = 0x0x400110
-# CHECK-NEXT: 400120 fcff1f00 fbffff03 20008a00 74000000
-# ^ T2 (0x400114)
+# CHECK-NEXT: 400130 00000000 00000000 4c001000 fdff0000
+# ^ T1 ^ T2 ^ T1 (0x400130)
+# ^ 0x40013c - 12 = 0x0x400130
+# CHECK-NEXT: 400140 fcff1f00 fbffff03 20009a00 74000000
+# ^ T2 (0x400134)
# CHECK: SYMBOL TABLE:
-# CHECK: 00400110 g F .text 00000004 T1
-# CHECK: 00400114 g F .text 00000004 T2
-# CHECK: 00400118 g F .text 00000010 T0
-# CHECK: 00400128 g F .text 00000014 T3
+# CHECK: 00400130 g F .text 00000004 T1
+# CHECK: 00400134 g F .text 00000004 T2
+# CHECK: 00400138 g F .text 00000010 T0
+# CHECK: 00400148 g F .text 00000014 T3
# pic.o
---
Modified: lld/trunk/test/elf/Mips/la25-stub.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/la25-stub.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/la25-stub.test (original)
+++ lld/trunk/test/elf/Mips/la25-stub.test Thu Jul 30 02:45:55 2015
@@ -11,25 +11,25 @@
# RUN: llvm-objdump -s %t.exe | FileCheck -check-prefix=ASM %s
# SYM: Name: loc (13)
-# SYM-NEXT: Value: 0x400134
+# SYM-NEXT: Value: 0x400154
# SYM: Name: T1N (1)
-# SYM-NEXT: Value: 0x400110
+# SYM-NEXT: Value: 0x400130
# SYM: Name: T1 (5)
-# SYM-NEXT: Value: 0x400120
+# SYM-NEXT: Value: 0x400140
# SYM: Name: glob (8)
-# SYM-NEXT: Value: 0x400124
+# SYM-NEXT: Value: 0x400144
# ASM: Contents of section .text:
-# ASM-NEXT: 400110 00000000 00000000 00000000 00000000
-# ASM-NEXT: 400120 00000000 00000000 00000000 49001000
-# 0x100049 << 2 == 0x400124 (glob) --^
-# ASM-NEXT: 400130 00000000 49001000 00000000 44001000
-# ^-- 0x100049 << 2 == 0x400124 (glob)
+# ASM-NEXT: 400130 00000000 00000000 00000000 00000000
+# ASM-NEXT: 400140 00000000 00000000 00000000 51001000
+# 0x100051 << 2 == 0x400144 (glob) --^
+# ASM-NEXT: 400150 00000000 51001000 00000000 4c001000
+# ^-- 0x100051 << 2 == 0x400144 (glob)
# 0x100044 << 2 == 0x400110 (T1N) --^
-# ASM-NEXT: 400140 00000000 54001000 00000000 00000000
-# ^-- 0x100054 << 2 == 0x400150 (T1 stub)
-# ASM-NEXT: 400150 4000193c 48001008 20013927 00000000
-# ^-- j 0x400120 (T1)
+# ASM-NEXT: 400160 00000000 5c001000 00000000 00000000
+# ^-- 0x10005c << 2 == 0x400170 (T1 stub)
+# ASM-NEXT: 400170 4000193c 50001008 40013927 00000000
+# ^-- j 0x400140 (T1)
# npic.o
---
Modified: lld/trunk/test/elf/Mips/n64-rel-chain.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/n64-rel-chain.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/n64-rel-chain.test (original)
+++ lld/trunk/test/elf/Mips/n64-rel-chain.test Thu Jul 30 02:45:55 2015
@@ -15,11 +15,11 @@
# SYM-NEXT: Flags [
# SYM-NEXT: SHF_ALLOC
# SYM-NEXT: ]
-# SYM-NEXT: Address: 0x1200001F0
+# SYM-NEXT: Address: 0x120000230
#
# SYM: Symbol {
# SYM: Name: LT1
-# SYM-NEXT: Value: 0x1200001D0
+# SYM-NEXT: Value: 0x120000210
# SYM-NEXT: Size: 16
# SYM-NEXT: Binding: Global
# SYM-NEXT: Type: Function
@@ -28,7 +28,7 @@
# SYM-NEXT: }
# SYM: Symbol {
# SYM: Name: T0
-# SYM-NEXT: Value: 0x1200001E0
+# SYM-NEXT: Value: 0x120000220
# SYM-NEXT: Size: 16
# SYM-NEXT: Binding: Global
# SYM-NEXT: Type: Function
@@ -48,14 +48,14 @@
# SYM: Canonical gp value: 0x120008FF0
# SYM: Local entries [
# SYM-NEXT: Entry {
-# SYM-NEXT: Address: 0x120001010
+# SYM-NEXT: Address: 0x{{[0-9A-F]+}}
# SYM-NEXT: Access: -32736
# SYM-NEXT: Initial: 0x120000000
# SYM-NEXT: }
# SYM-NEXT: ]
# SYM-NEXT: Global entries [
# SYM-NEXT: Entry {
-# SYM-NEXT: Address: 0x120001018
+# SYM-NEXT: Address: 0x{{[0-9A-F]+}}
# SYM-NEXT: Access: -32728
# SYM-NEXT: Initial: 0x0
# SYM-NEXT: Value: 0x0
@@ -66,21 +66,21 @@
# SYM-NEXT: ]
# RAW: Contents of section .text:
-# RAW-NEXT: 1200001d0 01000000 00000000 208e0000 00000000
+# RAW-NEXT: 120000210 01000000 00000000 e08d0000 00000000
# ^
-# S - GP = 0x1200001d0 - 0x120008ff0 = -36384
-# S - A = 0 - (-36384) = 36384
+# S - GP = 0x120000210 - 0x120008ff0 = -36320
+# S - A = 0 - (-36320) = 36320
# (AHL + S + 0x8000) >> 16 = 1
# ^
-# S - GP = 0x1200001d0 - 0x120008ff0 = -36384
-# S - A = 0 - (-36384) = 36384
-# AHL + S = 0x8E20
-# RAW-NEXT: 1200001e0 20800000 f8010000 28800000 00000000
+# S - GP = 0x120000210 - 0x120008ff0 = -36320
+# S - A = 0 - (-36320) = 36320
+# AHL + S = 0x8DE0
+# RAW-NEXT: 120000220 20800000 38020000 28800000 00000000
# ^ 0x8020 = -32736 GOT
-# ^ (0x1200001F0 + 8 - page) = 0x1f8
+# ^ (0x120000230 + 8 - page) = 0x238
# ^ 0x8028 = -32728
# RAW: Contents of section .pdr:
-# RAW-NEXT: 0000 d0010020 e0010020
+# RAW-NEXT: 0000 10020020 20020020
---
FileHeader:
Modified: lld/trunk/test/elf/Mips/r26-2-micro.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/r26-2-micro.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/r26-2-micro.test (original)
+++ lld/trunk/test/elf/Mips/r26-2-micro.test Thu Jul 30 02:45:55 2015
@@ -1,88 +1,31 @@
# REQUIRES: mips
# Check reading addendum for R_MICROMIPS_26_S1 relocation.
-# RUN: yaml2obj -format=elf %s > %t-obj
-# RUN: lld -flavor gnu -target mipsel -o %t-exe %t-obj
-# RUN: llvm-objdump -d -mattr=micromips %t-exe | FileCheck -check-prefix=DIS %s
-# RUN: llvm-objdump -t %t-exe | FileCheck %s
+# RUN: llvm-mc -arch=mipsel -filetype=obj -mattr=micromips -o=%t.o %s
+# RUN: lld -flavor gnu -target mipsel -o %t.exe %t.o
+# RUN: llvm-objdump -d -mattr=micromips %t.exe | FileCheck %s
+
+# CHECK: Disassembly of section .text:
+# CHECK-NEXT: __start:
+# CHECK-NEXT: 400180: 10 f0 60 70 jalx 2154688
+# CHECK-NEXT: 400184: 00 00 00 00 nop
+# CHECK-NEXT: 400188: 10 f0 68 70 jalx 2154704
+# CHECK-NEXT: 40018c: 00 00 00 00 nop
+# CHECK-NEXT: 400190: 10 f0 58 00 jalx 2097328
+# CHECK-NEXT: 400194: 00 00 00 00 nop
+# CHECK-NEXT: 400198: 10 f0 62 00 jalx 2097348
+# CHECK-NEXT: 40019c: 00 00 00 00 nop
+#
+# CHECK: loc:
+# CHECK-NEXT: 4001a0: 00 00 00 00 nop
+
+ .text
+ .globl __start
+__start:
+ jal __start + 0x1C000
+ jal loc + 0x1C000
+ jal __start + 0x7ffffe2
+ jal loc + 0x7ffffea
-# DIS: Disassembly of section .text:
-# DIS-NEXT: loc0:
-# DIS-NEXT: 400110: 00 00 00 00 nop
-
-# DIS: __start:
-# DIS-NEXT: 400114: 20 f4 8e e0 jal 4309276
-# DIS-NEXT: 400118: 00 00 00 00 nop
-# DIS-NEXT: 40011c: 20 f4 9a e0 jal 4309300
-# DIS-NEXT: 400120: 00 00 00 00 nop
-
-# DIS: loc1:
-# DIS-NEXT: 400124: 20 f4 89 00 jal 4194578
-# DIS-NEXT: 400128: 00 00 00 00 nop
-# DIS-NEXT: 40012c: 20 f4 91 00 jal 4194594
-# DIS-NEXT: 400130: 00 00 00 00 nop
-
-# CHECK: SYMBOL TABLE:
-# CHECK: 00400124 l F .text 00000010 loc1
-# CHECK: 00400114 g F .text 00000010 __start
-
-!ELF
-FileHeader: !FileHeader
- Class: ELFCLASS32
- Data: ELFDATA2LSB
- Type: ET_REL
- Machine: EM_MIPS
- Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2, EF_MIPS_MICROMIPS]
-
-Sections:
-- Name: .text
- Type: SHT_PROGBITS
-# nop
-# jal __start + 0x1C000
-# nop
-# jal loc + 0x1C000
-# nop
-# jal __start + 7FFFFE2
-# nop
-# jal loc + 7FFFFEA
-# nop
- Content: "0000000000f404e00000000000f408e000000000FFF7FFFF00000000FFF7FFFF00000000"
- AddressAlign: 16
- Flags: [SHF_EXECINSTR, SHF_ALLOC]
-
-- Name: .rel.text
- Type: SHT_REL
- Info: .text
- AddressAlign: 4
- Relocations:
- - Offset: 0x4
- Symbol: __start
- Type: R_MICROMIPS_26_S1
- - Offset: 0xC
- Symbol: loc1
- Type: R_MICROMIPS_26_S1
- - Offset: 0x14
- Symbol: __start
- Type: R_MICROMIPS_26_S1
- - Offset: 0x1C
- Symbol: loc1
- Type: R_MICROMIPS_26_S1
-
-Symbols:
- Global:
- - Name: __start
- Section: .text
- Value: 0x4
- Size: 8
- Other: [ STO_MIPS_MICROMIPS ]
- Local:
- - Name: loc0
- Section: .text
- Value: 0
- Size: 4
- Other: [ STO_MIPS_MICROMIPS ]
- - Name: loc1
- Section: .text
- Value: 0x14
- Size: 8
- Other: [ STO_MIPS_MICROMIPS ]
+loc:
+ nop
Modified: lld/trunk/test/elf/Mips/r26-2.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/r26-2.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/r26-2.test (original)
+++ lld/trunk/test/elf/Mips/r26-2.test Thu Jul 30 02:45:55 2015
@@ -1,82 +1,31 @@
# REQUIRES: mips
# Check reading addendum for R_MIPS_26 relocation.
-# RUN: yaml2obj -format=elf %s > %t-obj
-# RUN: lld -flavor gnu -target mipsel -o %t-exe %t-obj
-# RUN: llvm-objdump -t -disassemble %t-exe | FileCheck %s
+# RUN: llvm-mc -arch=mipsel -filetype=obj -o=%t.o %s
+# RUN: lld -flavor gnu -target mipsel -o %t.exe %t.o
+# RUN: llvm-objdump -d %t.exe | FileCheck %s
# CHECK: Disassembly of section .text:
# CHECK-NEXT: __start:
-# CHECK-NEXT: 400110: 00 00 00 00 nop
-# CHECK-NEXT: 400114: 44 70 10 0c jal 4309264
-# 0x107044 << 2 = 0x41C110 = _start + (0x7000 << 2)
-# CHECK-NEXT: 400118: 00 00 00 00 nop
+# CHECK-NEXT: 400180: 60 70 10 0c jal 4309376
+# CHECK-NEXT: 400184: 00 00 00 00 nop
+# CHECK-NEXT: 400188: 68 70 10 0c jal 4309408
+# CHECK-NEXT: 40018c: 00 00 00 00 nop
+# CHECK-NEXT: 400190: 5f 00 10 0c jal 4194684
+# CHECK-NEXT: 400194: 00 00 00 00 nop
+# CHECK-NEXT: 400198: 67 00 10 0c jal 4194716
+# CHECK-NEXT: 40019c: 00 00 00 00 nop
#
-# CHECK: loc:
-# CHECK-NEXT: 40011c: 47 70 10 0c jal 4309276
-# 0x107047 << 2 = 0x41C11C = loc + (0x7000 << 2)
-# CHECK-NEXT: 400120: 00 00 00 00 nop
-# CHECK-NEXT: 400124: 43 00 10 0c jal 4194572
-# 0x100043 << 2 = 0x40010C = _start - 4
-# CHECK-NEXT: 400128: 00 00 00 00 nop
-# CHECK-NEXT: 40012c: 46 00 10 0c jal 4194584
-# 0x100046 << 2 = 0x400118 = loc - 4
-# CHECK-NEXT: 400130: 00 00 00 00 nop
+# CHECK: loc:
+# CHECK-NEXT: 4001a0: 00 00 00 00 nop
-# CHECK: SYMBOL TABLE:
-# CHECK: 0040011c l F .text 00000018 loc
-# CHECK: 00400110 g F .text 0000000c __start
+ .text
+ .globl __start
+__start:
+ jal __start + 0x1C000
+ jal loc + 0x1C000
+ jal __start + (-1)
+ jal loc + (-1)
-!ELF
-FileHeader: !FileHeader
- Class: ELFCLASS32
- Data: ELFDATA2LSB
- Type: ET_REL
- Machine: EM_MIPS
- Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32]
-
-Sections:
-- Name: .text
- Type: SHT_PROGBITS
-# nop
-# jal __start + 0x1C000
-# nop
-# jal loc + 0x1C000
-# nop
-# jal __start - 1
-# nop
-# jal loc - 1
-# nop
- Content: "000000000070000C000000000070000C00000000FFFFFF0F00000000FFFFFF0F00000000"
- AddressAlign: 16
- Flags: [SHF_EXECINSTR, SHF_ALLOC]
-
-- Name: .rel.text
- Type: SHT_REL
- Info: .text
- AddressAlign: 4
- Relocations:
- - Offset: 0x4
- Symbol: __start
- Type: R_MIPS_26
- - Offset: 0xC
- Symbol: loc
- Type: R_MIPS_26
- - Offset: 0x14
- Symbol: __start
- Type: R_MIPS_26
- - Offset: 0x1C
- Symbol: loc
- Type: R_MIPS_26
-
-Symbols:
- Global:
- - Name: __start
- Section: .text
- Value: 0x0
- Size: 4
- Local:
- - Name: loc
- Section: .text
- Value: 0xc
- Size: 4
+loc:
+ nop
Modified: lld/trunk/test/elf/Mips/rel-copy-micro.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-copy-micro.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-copy-micro.test (original)
+++ lld/trunk/test/elf/Mips/rel-copy-micro.test Thu Jul 30 02:45:55 2015
@@ -33,7 +33,7 @@
# CHECK-NEXT: Binding: Global (0x1)
# CHECK-NEXT: Type: Object (0x1)
# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .bss (0xA)
+# CHECK-NEXT: Section: .bss
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: D2@ (4)
@@ -42,7 +42,7 @@
# CHECK-NEXT: Binding: Global (0x1)
# CHECK-NEXT: Type: Object (0x1)
# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .bss (0xA)
+# CHECK-NEXT: Section: .bss
# CHECK-NEXT: }
# CHECK-NEXT: ]
Modified: lld/trunk/test/elf/Mips/rel-copy-pc.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-copy-pc.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-copy-pc.test (original)
+++ lld/trunk/test/elf/Mips/rel-copy-pc.test Thu Jul 30 02:45:55 2015
@@ -30,7 +30,7 @@
# CHECK-NEXT: Binding: Global (0x1)
# CHECK-NEXT: Type: Object (0x1)
# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .bss (0xA)
+# CHECK-NEXT: Section: .bss
# CHECK-NEXT: }
# CHECK-NEXT: ]
Modified: lld/trunk/test/elf/Mips/rel-copy.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-copy.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-copy.test (original)
+++ lld/trunk/test/elf/Mips/rel-copy.test Thu Jul 30 02:45:55 2015
@@ -29,21 +29,21 @@
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: D1@ (1)
-# CHECK-NEXT: Value: 0x402010
+# CHECK-NEXT: Value: 0x{{[0-9A-F]+}}
# CHECK-NEXT: Size: 4
# CHECK-NEXT: Binding: Global (0x1)
# CHECK-NEXT: Type: Object (0x1)
# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .bss (0xA)
+# CHECK-NEXT: Section: .bss
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: D3@ (4)
-# CHECK-NEXT: Value: 0x402018
+# CHECK-NEXT: Value: 0x{{[0-9A-F]+}}
# CHECK-NEXT: Size: 4
# CHECK-NEXT: Binding: Global (0x1)
# CHECK-NEXT: Type: Object (0x1)
# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .bss (0xA)
+# CHECK-NEXT: Section: .bss
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: D2@ (7)
Modified: lld/trunk/test/elf/Mips/rel-dynamic-01-micro.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-dynamic-01-micro.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-dynamic-01-micro.test (original)
+++ lld/trunk/test/elf/Mips/rel-dynamic-01-micro.test Thu Jul 30 02:45:55 2015
@@ -40,7 +40,7 @@
# PLT-SYM: Relocations [
# PLT-SYM-NEXT: Section (5) .rel.dyn {
-# PLT-SYM-NEXT: 0x402018 R_MIPS_COPY D1 0x0
+# PLT-SYM-NEXT: 0x402020 R_MIPS_COPY D1 0x0
# PLT-SYM-NEXT: }
# PLT-SYM-NEXT: Section (6) .rel.plt {
# PLT-SYM-NEXT: 0x402008 R_MIPS_JUMP_SLOT T3 0x0
@@ -60,16 +60,16 @@
# PLT-SYM-NEXT: }
# PLT-SYM-NEXT: Symbol {
# PLT-SYM-NEXT: Name: D1@ (1)
-# PLT-SYM-NEXT: Value: 0x402018
+# PLT-SYM-NEXT: Value: 0x{{[0-9A-F]+}}
# PLT-SYM-NEXT: Size: 8
# PLT-SYM-NEXT: Binding: Global (0x1)
# PLT-SYM-NEXT: Type: Object (0x1)
# PLT-SYM-NEXT: Other: 0
-# PLT-SYM-NEXT: Section: .bss (0xD)
+# PLT-SYM-NEXT: Section: .bss
# PLT-SYM-NEXT: }
# PLT-SYM-NEXT: Symbol {
# PLT-SYM-NEXT: Name: T1@ (4)
-# PLT-SYM-NEXT: Value: 0x4001D5
+# PLT-SYM-NEXT: Value: 0x{{[0-9A-F]+}}
# PLT-SYM-NEXT: Size: 0
# PLT-SYM-NEXT: Binding: Global (0x1)
# PLT-SYM-NEXT: Type: Function (0x2)
Modified: lld/trunk/test/elf/Mips/rel-dynamic-01.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-dynamic-01.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-dynamic-01.test (original)
+++ lld/trunk/test/elf/Mips/rel-dynamic-01.test Thu Jul 30 02:45:55 2015
@@ -42,7 +42,7 @@
# PLT-SYM-NEXT: Section (5) .rel.dyn {
# PLT-SYM-NEXT: 0x402014 R_MIPS_REL32 T2 0x0
# PLT-SYM-NEXT: 0x402014 R_MIPS_REL32 D2 0x0
-# PLT-SYM-NEXT: 0x402018 R_MIPS_COPY D1 0x0
+# PLT-SYM-NEXT: 0x402020 R_MIPS_COPY D1 0x0
# PLT-SYM-NEXT: }
# PLT-SYM-NEXT: Section (6) .rel.plt {
# PLT-SYM-NEXT: 0x402008 R_MIPS_JUMP_SLOT T3 0x0
@@ -62,16 +62,16 @@
# PLT-SYM-NEXT: }
# PLT-SYM-NEXT: Symbol {
# PLT-SYM-NEXT: Name: D1@ (1)
-# PLT-SYM-NEXT: Value: 0x402018
+# PLT-SYM-NEXT: Value: 0x{{[0-9A-F]+}}
# PLT-SYM-NEXT: Size: 4
# PLT-SYM-NEXT: Binding: Global (0x1)
# PLT-SYM-NEXT: Type: Object (0x1)
# PLT-SYM-NEXT: Other: 0
-# PLT-SYM-NEXT: Section: .bss (0xD)
+# PLT-SYM-NEXT: Section: .bss
# PLT-SYM-NEXT: }
# PLT-SYM-NEXT: Symbol {
# PLT-SYM-NEXT: Name: T1@ (4)
-# PLT-SYM-NEXT: Value: 0x400220
+# PLT-SYM-NEXT: Value: 0x{{[0-9A-F]+}}
# PLT-SYM-NEXT: Size: 0
# PLT-SYM-NEXT: Binding: Global (0x1)
# PLT-SYM-NEXT: Type: Function (0x2)
@@ -111,7 +111,7 @@
# GOT-NEXT: ]
# GOT-NEXT: Global entries [
# GOT-NEXT: Entry {
-# GOT-NEXT: Address: 0x401008
+# GOT-NEXT: Address: 0x{{[0-9A-F]+}}
# GOT-NEXT: Access: -32744
# GOT-NEXT: Initial: 0x0
# GOT-NEXT: Value: 0x0
@@ -120,7 +120,7 @@
# GOT-NEXT: Name: T2@ (7)
# GOT-NEXT: }
# GOT-NEXT: Entry {
-# GOT-NEXT: Address: 0x40100C
+# GOT-NEXT: Address: 0x{{[0-9A-F]+}}
# GOT-NEXT: Access: -32740
# GOT-NEXT: Initial: 0x0
# GOT-NEXT: Value: 0x0
Modified: lld/trunk/test/elf/Mips/rel-dynamic-12.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-dynamic-12.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-dynamic-12.test (original)
+++ lld/trunk/test/elf/Mips/rel-dynamic-12.test Thu Jul 30 02:45:55 2015
@@ -18,7 +18,7 @@
# PLT-SYM-NEXT: Section (5) .rel.dyn {
# PLT-SYM-NEXT: 0x402014 R_MIPS_REL32 T2 0x0
# PLT-SYM-NEXT: 0x402014 R_MIPS_REL32 D2 0x0
-# PLT-SYM-NEXT: 0x402018 R_MIPS_COPY D1 0x0
+# PLT-SYM-NEXT: 0x402020 R_MIPS_COPY D1 0x0
# PLT-SYM-NEXT: }
# PLT-SYM-NEXT: Section (6) .rel.plt {
# PLT-SYM-NEXT: 0x402008 R_MIPS_JUMP_SLOT T3 0x0
@@ -38,16 +38,16 @@
# PLT-SYM-NEXT: }
# PLT-SYM-NEXT: Symbol {
# PLT-SYM-NEXT: Name: D1@ (1)
-# PLT-SYM-NEXT: Value: 0x402018
+# PLT-SYM-NEXT: Value: 0x{{[0-9A-F]+}}
# PLT-SYM-NEXT: Size: 4
# PLT-SYM-NEXT: Binding: Global (0x1)
# PLT-SYM-NEXT: Type: Object (0x1)
# PLT-SYM-NEXT: Other: 0
-# PLT-SYM-NEXT: Section: .bss (0xD)
+# PLT-SYM-NEXT: Section: .bss
# PLT-SYM-NEXT: }
# PLT-SYM-NEXT: Symbol {
# PLT-SYM-NEXT: Name: T1@ (4)
-# PLT-SYM-NEXT: Value: 0x400220
+# PLT-SYM-NEXT: Value: 0x{{[0-9A-F]+}}
# PLT-SYM-NEXT: Size: 0
# PLT-SYM-NEXT: Binding: Global (0x1)
# PLT-SYM-NEXT: Type: Function (0x2)
@@ -87,7 +87,7 @@
# GOT-NEXT: ]
# GOT-NEXT: Global entries [
# GOT-NEXT: Entry {
-# GOT-NEXT: Address: 0x401008
+# GOT-NEXT: Address: 0x{{[0-9A-F]+}}
# GOT-NEXT: Access: -32744
# GOT-NEXT: Initial: 0x0
# GOT-NEXT: Value: 0x0
@@ -96,7 +96,7 @@
# GOT-NEXT: Name: T2@ (7)
# GOT-NEXT: }
# GOT-NEXT: Entry {
-# GOT-NEXT: Address: 0x40100C
+# GOT-NEXT: Address: 0x{{[0-9A-F]+}}
# GOT-NEXT: Access: -32740
# GOT-NEXT: Initial: 0x0
# GOT-NEXT: Value: 0x0
Modified: lld/trunk/test/elf/Mips/rel-gprel32-64.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-gprel32-64.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-gprel32-64.test (original)
+++ lld/trunk/test/elf/Mips/rel-gprel32-64.test Thu Jul 30 02:45:55 2015
@@ -10,10 +10,10 @@
# REL-EXE-NEXT: ]
# CHECK: Contents of section .text:
-# CHECK-NEXT: 1200001a0 c871ffff ffffffff c871ffff c871ffff
-# CHECK-NEXT: 1200001b0 c871ffff ffffffff 00000000 00000000
+# CHECK-NEXT: 1200001d0 f871ffff ffffffff f871ffff f871ffff
+# CHECK-NEXT: 1200001e0 f871ffff ffffffff 00000000 00000000
-# SYM: 00000001200001b8 t LT1
+# SYM: 00000001200001e8 t LT1
# SYM: 0000000120001000 N _GLOBAL_OFFSET_TABLE_
# RUN: lld -flavor gnu -target mips64el -shared -o %t.so %t.o
Modified: lld/trunk/test/elf/Mips/rel-gprel32.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-gprel32.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-gprel32.test (original)
+++ lld/trunk/test/elf/Mips/rel-gprel32.test Thu Jul 30 02:45:55 2015
@@ -6,7 +6,7 @@
# RUN: llvm-objdump -s %t-exe | FileCheck -check-prefix=SEC %s
# SYM: Name: $L1
-# SYM-NEXT: Value: 0x400140
+# SYM-NEXT: Value: 0x400160
# SYM-NEXT: Size: 4
# SYM-NEXT: Binding: Local (0x0)
# SYM-NEXT: Type: Function (0x2)
@@ -24,7 +24,7 @@
# 0x08ff7153 == 0x8000001 (addend) + 0x400140 ($L1) +
# 0x1000002 (GP0) - 0x408FF0 (_gp)
# SEC: Contents of section .rodata:
-# SEC-NEXT: 400150 5371ff08 00000000 00000000 00000000
+# SEC-NEXT: 400170 7371ff08 00000000 00000000 00000000
!ELF
FileHeader:
Modified: lld/trunk/test/elf/Mips/rel-high-01.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-high-01.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-high-01.test (original)
+++ lld/trunk/test/elf/Mips/rel-high-01.test Thu Jul 30 02:45:55 2015
@@ -1,55 +1,25 @@
+# REQUIRES: mips
+
# Check handling R_MIPS_HIGHER / R_MIPS_HIGHEST relocations.
-# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: llvm-mc -arch=mips64el -filetype=obj -o=%t.o %s
# RUN: lld -flavor gnu -target mips64el -e T0 -o %t.exe %t.o
-# RUN: llvm-nm %t.exe | FileCheck -check-prefix=SYM %s
-# RUN: llvm-objdump -s %t.exe | FileCheck -check-prefix=RAW %s
-
-# SYM: 00000001200001a0 T T0
-# SYM: 00000001200001a8 T T1
-
-# RAW: Contents of section .text:
-# RAW-NEXT: 1200001a0 02800000 00000000 01400000 00000000
-
-FileHeader:
- Class: ELFCLASS64
- Data: ELFDATA2LSB
- Type: ET_REL
- Machine: EM_MIPS
- Flags: [EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64]
-
-Sections:
- - Name: .text
- Type: SHT_PROGBITS
- Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
- AddressAlign: 16
- Size: 16
-
- - Name: .rela.text
- Type: SHT_RELA
- Flags: [ SHF_INFO_LINK ]
- Link: .symtab
- AddressAlign: 8
- Info: .text
- Relocations:
- - Offset: 0
- Symbol: T1
- Type: R_MIPS_HIGHER
- Addend: 0x0000800100000000
- - Offset: 8
- Symbol: T1
- Type: R_MIPS_HIGHEST
- Addend: 0x4001000000000000
+# RUN: llvm-objdump -d %t.exe | FileCheck %s
-Symbols:
- Global:
- - Name: T0
- Type: STT_FUNC
- Section: .text
- Value: 0
- Size: 8
- - Name: T1
- Type: STT_FUNC
- Section: .text
- Value: 8
- Size: 8
+# CHECK: Disassembly of section .text:
+# CHECK-NEXT: T0:
+# CHECK-NEXT: 120000250: 01 00 62 64 daddiu $2, $3, 1
+# CHECK-NEXT: 120000254: 00 00 62 64 daddiu $2, $3, 0
+#
+# CHECK: T1:
+# CHECK-NEXT: 120000258: 00 00 00 00 nop
+
+ .text
+ .globl T0
+T0:
+ daddiu $2, $3, %higher(T1)
+ daddiu $2, $3, %highest(T1)
+
+ .globl T1
+T1:
+ nop
Modified: lld/trunk/test/elf/Mips/rel-high-02.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-high-02.test?rev=243626&r1=243625&r2=243626&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-high-02.test (original)
+++ lld/trunk/test/elf/Mips/rel-high-02.test Thu Jul 30 02:45:55 2015
@@ -1,55 +1,25 @@
+# REQUIRES: mips
+
# Check handling R_MICROMIPS_HIGHER / R_MICROMIPS_HIGHEST relocations.
-# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: llvm-mc -arch=mips64el -filetype=obj -o=%t.o %s
# RUN: lld -flavor gnu -target mips64el -e T0 -o %t.exe %t.o
-# RUN: llvm-nm %t.exe | FileCheck -check-prefix=SYM %s
-# RUN: llvm-objdump -s %t.exe | FileCheck -check-prefix=RAW %s
-
-# SYM: 00000001200001a0 T T0
-# SYM: 00000001200001a8 T T1
-
-# RAW: Contents of section .text:
-# RAW-NEXT: 1200001a0 00000280 00000000 00000140 00000000
-
-FileHeader:
- Class: ELFCLASS64
- Data: ELFDATA2LSB
- Type: ET_REL
- Machine: EM_MIPS
- Flags: [EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64]
-
-Sections:
- - Name: .text
- Type: SHT_PROGBITS
- Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
- AddressAlign: 16
- Size: 16
-
- - Name: .rela.text
- Type: SHT_RELA
- Flags: [ SHF_INFO_LINK ]
- Link: .symtab
- AddressAlign: 8
- Info: .text
- Relocations:
- - Offset: 0
- Symbol: T1
- Type: R_MICROMIPS_HIGHER
- Addend: 0x0000800100000000
- - Offset: 8
- Symbol: T1
- Type: R_MICROMIPS_HIGHEST
- Addend: 0x4001000000000000
+# RUN: llvm-objdump -d %t.exe | FileCheck %s
-Symbols:
- Global:
- - Name: T0
- Type: STT_FUNC
- Section: .text
- Value: 0
- Size: 8
- - Name: T1
- Type: STT_FUNC
- Section: .text
- Value: 8
- Size: 8
+# CHECK: Disassembly of section .text:
+# CHECK-NEXT: T0:
+# CHECK-NEXT: 120000250: 01 00 62 64 daddiu $2, $3, 1
+# CHECK-NEXT: 120000254: 00 00 62 64 daddiu $2, $3, 0
+#
+# CHECK: T1:
+# CHECK-NEXT: 120000258: 00 00 00 00 nop
+
+ .text
+ .globl T0
+T0:
+ daddiu $2, $3, %higher(T1+0x0000800100000000)
+ daddiu $2, $3, %highest(T1+0x4001000000000000)
+
+ .globl T1
+T1:
+ nop
Added: lld/trunk/test/elf/Mips/rld_map.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rld_map.test?rev=243626&view=auto
==============================================================================
--- lld/trunk/test/elf/Mips/rld_map.test (added)
+++ lld/trunk/test/elf/Mips/rld_map.test Thu Jul 30 02:45:55 2015
@@ -0,0 +1,41 @@
+# REQUIRES: mips
+
+# Check definition of DT_MIPS_RLD_MAP dynamic tag,
+# .rld_map section, and __RLD_MAP symbol.
+
+# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
+# RUN: lld -flavor gnu -target mips %t.o -o %t.exe
+# RUN: llvm-readobj -dynamic-table -s -st %t.exe \
+# RUN: | FileCheck -check-prefix=EXE-DYN %s
+
+# EXE-DYN: Name: .rld_map
+# EXE-DYN-NEXT: Type: SHT_PROGBITS
+# EXE-DYN-NEXT: Flags [
+# EXE-DYN-NEXT: SHF_ALLOC
+# EXE-DYN-NEXT: SHF_WRITE
+# EXE-DYN-NEXT: ]
+# EXE-DYN-NEXT: Address: 0x[[ADDR:[0-9A-F]+]]
+# EXE-DYN: Size: 4
+# EXE-DYN: AddressAlignment: 4
+# EXE-DYN: Symbols [
+# EXE-DYN-NEXT: Symbol {
+# EXE-DYN-NEXT: Name: __RLD_MAP
+# EXE-DYN-NEXT: Value: 0x[[ADDR]]
+# EXE-DYN-NEXT: Size: 4
+# EXE-DYN-NEXT: Binding: Global
+# EXE-DYN-NEXT: Type: Object
+#
+# EXE-DYN: 0x70000016 MIPS_RLD_MAP 0x402000
+
+# RUN: lld -flavor gnu -target mips -static %t.o -o %t.exe
+# RUN: llvm-nm -just-symbol-name %t.exe | FileCheck -check-prefix=EXE-STATIC %s
+
+# EXE-STATIC-NOT: __RLD_MAP
+
+# RUN: lld -flavor gnu -target mips -shared %t.o -o %t.so
+# RUN: llvm-nm -just-symbol-name %t.so | FileCheck -check-prefix=DYNLIB %s
+
+# DYNLIB-NOT: __RLD_MAP
+
+ .globl __start;
+__start:
More information about the llvm-commits
mailing list