[lld] r191032 - [lld][ELF] Support non alloc sections in the Writer.
Shankar Easwaran
shankare at codeaurora.org
Thu Sep 19 13:07:02 PDT 2013
Author: shankare
Date: Thu Sep 19 15:07:01 2013
New Revision: 191032
URL: http://llvm.org/viewvc/llvm-project?rev=191032&view=rev
Log:
[lld][ELF] Support non alloc sections in the Writer.
This also makes it support debugging executables built with lld.
Initial patch done by Bigcheese. This is only a revised patch to
have the functionality in the Writer.
Added:
lld/trunk/test/elf/X86_64/Inputs/debug0.c
lld/trunk/test/elf/X86_64/Inputs/debug0.x86-64
lld/trunk/test/elf/X86_64/Inputs/debug1.c
lld/trunk/test/elf/X86_64/Inputs/debug1.x86-64
lld/trunk/test/elf/X86_64/debug.test
Modified:
lld/trunk/include/lld/Core/DefinedAtom.h
lld/trunk/lib/Core/DefinedAtom.cpp
lld/trunk/lib/ReaderWriter/ELF/Atoms.h
lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h
lld/trunk/lib/ReaderWriter/ELF/HeaderChunks.h
lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h
lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
lld/trunk/test/elf/Hexagon/dynlib-syms.test
lld/trunk/test/elf/X86_64/initfini-alignment.test
lld/trunk/test/elf/X86_64/initfini-order.test
lld/trunk/test/elf/X86_64/nmagic.test
lld/trunk/test/elf/X86_64/omagic.test
lld/trunk/test/elf/X86_64/sectionmap.test
lld/trunk/test/elf/X86_64/undef.test
lld/trunk/test/elf/X86_64/underscore-end.test
lld/trunk/test/elf/X86_64/yamlinput.test
lld/trunk/test/elf/phdr.test
lld/trunk/test/elf/tlsAddr.test
Modified: lld/trunk/include/lld/Core/DefinedAtom.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/DefinedAtom.h?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/DefinedAtom.h (original)
+++ lld/trunk/include/lld/Core/DefinedAtom.h Thu Sep 19 15:07:01 2013
@@ -149,6 +149,7 @@ public:
typeThreadData, // Initialized thread local data(TDATA) [ELF]
typeRONote, // Identifies readonly note sections [ELF]
typeRWNote, // Identifies readwrite note sections [ELF]
+ typeNoAlloc, // Identifies non allocatable sections [ELF]
};
// Permission bits for atoms and segments. The order of these values are
Modified: lld/trunk/lib/Core/DefinedAtom.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/DefinedAtom.cpp?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/lib/Core/DefinedAtom.cpp (original)
+++ lld/trunk/lib/Core/DefinedAtom.cpp Thu Sep 19 15:07:01 2013
@@ -42,6 +42,7 @@ DefinedAtom::ContentPermissions DefinedA
case typeDTraceDOF:
case typeCompactUnwindInfo:
case typeRONote:
+ case typeNoAlloc:
return permR__;
case typeData:
Modified: lld/trunk/lib/ReaderWriter/ELF/Atoms.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Atoms.h?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Atoms.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Atoms.h Thu Sep 19 15:07:01 2013
@@ -285,6 +285,9 @@ public:
return _contentType = _targetAtomHandler->contentType(this);
}
+ if (!(flags & llvm::ELF::SHF_ALLOC))
+ return _contentType = typeNoAlloc;
+
if (_section->sh_flags ==
(llvm::ELF::SHF_ALLOC | llvm::ELF::SHF_WRITE | llvm::ELF::SHF_TLS)) {
return _contentType = _section->sh_type == llvm::ELF::SHT_NOBITS ? typeThreadZeroFill
@@ -426,6 +429,10 @@ public:
}
return _permissions = _targetAtomHandler->contentPermissions(this);
}
+
+ if (!(flags & llvm::ELF::SHF_ALLOC))
+ return _permissions = perm___;
+
switch (_section->sh_type) {
// permRW_L is for sections modified by the runtime
// loader.
Modified: lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h Thu Sep 19 15:07:01 2013
@@ -79,6 +79,7 @@ public:
ORDER_DATA = 200,
ORDER_RW_NOTE = 205,
ORDER_BSS = 210,
+ ORDER_NOALLOC = 215,
ORDER_OTHER = 220,
ORDER_SECTION_STRINGS = 230,
ORDER_SYMBOL_TABLE = 240,
@@ -356,6 +357,9 @@ Layout::SectionOrder DefaultLayout<ELFT>
case DefinedAtom::typeRWNote:
return ORDER_RW_NOTE;
+ case DefinedAtom::typeNoAlloc:
+ return ORDER_NOALLOC;
+
case DefinedAtom::typeThreadData:
return ORDER_TDATA;
case DefinedAtom::typeThreadZeroFill:
@@ -484,6 +488,7 @@ bool DefaultLayout<ELFT>::hasOutputSegme
case ORDER_INIT_ARRAY:
case ORDER_FINI_ARRAY:
case ORDER_BSS:
+ case ORDER_NOALLOC:
return true;
default:
return section->hasOutputSegment();
@@ -600,6 +605,8 @@ template <class ELFT> void DefaultLayout
if (!hasOutputSegment(section))
continue;
+ msi->setLoadableSection(section->isLoadableSection());
+
// Get the segment type for the section
int64_t segmentType = getSegmentType(section);
@@ -637,6 +644,8 @@ template <class ELFT> void DefaultLayout
}
segment->append(section);
}
+ if (segmentType == llvm::ELF::PT_NULL)
+ continue;
// If the output magic is set to OutputMagic::NMAGIC or
// OutputMagic::OMAGIC, Place the data alongside text in one single
@@ -719,7 +728,9 @@ DefaultLayout<ELFT>::assignVirtualAddres
while (true) {
for (auto si : _segments) {
si->finalize();
- newSegmentHeaderAdded = _programHeader->addSegment(si);
+ // Dont add PT_NULL segments into the program header
+ if (si->segmentType() != llvm::ELF::PT_NULL)
+ newSegmentHeaderAdded = _programHeader->addSegment(si);
}
if (!newSegmentHeaderAdded)
break;
@@ -727,8 +738,8 @@ DefaultLayout<ELFT>::assignVirtualAddres
uint64_t address = virtualAddress;
// Fix the offsets after adding the program header
for (auto &si : _segments) {
- // Dont assign offsets for non loadable segments
- if (si->segmentType() != llvm::ELF::PT_LOAD)
+ if ((si->segmentType() != llvm::ELF::PT_LOAD) &&
+ (si->segmentType() != llvm::ELF::PT_NULL))
continue;
// Align the segment to a page boundary only if the output mode is
// not OutputMagic::NMAGIC/OutputMagic::OMAGIC
@@ -740,20 +751,30 @@ DefaultLayout<ELFT>::assignVirtualAddres
fileoffset = si->fileOffset() + si->fileSize();
}
// start assigning virtual addresses
- for (auto si = _segments.begin(); si != _segments.end(); ++si) {
- // Dont assign addresses for non loadable segments
- if ((*si)->segmentType() != llvm::ELF::PT_LOAD)
+ for (auto &si : _segments) {
+ if ((si->segmentType() != llvm::ELF::PT_LOAD) &&
+ (si->segmentType() != llvm::ELF::PT_NULL))
continue;
- (*si)->setVAddr(virtualAddress);
- // The first segment has the virtualAddress set to the base address as
- // we have added the file header and the program header dont align the
- // first segment to the pagesize
- (*si)->assignVirtualAddress(address);
- (*si)->setMemSize(address - virtualAddress);
- if (outputMagic != ELFLinkingContext::OutputMagic::NMAGIC &&
- outputMagic != ELFLinkingContext::OutputMagic::OMAGIC)
- virtualAddress =
- llvm::RoundUpToAlignment(address, _context.getPageSize());
+
+ if (si->segmentType() == llvm::ELF::PT_NULL) {
+ uint64_t nonLoadableAddr = 0;
+ si->setVAddr(nonLoadableAddr);
+ // The first segment has the virtualAddress set to the base address as
+ // we have added the file header and the program header dont align the
+ // first segment to the pagesize
+ si->assignVirtualAddress(nonLoadableAddr);
+ } else {
+ si->setVAddr(virtualAddress);
+ // The first segment has the virtualAddress set to the base address as
+ // we have added the file header and the program header dont align the
+ // first segment to the pagesize
+ si->assignVirtualAddress(address);
+ si->setMemSize(address - virtualAddress);
+ if (outputMagic != ELFLinkingContext::OutputMagic::NMAGIC &&
+ outputMagic != ELFLinkingContext::OutputMagic::OMAGIC)
+ virtualAddress =
+ llvm::RoundUpToAlignment(address, _context.getPageSize());
+ }
}
_programHeader->resetProgramHeaders();
}
@@ -809,7 +830,8 @@ DefaultLayout<ELFT>::assignOffsetsForMis
uint64_t size = 0;
for (auto si : _segments) {
// Dont calculate offsets from non loadable segments
- if (si->segmentType() != llvm::ELF::PT_LOAD)
+ if ((si->segmentType() != llvm::ELF::PT_LOAD) &&
+ (si->segmentType() != llvm::ELF::PT_NULL))
continue;
fileoffset = si->fileOffset();
size = si->fileSize();
Modified: lld/trunk/lib/ReaderWriter/ELF/HeaderChunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/HeaderChunks.h?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/HeaderChunks.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/HeaderChunks.h Thu Sep 19 15:07:01 2013
@@ -309,8 +309,11 @@ SectionHeader<ELFT>::appendSection(Merge
shdr->sh_flags = section->flags();
shdr->sh_offset = section->fileOffset();
shdr->sh_addr = section->virtualAddr();
- shdr->sh_size = section->memSize();
- shdr->sh_link = section->link();
+ if (section->isLoadableSection())
+ shdr->sh_size = section->memSize();
+ else
+ shdr->sh_size = section->fileSize();
+ shdr->sh_link = section->link();
shdr->sh_info = section->shinfo();
shdr->sh_addralign = section->align2();
shdr->sh_entsize = section->entsize();
Modified: lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h Thu Sep 19 15:07:01 2013
@@ -64,6 +64,9 @@ public:
return false;
}
+ /// Return if the section is a loadable section that occupies memory
+ virtual bool isLoadableSection() const { return false; }
+
/// \brief Assign file offsets starting at offset.
virtual void assignOffsets(uint64_t offset) {}
@@ -94,19 +97,14 @@ public:
/// purposes
StringRef segmentKindToStr() const;
- // TODO: Move this down to AtomSection.
- virtual bool findAtomAddrByName(StringRef name, uint64_t &addr) {
- return false;
- }
-
/// \brief Records the segmentType, that this section belongs to
void setSegmentType(const Layout::SegmentType segmentType) {
this->_segmentType = segmentType;
}
- void setMergedSection(MergedSections<ELFT> *ms) {
- _parent = ms;
- }
+ virtual bool findAtomAddrByName(StringRef, uint64_t &) { return false; }
+
+ void setMergedSection(MergedSections<ELFT> *ms) { _parent = ms; }
static bool classof(const Chunk<ELFT> *c) {
return c->kind() == Chunk<ELFT>::Kind::ELFSection ||
@@ -136,8 +134,10 @@ public:
AtomSection(const ELFLinkingContext &context, StringRef name,
int32_t contentType, int32_t permissions, int32_t order)
: Section<ELFT>(context, name, Chunk<ELFT>::Kind::AtomSection),
- _contentType(contentType), _contentPermissions(permissions) {
+ _contentType(contentType), _contentPermissions(permissions),
+ _isLoadedInMemory(true) {
this->setOrder(order);
+
switch (contentType) {
case DefinedAtom::typeCode:
case DefinedAtom::typeDataFast:
@@ -160,6 +160,11 @@ public:
case DefinedAtom::typeRWNote:
this->_type = SHT_NOTE;
break;
+
+ case DefinedAtom::typeNoAlloc:
+ this->_type = SHT_PROGBITS;
+ this->_isLoadedInMemory = false;
+ break;
}
switch (permissions) {
@@ -179,12 +184,18 @@ public:
case DefinedAtom::permRWX:
this->_flags = SHF_ALLOC | SHF_WRITE | SHF_EXECINSTR;
break;
+ case DefinedAtom::perm___:
+ this->_flags = 0;
+ break;
}
}
/// Align the offset to the required modulus defined by the atom alignment
uint64_t alignOffset(uint64_t offset, DefinedAtom::Alignment &atomAlign);
+ /// Return if the section is a loadable section that occupies memory
+ virtual bool isLoadableSection() const { return _isLoadedInMemory; }
+
// \brief Append an atom to a Section. The atom gets pushed into a vector
// contains the atom, the atom file offset, the atom virtual address
// the atom file offset is aligned appropriately as set by the Reader
@@ -207,7 +218,7 @@ public:
}
}
- /// \brief Find the Atom address given a name, this is needed to to properly
+ /// \brief Find the Atom address given a name, this is needed to properly
/// apply relocation. The section class calls this to find the atom address
/// to fix the relocation
virtual bool findAtomAddrByName(StringRef name, uint64_t &addr) {
@@ -240,6 +251,7 @@ protected:
llvm::BumpPtrAllocator _alloc;
int32_t _contentType;
int32_t _contentPermissions;
+ bool _isLoadedInMemory;
std::vector<lld::AtomLayout *> _atoms;
};
@@ -296,6 +308,14 @@ const lld::AtomLayout &AtomSection<ELFT>
<< "Adding atom: " << atom->name() << "@"
<< fOffset << "\n");
break;
+ case DefinedAtom::typeNoAlloc:
+ _atoms.push_back(new (_alloc) lld::AtomLayout(atom, fOffset, 0));
+ this->_fsize = fOffset + definedAtom->size();
+ DEBUG_WITH_TYPE("Section", llvm::dbgs() << "[" << this->name() << " "
+ << this << "] "
+ << "Adding atom: " << atom->name()
+ << "@" << fOffset << "\n");
+ break;
case DefinedAtom::typeThreadZeroFill:
case DefinedAtom::typeZeroFill:
case DefinedAtom::typeZeroFillFast:
@@ -414,6 +434,14 @@ public:
_virtualAddr = addr;
}
+ // Is the section loadable ?
+ inline bool isLoadableSection() const { return _isLoadableSection; }
+
+ // Set section Loadable
+ inline void setLoadableSection(bool isLoadable) {
+ _isLoadableSection = isLoadable;
+ }
+
void setLink(uint64_t link) { _link = link; }
void setInfo(uint64_t info) { _shInfo = info; }
@@ -464,27 +492,16 @@ private:
uint64_t _align2;
int64_t _kind;
int64_t _type;
+ bool _isLoadableSection;
std::vector<Chunk<ELFT> *> _sections;
};
/// MergedSections
-template<class ELFT>
+template <class ELFT>
MergedSections<ELFT>::MergedSections(StringRef name)
- : _name(name)
- ,_hasSegment(false)
- ,_ordinal(0)
- ,_flags(0)
- ,_size(0)
- ,_memSize(0)
- ,_fileOffset(0)
- ,_virtualAddr(0)
- ,_shInfo(0)
- ,_entSize(0)
- ,_link(0)
- ,_align2(0)
- ,_kind(0)
- ,_type(0) { }
-
+ : _name(name), _hasSegment(false), _ordinal(0), _flags(0), _size(0),
+ _memSize(0), _fileOffset(0), _virtualAddr(0), _shInfo(0), _entSize(0),
+ _link(0), _align2(0), _kind(0), _type(0), _isLoadableSection(false) {}
template<class ELFT>
void
Modified: lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp (original)
+++ lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp Thu Sep 19 15:07:01 2013
@@ -449,6 +449,7 @@ template <> struct ScalarEnumerationTrai
lld::DefinedAtom::typeThreadZeroFill);
io.enumCase(value, "note", lld::DefinedAtom::typeRONote);
io.enumCase(value, "note", lld::DefinedAtom::typeRWNote);
+ io.enumCase(value, "no-alloc", lld::DefinedAtom::typeNoAlloc);
}
};
Modified: lld/trunk/test/elf/Hexagon/dynlib-syms.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Hexagon/dynlib-syms.test?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/test/elf/Hexagon/dynlib-syms.test (original)
+++ lld/trunk/test/elf/Hexagon/dynlib-syms.test Thu Sep 19 15:07:01 2013
@@ -3,6 +3,6 @@ RUN: -o %t --noinhibit-exec -shared
RUN: llvm-nm -n -s %t > %t1
RUN: FileCheck -check-prefix=CHECKSYMS %s < %t1
-CHECKSYMS: 000002b8 A _DYNAMIC
+CHECKSYMS: 0000028c A _DYNAMIC
CHECKSYMS: 00001008 A _GLOBAL_OFFSET_TABLE_
CHECKSYMS: 00002000 A _SDA_BASE_
Added: lld/trunk/test/elf/X86_64/Inputs/debug0.c
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/Inputs/debug0.c?rev=191032&view=auto
==============================================================================
--- lld/trunk/test/elf/X86_64/Inputs/debug0.c (added)
+++ lld/trunk/test/elf/X86_64/Inputs/debug0.c Thu Sep 19 15:07:01 2013
@@ -0,0 +1,5 @@
+int adena();
+
+int main() {
+return adena();
+}
Added: lld/trunk/test/elf/X86_64/Inputs/debug0.x86-64
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/Inputs/debug0.x86-64?rev=191032&view=auto
==============================================================================
Binary files lld/trunk/test/elf/X86_64/Inputs/debug0.x86-64 (added) and lld/trunk/test/elf/X86_64/Inputs/debug0.x86-64 Thu Sep 19 15:07:01 2013 differ
Added: lld/trunk/test/elf/X86_64/Inputs/debug1.c
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/Inputs/debug1.c?rev=191032&view=auto
==============================================================================
--- lld/trunk/test/elf/X86_64/Inputs/debug1.c (added)
+++ lld/trunk/test/elf/X86_64/Inputs/debug1.c Thu Sep 19 15:07:01 2013
@@ -0,0 +1,3 @@
+int adena() {
+return 0;
+}
Added: lld/trunk/test/elf/X86_64/Inputs/debug1.x86-64
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/Inputs/debug1.x86-64?rev=191032&view=auto
==============================================================================
Binary files lld/trunk/test/elf/X86_64/Inputs/debug1.x86-64 (added) and lld/trunk/test/elf/X86_64/Inputs/debug1.x86-64 Thu Sep 19 15:07:01 2013 differ
Added: lld/trunk/test/elf/X86_64/debug.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/debug.test?rev=191032&view=auto
==============================================================================
--- lld/trunk/test/elf/X86_64/debug.test (added)
+++ lld/trunk/test/elf/X86_64/debug.test Thu Sep 19 15:07:01 2013
@@ -0,0 +1,57 @@
+# Test that debug info is assigned typeNoAlloc and that the output sections have
+# a virtual address of 0.
+RUN: lld -flavor gnu -target x86_64 -e main -emit-yaml \
+RUN: %p/Inputs/debug0.x86-64 %p/Inputs/debug1.x86-64 -o %t
+RUN: FileCheck %s -check-prefix YAML < %t
+
+RUN: lld -flavor gnu -target x86_64 -e main %p/Inputs/debug0.x86-64 \
+RUN: %p/Inputs/debug1.x86-64 -o %t1
+RUN: llvm-readobj -sections %t1 | FileCheck %s -check-prefix ELF
+# Verify that non SHF_ALLOC sections are relocated correctly.
+RUN: llvm-objdump -s %t1 | FileCheck %s -check-prefix RELOC
+
+YAML: type: no-alloc
+
+ELF: Section {
+ELF: Name: .debug_info
+ELF: Type: SHT_PROGBITS (0x1)
+ELF: Flags [ (0x0)
+ELF: ]
+ELF: Address: 0x0
+ELF: }
+ELF: Section {
+ELF: Name: .debug_abbrev
+ELF: Type: SHT_PROGBITS (0x1)
+ELF: Flags [ (0x0)
+ELF: ]
+ELF: Address: 0x0
+ELF: }
+ELF: Section {
+ELF: Name: .debug_aranges
+ELF: Type: SHT_PROGBITS (0x1)
+ELF: Flags [ (0x0)
+ELF: ]
+ELF: Address: 0x0
+ELF: }
+ELF: Section {
+ELF: Name: .debug_line
+ELF: Type: SHT_PROGBITS (0x1)
+ELF: Flags [ (0x0)
+ELF: ]
+ELF: Address: 0x0
+ELF: }
+ELF: Section {
+ELF: Name: .debug_str
+ELF: Type: SHT_PROGBITS (0x1)
+ELF: Flags [ (0x0)
+ELF: ]
+ELF: Address: 0x0
+ELF: }
+
+RELOC: Contents of section .debug_info:
+RELOC: 0000 4e000000 04000000 00000801 3a000000 N...........:...
+# ^^ Relocation: ._debug_str + 0x3a
+RELOC: 0010 01780000 00000000 00a40140 00000000 .x......... at ....
+# ^^ Relocation: .debug_str + 0x78
+RELOC: 0020 00100000 00000000 00000000 00028100 ................
+# ^^ Relocation: .debug_str + 0x81
Modified: lld/trunk/test/elf/X86_64/initfini-alignment.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/initfini-alignment.test?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/initfini-alignment.test (original)
+++ lld/trunk/test/elf/X86_64/initfini-alignment.test Thu Sep 19 15:07:01 2013
@@ -6,7 +6,7 @@ RUN: lld -flavor gnu -target x86_64-linu
RUN: -init init -fini fini --noinhibit-exec -o %t
RUN: llvm-readobj -s %t | FileCheck %s
-CHECK: Name: .init_array (80)
+CHECK: Name: .init_array
CHECK: AddressAlignment: 8
-CHECK: Name: .fini_array (92)
+CHECK: Name: .fini_array
CHECK: AddressAlignment: 8
Modified: lld/trunk/test/elf/X86_64/initfini-order.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/initfini-order.test?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/initfini-order.test (original)
+++ lld/trunk/test/elf/X86_64/initfini-order.test Thu Sep 19 15:07:01 2013
@@ -5,6 +5,6 @@ RUN: lld -flavor gnu -target x86_64-linu
RUN: --noinhibit-exec -o %t
RUN: llvm-objdump -t -section-headers %t | FileCheck %s
-CHECK: 9 .eh_frame {{[0-9]+}} {{[0-9]+}} DATA
-CHECK: 10 .init_array {{[0-9]+}} {{[0-9]+}} DATA
-CHECK: 11 .fini_array {{[0-9]+}} {{[0-9]+}} DATA
+CHECK: {{[0-9]+}} .eh_frame {{[0-9a-z]+}} {{[0-9a-z]+}} DATA
+CHECK: {{[0-9]+}} .init_array {{[0-9a-z]+}} {{[0-9a-z]+}} DATA
+CHECK: {{[0-9]+}} .fini_array {{[0-9a-z]+}} {{[0-9a-z]+}} DATA
Modified: lld/trunk/test/elf/X86_64/nmagic.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/nmagic.test?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/nmagic.test (original)
+++ lld/trunk/test/elf/X86_64/nmagic.test Thu Sep 19 15:07:01 2013
@@ -12,63 +12,51 @@ NMAGICSECTIONS: Name: (0)
NMAGICSECTIONS: Type: SHT_NULL (0x0)
NMAGICSECTIONS: }
NMAGICSECTIONS: Section {
-NMAGICSECTIONS: Index: 1
-NMAGICSECTIONS: Name: .note.GNU-stack (1)
+NMAGICSECTIONS: Name: .text
NMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
NMAGICSECTIONS: }
NMAGICSECTIONS: Section {
-NMAGICSECTIONS: Index: 2
-NMAGICSECTIONS: Name: .text (17)
+NMAGICSECTIONS: Name: .eh_frame
NMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
NMAGICSECTIONS: }
NMAGICSECTIONS: Section {
-NMAGICSECTIONS: Index: 3
-NMAGICSECTIONS: Name: .comment (23)
+NMAGICSECTIONS: Name: .tdata
NMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
NMAGICSECTIONS: }
NMAGICSECTIONS: Section {
-NMAGICSECTIONS: Index: 4
-NMAGICSECTIONS: Name: .eh_frame (32)
+NMAGICSECTIONS: Name: .tbss
+NMAGICSECTIONS: Type: SHT_NOBITS (0x8)
+NMAGICSECTIONS: }
+NMAGICSECTIONS: Section {
+NMAGICSECTIONS: Name: .got.plt
NMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
NMAGICSECTIONS: }
NMAGICSECTIONS: Section {
-NMAGICSECTIONS: Index: 5
-NMAGICSECTIONS: Name: .tdata (42)
+NMAGICSECTIONS: Name: .data
NMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
NMAGICSECTIONS: }
NMAGICSECTIONS: Section {
-NMAGICSECTIONS: Index: 6
-NMAGICSECTIONS: Name: .tbss (49)
+NMAGICSECTIONS: Name: .bss
NMAGICSECTIONS: Type: SHT_NOBITS (0x8)
NMAGICSECTIONS: }
NMAGICSECTIONS: Section {
-NMAGICSECTIONS: Index: 7
-NMAGICSECTIONS: Name: .got.plt (55)
+NMAGICSECTIONS: Name: .comment
NMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
NMAGICSECTIONS: }
NMAGICSECTIONS: Section {
-NMAGICSECTIONS: Index: 8
-NMAGICSECTIONS: Name: .data (64)
+NMAGICSECTIONS: Name: .note.GNU-stack
NMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
NMAGICSECTIONS: }
NMAGICSECTIONS: Section {
-NMAGICSECTIONS: Index: 9
-NMAGICSECTIONS: Name: .bss (70)
-NMAGICSECTIONS: Type: SHT_NOBITS (0x8)
-NMAGICSECTIONS: }
-NMAGICSECTIONS: Section {
-NMAGICSECTIONS: Index: 10
-NMAGICSECTIONS: Name: .shstrtab (75)
+NMAGICSECTIONS: Name: .shstrtab
NMAGICSECTIONS: Type: SHT_STRTAB (0x3)
NMAGICSECTIONS: }
NMAGICSECTIONS: Section {
-NMAGICSECTIONS: Index: 11
-NMAGICSECTIONS: Name: .symtab (85)
+NMAGICSECTIONS: Name: .symtab
NMAGICSECTIONS: Type: SHT_SYMTAB (0x2)
NMAGICSECTIONS: }
NMAGICSECTIONS: Section {
-NMAGICSECTIONS: Index: 12
-NMAGICSECTIONS: Name: .strtab (93)
+NMAGICSECTIONS: Name: .strtab
NMAGICSECTIONS: Type: SHT_STRTAB (0x3)
NMAGICSECTIONS: }
Modified: lld/trunk/test/elf/X86_64/omagic.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/omagic.test?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/omagic.test (original)
+++ lld/trunk/test/elf/X86_64/omagic.test Thu Sep 19 15:07:01 2013
@@ -7,7 +7,6 @@ RUN: llvm-readobj -sections %t | FileChe
RUN: llvm-readobj -program-headers %t | FileCheck -check-prefix=OMAGICPROGRAMHEADERS %s
OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 0
OMAGICSECTIONS: Name: (0)
OMAGICSECTIONS: Type: SHT_NULL (0x0)
OMAGICSECTIONS: Flags [ (0x0)
@@ -21,23 +20,7 @@ OMAGICSECTIONS: AddressAlignment: 0
OMAGICSECTIONS: EntrySize: 0
OMAGICSECTIONS: }
OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 1
-OMAGICSECTIONS: Name: .note.GNU-stack (1)
-OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
-OMAGICSECTIONS: Flags [ (0x2)
-OMAGICSECTIONS: SHF_ALLOC (0x2)
-OMAGICSECTIONS: ]
-OMAGICSECTIONS: Address: 0x4000B0
-OMAGICSECTIONS: Offset: 0xB0
-OMAGICSECTIONS: Size: 0
-OMAGICSECTIONS: Link: 0
-OMAGICSECTIONS: Info: 0
-OMAGICSECTIONS: AddressAlignment: 1
-OMAGICSECTIONS: EntrySize: 0
-OMAGICSECTIONS: }
-OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 2
-OMAGICSECTIONS: Name: .text (17)
+OMAGICSECTIONS: Name: .text
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
OMAGICSECTIONS: Flags [ (0x6)
OMAGICSECTIONS: SHF_ALLOC (0x2)
@@ -52,29 +35,13 @@ OMAGICSECTIONS: AddressAlignment: 4
OMAGICSECTIONS: EntrySize: 0
OMAGICSECTIONS: }
OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 3
-OMAGICSECTIONS: Name: .comment (23)
-OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
-OMAGICSECTIONS: Flags [ (0x2)
-OMAGICSECTIONS: SHF_ALLOC (0x2)
-OMAGICSECTIONS: ]
-OMAGICSECTIONS: Address: 0x4000BB
-OMAGICSECTIONS: Offset: 0xBB
-OMAGICSECTIONS: Size: 43
-OMAGICSECTIONS: Link: 0
-OMAGICSECTIONS: Info: 0
-OMAGICSECTIONS: AddressAlignment: 1
-OMAGICSECTIONS: EntrySize: 0
-OMAGICSECTIONS: }
-OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 4
-OMAGICSECTIONS: Name: .eh_frame (32)
+OMAGICSECTIONS: Name: .eh_frame
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
OMAGICSECTIONS: Flags [ (0x2)
OMAGICSECTIONS: SHF_ALLOC (0x2)
OMAGICSECTIONS: ]
-OMAGICSECTIONS: Address: 0x4000E8
-OMAGICSECTIONS: Offset: 0xE8
+OMAGICSECTIONS: Address: 0x4000C0
+OMAGICSECTIONS: Offset: 0xC0
OMAGICSECTIONS: Size: 56
OMAGICSECTIONS: Link: 0
OMAGICSECTIONS: Info: 0
@@ -82,16 +49,15 @@ OMAGICSECTIONS: AddressAlignment: 8
OMAGICSECTIONS: EntrySize: 0
OMAGICSECTIONS: }
OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 5
-OMAGICSECTIONS: Name: .tdata (42)
+OMAGICSECTIONS: Name: .tdata
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
OMAGICSECTIONS: Flags [ (0x403)
OMAGICSECTIONS: SHF_ALLOC (0x2)
OMAGICSECTIONS: SHF_TLS (0x400)
OMAGICSECTIONS: SHF_WRITE (0x1)
OMAGICSECTIONS: ]
-OMAGICSECTIONS: Address: 0x400120
-OMAGICSECTIONS: Offset: 0x120
+OMAGICSECTIONS: Address: 0x4000F8
+OMAGICSECTIONS: Offset: 0xF8
OMAGICSECTIONS: Size: 4
OMAGICSECTIONS: Link: 0
OMAGICSECTIONS: Info: 0
@@ -99,16 +65,15 @@ OMAGICSECTIONS: AddressAlignment: 4
OMAGICSECTIONS: EntrySize: 0
OMAGICSECTIONS: }
OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 6
-OMAGICSECTIONS: Name: .tbss (49)
+OMAGICSECTIONS: Name: .tbss
OMAGICSECTIONS: Type: SHT_NOBITS (0x8)
OMAGICSECTIONS: Flags [ (0x403)
OMAGICSECTIONS: SHF_ALLOC (0x2)
OMAGICSECTIONS: SHF_TLS (0x400)
OMAGICSECTIONS: SHF_WRITE (0x1)
OMAGICSECTIONS: ]
-OMAGICSECTIONS: Address: 0x400124
-OMAGICSECTIONS: Offset: 0x124
+OMAGICSECTIONS: Address: 0x4000FC
+OMAGICSECTIONS: Offset: 0xFC
OMAGICSECTIONS: Size: 8
OMAGICSECTIONS: Link: 0
OMAGICSECTIONS: Info: 0
@@ -116,15 +81,14 @@ OMAGICSECTIONS: AddressAlignment: 4
OMAGICSECTIONS: EntrySize: 0
OMAGICSECTIONS: }
OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 7
-OMAGICSECTIONS: Name: .got.plt (55)
+OMAGICSECTIONS: Name: .got.plt
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
OMAGICSECTIONS: Flags [ (0x3)
OMAGICSECTIONS: SHF_ALLOC (0x2)
OMAGICSECTIONS: SHF_WRITE (0x1)
OMAGICSECTIONS: ]
-OMAGICSECTIONS: Address: 0x400128
-OMAGICSECTIONS: Offset: 0x128
+OMAGICSECTIONS: Address: 0x400100
+OMAGICSECTIONS: Offset: 0x100
OMAGICSECTIONS: Size: 0
OMAGICSECTIONS: Link: 0
OMAGICSECTIONS: Info: 0
@@ -132,15 +96,14 @@ OMAGICSECTIONS: AddressAlignment: 8
OMAGICSECTIONS: EntrySize: 0
OMAGICSECTIONS: }
OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 8
-OMAGICSECTIONS: Name: .data (64)
+OMAGICSECTIONS: Name: .data
OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
OMAGICSECTIONS: Flags [ (0x3)
OMAGICSECTIONS: SHF_ALLOC (0x2)
OMAGICSECTIONS: SHF_WRITE (0x1)
OMAGICSECTIONS: ]
-OMAGICSECTIONS: Address: 0x400128
-OMAGICSECTIONS: Offset: 0x128
+OMAGICSECTIONS: Address: 0x400100
+OMAGICSECTIONS: Offset: 0x100
OMAGICSECTIONS: Size: 4
OMAGICSECTIONS: Link: 0
OMAGICSECTIONS: Info: 0
@@ -148,15 +111,14 @@ OMAGICSECTIONS: AddressAlignment: 4
OMAGICSECTIONS: EntrySize: 0
OMAGICSECTIONS: }
OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 9
-OMAGICSECTIONS: Name: .bss (70)
+OMAGICSECTIONS: Name: .bss
OMAGICSECTIONS: Type: SHT_NOBITS (0x8)
OMAGICSECTIONS: Flags [ (0x3)
OMAGICSECTIONS: SHF_ALLOC (0x2)
OMAGICSECTIONS: SHF_WRITE (0x1)
OMAGICSECTIONS: ]
-OMAGICSECTIONS: Address: 0x40012C
-OMAGICSECTIONS: Offset: 0x12C
+OMAGICSECTIONS: Address: 0x400104
+OMAGICSECTIONS: Offset: 0x104
OMAGICSECTIONS: Size: 0
OMAGICSECTIONS: Link: 0
OMAGICSECTIONS: Info: 0
@@ -164,13 +126,38 @@ OMAGICSECTIONS: AddressAlignment: 4
OMAGICSECTIONS: EntrySize: 0
OMAGICSECTIONS: }
OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 10
-OMAGICSECTIONS: Name: .shstrtab (75)
+OMAGICSECTIONS: Name: .comment
+OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
+OMAGICSECTIONS: Flags [ (0x0)
+OMAGICSECTIONS: ]
+OMAGICSECTIONS: Address: 0x0
+OMAGICSECTIONS: Offset: 0x104
+OMAGICSECTIONS: Size: 43
+OMAGICSECTIONS: Link: 0
+OMAGICSECTIONS: Info: 0
+OMAGICSECTIONS: AddressAlignment: 1
+OMAGICSECTIONS: EntrySize: 0
+OMAGICSECTIONS: }
+OMAGICSECTIONS: Section {
+OMAGICSECTIONS: Name: .note.GNU-stack
+OMAGICSECTIONS: Type: SHT_PROGBITS (0x1)
+OMAGICSECTIONS: Flags [ (0x0)
+OMAGICSECTIONS: ]
+OMAGICSECTIONS: Address: 0x0
+OMAGICSECTIONS: Offset: 0x12F
+OMAGICSECTIONS: Size: 0
+OMAGICSECTIONS: Link: 0
+OMAGICSECTIONS: Info: 0
+OMAGICSECTIONS: AddressAlignment: 1
+OMAGICSECTIONS: EntrySize: 0
+OMAGICSECTIONS: }
+OMAGICSECTIONS: Section {
+OMAGICSECTIONS: Name: .shstrtab
OMAGICSECTIONS: Type: SHT_STRTAB (0x3)
OMAGICSECTIONS: Flags [ (0x0)
OMAGICSECTIONS: ]
OMAGICSECTIONS: Address: 0x0
-OMAGICSECTIONS: Offset: 0x12C
+OMAGICSECTIONS: Offset: 0x12F
OMAGICSECTIONS: Size: 101
OMAGICSECTIONS: Link: 0
OMAGICSECTIONS: Info: 0
@@ -178,8 +165,7 @@ OMAGICSECTIONS: AddressAlignment: 1
OMAGICSECTIONS: EntrySize: 0
OMAGICSECTIONS: }
OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 11
-OMAGICSECTIONS: Name: .symtab (85)
+OMAGICSECTIONS: Name: .symtab
OMAGICSECTIONS: Type: SHT_SYMTAB (0x2)
OMAGICSECTIONS: Flags [ (0x0)
OMAGICSECTIONS: ]
@@ -192,8 +178,7 @@ OMAGICSECTIONS: AddressAlignment: 8
OMAGICSECTIONS: EntrySize: 24
OMAGICSECTIONS: }
OMAGICSECTIONS: Section {
-OMAGICSECTIONS: Index: 12
-OMAGICSECTIONS: Name: .strtab (93)
+OMAGICSECTIONS: Name: .strtab
OMAGICSECTIONS: Type: SHT_STRTAB (0x3)
OMAGICSECTIONS: Flags [ (0x0)
OMAGICSECTIONS: ]
@@ -212,8 +197,8 @@ OMAGICPROGRAMHEADERS: Type: PT_LOAD
OMAGICPROGRAMHEADERS: Offset: 0x0
OMAGICPROGRAMHEADERS: VirtualAddress: 0x400000
OMAGICPROGRAMHEADERS: PhysicalAddress: 0x400000
-OMAGICPROGRAMHEADERS: FileSize: 300
-OMAGICPROGRAMHEADERS: MemSize: 300
+OMAGICPROGRAMHEADERS: FileSize: 260
+OMAGICPROGRAMHEADERS: MemSize: 260
OMAGICPROGRAMHEADERS: Flags [ (0x7)
OMAGICPROGRAMHEADERS: PF_R (0x4)
OMAGICPROGRAMHEADERS: PF_W (0x2)
@@ -223,9 +208,9 @@ OMAGICPROGRAMHEADERS: Alignment: 8
OMAGICPROGRAMHEADERS: }
OMAGICPROGRAMHEADERS: ProgramHeader {
OMAGICPROGRAMHEADERS: Type: PT_TLS (0x7)
-OMAGICPROGRAMHEADERS: Offset: 0x120
-OMAGICPROGRAMHEADERS: VirtualAddress: 0x400120
-OMAGICPROGRAMHEADERS: PhysicalAddress: 0x400120
+OMAGICPROGRAMHEADERS: Offset: 0xF8
+OMAGICPROGRAMHEADERS: VirtualAddress: 0x4000F8
+OMAGICPROGRAMHEADERS: PhysicalAddress: 0x4000F8
OMAGICPROGRAMHEADERS: FileSize: 4
OMAGICPROGRAMHEADERS: MemSize: 12
OMAGICPROGRAMHEADERS: Flags [ (0x6)
Modified: lld/trunk/test/elf/X86_64/sectionmap.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/sectionmap.test?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/sectionmap.test (original)
+++ lld/trunk/test/elf/X86_64/sectionmap.test Thu Sep 19 15:07:01 2013
@@ -6,22 +6,17 @@ RUN: --noinhibit-exec -o %t
RUN: llvm-readobj -sections %t | FileCheck %s -check-prefix=VERIFYSECTIONHEADERS
VERIFYSECTIONHEADERS: Section {
-VERIFYSECTIONHEADERS: Index: 10
-VERIFYSECTIONHEADERS: Name: .data (80)
+VERIFYSECTIONHEADERS: Name: .data
VERIFYSECTIONHEADERS: }
VERIFYSECTIONHEADERS: Section {
-VERIFYSECTIONHEADERS: Index: 11
-VERIFYSECTIONHEADERS: Name: .gcc_except_table (86)
+VERIFYSECTIONHEADERS: Name: .gcc_except_table
VERIFYSECTIONHEADERS: }
VERIFYSECTIONHEADERS: Section {
-VERIFYSECTIONHEADERS: Index: 12
-VERIFYSECTIONHEADERS: Name: .data.rel.local (104)
+VERIFYSECTIONHEADERS: Name: .data.rel.local
VERIFYSECTIONHEADERS: }
VERIFYSECTIONHEADERS: Section {
-VERIFYSECTIONHEADERS: Index: 13
-VERIFYSECTIONHEADERS: Name: .data.rel.ro (120)
+VERIFYSECTIONHEADERS: Name: .data.rel.ro
VERIFYSECTIONHEADERS: }
VERIFYSECTIONHEADERS: Section {
-VERIFYSECTIONHEADERS: Index: 14
-VERIFYSECTIONHEADERS: Name: .bss (133)
+VERIFYSECTIONHEADERS: Name: .bss
VERIFYSECTIONHEADERS: }
Modified: lld/trunk/test/elf/X86_64/undef.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/undef.test?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/undef.test (original)
+++ lld/trunk/test/elf/X86_64/undef.test Thu Sep 19 15:07:01 2013
@@ -12,7 +12,7 @@ SYMFROMARCHIVE: Size: 11
SYMFROMARCHIVE: Binding: Global (0x1)
SYMFROMARCHIVE: Type: Function (0x2)
SYMFROMARCHIVE: Other: 0
-SYMFROMARCHIVE: Section: .text (0x6)
+SYMFROMARCHIVE: Section: .text
SYMFROMARCHIVE: }
CHECK-NOT: Name: fn
Modified: lld/trunk/test/elf/X86_64/underscore-end.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/underscore-end.test?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/underscore-end.test (original)
+++ lld/trunk/test/elf/X86_64/underscore-end.test Thu Sep 19 15:07:01 2013
@@ -45,7 +45,7 @@ NMAGICABSSYMBOLS: }
OMAGICABSSYMBOLS: Symbol {
OMAGICABSSYMBOLS: Name: __bss_start (51)
-OMAGICABSSYMBOLS: Value: 0x40012C
+OMAGICABSSYMBOLS: Value: 0x400104
OMAGICABSSYMBOLS: Size: 0
OMAGICABSSYMBOLS: Binding: Global (0x1)
OMAGICABSSYMBOLS: Type: Object (0x1)
@@ -54,7 +54,7 @@ OMAGICABSSYMBOLS: Section: (0xFFF1)
OMAGICABSSYMBOLS: }
OMAGICABSSYMBOLS: Symbol {
OMAGICABSSYMBOLS: Name: __bss_end (63)
-OMAGICABSSYMBOLS: Value: 0x40012C
+OMAGICABSSYMBOLS: Value: 0x400104
OMAGICABSSYMBOLS: Size: 0
OMAGICABSSYMBOLS: Binding: Global (0x1)
OMAGICABSSYMBOLS: Type: Object (0x1)
@@ -63,7 +63,7 @@ OMAGICABSSYMBOLS: Section: (0xFFF1)
OMAGICABSSYMBOLS: }
OMAGICABSSYMBOLS: Symbol {
OMAGICABSSYMBOLS: Name: _end (73)
-OMAGICABSSYMBOLS: Value: 0x40012C
+OMAGICABSSYMBOLS: Value: 0x400104
OMAGICABSSYMBOLS: Size: 0
OMAGICABSSYMBOLS: Binding: Global (0x1)
OMAGICABSSYMBOLS: Type: Object (0x1)
@@ -72,7 +72,7 @@ OMAGICABSSYMBOLS: Section: (0xFFF1)
OMAGICABSSYMBOLS: }
OMAGICABSSYMBOLS: Symbol {
OMAGICABSSYMBOLS: Name: end (78)
-OMAGICABSSYMBOLS: Value: 0x40012C
+OMAGICABSSYMBOLS: Value: 0x400104
OMAGICABSSYMBOLS: Size: 0
OMAGICABSSYMBOLS: Binding: Global (0x1)
OMAGICABSSYMBOLS: Type: Object (0x1)
Modified: lld/trunk/test/elf/X86_64/yamlinput.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/yamlinput.test?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/yamlinput.test (original)
+++ lld/trunk/test/elf/X86_64/yamlinput.test Thu Sep 19 15:07:01 2013
@@ -48,24 +48,24 @@ SECTIONS: ]
SECTIONS: }
SECTIONS: Section {
SECTIONS: Index: 5
-SECTIONS: Name: .note.GNU-stack (31)
+SECTIONS: Name: .text (31)
SECTIONS: Type: SHT_PROGBITS (0x1)
-SECTIONS: Flags [ (0x2)
+SECTIONS: Flags [ (0x6)
SECTIONS: SHF_ALLOC (0x2)
+SECTIONS: SHF_EXECINSTR (0x4)
SECTIONS: ]
SECTIONS: }
SECTIONS: Section {
SECTIONS: Index: 6
-SECTIONS: Name: .text (47)
+SECTIONS: Name: .rodata (37)
SECTIONS: Type: SHT_PROGBITS (0x1)
-SECTIONS: Flags [ (0x6)
+SECTIONS: Flags [ (0x2)
SECTIONS: SHF_ALLOC (0x2)
-SECTIONS: SHF_EXECINSTR (0x4)
SECTIONS: ]
SECTIONS: }
SECTIONS: Section {
SECTIONS: Index: 7
-SECTIONS: Name: .rodata (53)
+SECTIONS: Name: .eh_frame (45)
SECTIONS: Type: SHT_PROGBITS (0x1)
SECTIONS: Flags [ (0x2)
SECTIONS: SHF_ALLOC (0x2)
@@ -73,23 +73,25 @@ SECTIONS: ]
SECTIONS: }
SECTIONS: Section {
SECTIONS: Index: 8
-SECTIONS: Name: .comment (61)
+SECTIONS: Name: .init_array (55)
SECTIONS: Type: SHT_PROGBITS (0x1)
-SECTIONS: Flags [ (0x2)
+SECTIONS: Flags [ (0x3)
SECTIONS: SHF_ALLOC (0x2)
+SECTIONS: SHF_WRITE (0x1)
SECTIONS: ]
SECTIONS: }
SECTIONS: Section {
SECTIONS: Index: 9
-SECTIONS: Name: .eh_frame (70)
+SECTIONS: Name: .fini_array (67)
SECTIONS: Type: SHT_PROGBITS (0x1)
-SECTIONS: Flags [ (0x2)
+SECTIONS: Flags [ (0x3)
SECTIONS: SHF_ALLOC (0x2)
+SECTIONS: SHF_WRITE (0x1)
SECTIONS: ]
SECTIONS: }
SECTIONS: Section {
SECTIONS: Index: 10
-SECTIONS: Name: .init_array (80)
+SECTIONS: Name: .dynamic (79)
SECTIONS: Type: SHT_PROGBITS (0x1)
SECTIONS: Flags [ (0x3)
SECTIONS: SHF_ALLOC (0x2)
@@ -98,7 +100,7 @@ SECTIONS: ]
SECTIONS: }
SECTIONS: Section {
SECTIONS: Index: 11
-SECTIONS: Name: .fini_array (92)
+SECTIONS: Name: .got.plt (88)
SECTIONS: Type: SHT_PROGBITS (0x1)
SECTIONS: Flags [ (0x3)
SECTIONS: SHF_ALLOC (0x2)
@@ -107,7 +109,7 @@ SECTIONS: ]
SECTIONS: }
SECTIONS: Section {
SECTIONS: Index: 12
-SECTIONS: Name: .dynamic (104)
+SECTIONS: Name: .data (97)
SECTIONS: Type: SHT_PROGBITS (0x1)
SECTIONS: Flags [ (0x3)
SECTIONS: SHF_ALLOC (0x2)
@@ -116,8 +118,8 @@ SECTIONS: ]
SECTIONS: }
SECTIONS: Section {
SECTIONS: Index: 13
-SECTIONS: Name: .got.plt (113)
-SECTIONS: Type: SHT_PROGBITS (0x1)
+SECTIONS: Name: .bss (103)
+SECTIONS: Type: SHT_NOBITS (0x8)
SECTIONS: Flags [ (0x3)
SECTIONS: SHF_ALLOC (0x2)
SECTIONS: SHF_WRITE (0x1)
@@ -125,20 +127,16 @@ SECTIONS: ]
SECTIONS: }
SECTIONS: Section {
SECTIONS: Index: 14
-SECTIONS: Name: .data (122)
+SECTIONS: Name: .comment (108)
SECTIONS: Type: SHT_PROGBITS (0x1)
-SECTIONS: Flags [ (0x3)
-SECTIONS: SHF_ALLOC (0x2)
-SECTIONS: SHF_WRITE (0x1)
+SECTIONS: Flags [ (0x0)
SECTIONS: ]
SECTIONS: }
SECTIONS: Section {
SECTIONS: Index: 15
-SECTIONS: Name: .bss (128)
-SECTIONS: Type: SHT_NOBITS (0x8)
-SECTIONS: Flags [ (0x3)
-SECTIONS: SHF_ALLOC (0x2)
-SECTIONS: SHF_WRITE (0x1)
+SECTIONS: Name: .note.GNU-stack (117)
+SECTIONS: Type: SHT_PROGBITS (0x1)
+SECTIONS: Flags [ (0x0)
SECTIONS: ]
SECTIONS: }
SECTIONS: Section {
Modified: lld/trunk/test/elf/phdr.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/phdr.test?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/test/elf/phdr.test (original)
+++ lld/trunk/test/elf/phdr.test Thu Sep 19 15:07:01 2013
@@ -36,8 +36,8 @@ I386-NEXT: Type: PT_LOAD (0x1)
I386-NEXT: Offset: 0x0
I386-NEXT: VirtualAddress: 0x0
I386-NEXT: PhysicalAddress: 0x0
-I386-NEXT: FileSize: 532
-I386-NEXT: MemSize: 532
+I386-NEXT: FileSize: 516
+I386-NEXT: MemSize: 516
I386-NEXT: Flags [ (0x5)
I386-NEXT: PF_R (0x4)
I386-NEXT: PF_X (0x1)
@@ -72,9 +72,9 @@ I386-NEXT: Alignment: 4096
I386-NEXT: }
I386-NEXT: ProgramHeader {
I386-NEXT: Type: PT_DYNAMIC (0x2)
-I386-NEXT: Offset: 0x1E4
-I386-NEXT: VirtualAddress: 0x1E4
-I386-NEXT: PhysicalAddress: 0x1E4
+I386-NEXT: Offset: 0x1D4
+I386-NEXT: VirtualAddress: 0x1D4
+I386-NEXT: PhysicalAddress: 0x1D4
I386-NEXT: FileSize: 48
I386-NEXT: MemSize: 48
I386-NEXT: Flags [ (0x4)
Modified: lld/trunk/test/elf/tlsAddr.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/tlsAddr.test?rev=191032&r1=191031&r2=191032&view=diff
==============================================================================
--- lld/trunk/test/elf/tlsAddr.test (original)
+++ lld/trunk/test/elf/tlsAddr.test Thu Sep 19 15:07:01 2013
@@ -4,4 +4,4 @@ RUN: lld -flavor gnu -target x86_64-linu
RUN: -o %t --noinhibit-exec
RUN: llvm-objdump -section-headers %t | FileCheck -check-prefix=CHECKADDR %s
-CHECKADDR: 8 .data 00000000 0000000000401008 DATA
+CHECKADDR: {{[0-9]+}} .data 00000000 0000000000401008 DATA
More information about the llvm-commits
mailing list