[llvm-commits] [lld] r166189 - in /lld/trunk: include/lld/Core/ lib/ReaderWriter/ELF/ lib/ReaderWriter/Native/ lib/ReaderWriter/PECOFF/ lib/ReaderWriter/YAML/ test/elf/ test/elf/Inputs/
Sid Manning
sidneym at codeaurora.org
Thu Oct 18 10:16:20 PDT 2012
Author: sidneym
Date: Thu Oct 18 12:16:19 2012
New Revision: 166189
URL: http://llvm.org/viewvc/llvm-project?rev=166189&view=rev
Log:
This update does the following:
* Moves enum Scope from DefinedAtom.h to Atom.h
* Adds scope method to AbsoluteAtom class
* Updates YAML to print scope of AbsoluteAtoms
* Update Native Reader/Writer to handle this new, "attribute"
* Adds testcase
Reviewed and approved by Nick Kledzik
Added:
lld/trunk/test/elf/Inputs/abs-test.i386 (with props)
lld/trunk/test/elf/abs.objtxt
Modified:
lld/trunk/include/lld/Core/AbsoluteAtom.h
lld/trunk/include/lld/Core/Atom.h
lld/trunk/include/lld/Core/DefinedAtom.h
lld/trunk/lib/ReaderWriter/ELF/ReaderELF.cpp
lld/trunk/lib/ReaderWriter/ELF/WriterELF.cpp
lld/trunk/lib/ReaderWriter/Native/NativeFileFormat.h
lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp
lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp
lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
lld/trunk/lib/ReaderWriter/YAML/ReaderYAML.cpp
lld/trunk/lib/ReaderWriter/YAML/WriterYAML.cpp
lld/trunk/lib/ReaderWriter/YAML/YamlKeyValues.cpp
lld/trunk/lib/ReaderWriter/YAML/YamlKeyValues.h
Modified: lld/trunk/include/lld/Core/AbsoluteAtom.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/AbsoluteAtom.h?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/AbsoluteAtom.h (original)
+++ lld/trunk/include/lld/Core/AbsoluteAtom.h Thu Oct 18 12:16:19 2012
@@ -18,8 +18,16 @@
/// It exists to represent content at fixed addresses in memory.
class AbsoluteAtom : public Atom {
public:
+
virtual uint64_t value() const = 0;
+ /// scope - The visibility of this atom to other atoms. C static functions
+ /// have scope scopeTranslationUnit. Regular C functions have scope
+ /// scopeGlobal. Functions compiled with visibility=hidden have scope
+ /// scopeLinkageUnit so they can be see by other atoms being linked but not
+ /// by the OS loader.
+ virtual Scope scope() const = 0;
+
static inline bool classof(const Atom *a) {
return a->definition() == definitionAbsolute;
}
Modified: lld/trunk/include/lld/Core/Atom.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Atom.h?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/Atom.h (original)
+++ lld/trunk/include/lld/Core/Atom.h Thu Oct 18 12:16:19 2012
@@ -41,6 +41,17 @@
definitionSharedLibrary ///< Only in shared libraries to model export.
};
+ /// The scope in which this atom is acessible to other atoms.
+ enum Scope {
+ scopeTranslationUnit, ///< Accessible only to atoms in the same translation
+ /// unit (e.g. a C static).
+ scopeLinkageUnit, ///< Accessible to atoms being linked but not visible
+ /// to runtime loader (e.g. visibility=hidden).
+ scopeGlobal ///< Accessible to all atoms and visible to runtime
+ /// loader (e.g. visibility=default).
+ };
+
+
/// file - returns the File that produced/owns this Atom
virtual const class File& file() const = 0;
Modified: lld/trunk/include/lld/Core/DefinedAtom.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/DefinedAtom.h?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/DefinedAtom.h (original)
+++ lld/trunk/include/lld/Core/DefinedAtom.h Thu Oct 18 12:16:19 2012
@@ -88,16 +88,6 @@
///
class DefinedAtom : public Atom {
public:
- /// The scope in which this atom is acessible to other atoms.
- enum Scope {
- scopeTranslationUnit, ///< Accessible only to atoms in the same translation
- /// unit (e.g. a C static).
- scopeLinkageUnit, ///< Accessible to atoms being linked but not visible
- /// to runtime loader (e.g. visibility=hidden).
- scopeGlobal ///< Accessible to all atoms and visible to runtime
- /// loader (e.g. visibility=default).
- };
-
enum Interposable {
interposeNo, // linker can directly bind uses of this atom
interposeYes, // linker must indirect (through GOT) uses
Modified: lld/trunk/lib/ReaderWriter/ELF/ReaderELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ReaderELF.cpp?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ReaderELF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ReaderELF.cpp Thu Oct 18 12:16:19 2012
@@ -11,7 +11,6 @@
// to consume an ELF file and produces atoms out of it.
//
//===----------------------------------------------------------------------===//
-
#include "lld/ReaderWriter/ReaderELF.h"
#include "lld/Core/File.h"
#include "lld/Core/Reference.h"
@@ -115,14 +114,18 @@
/// particular address. This atom has no content its address will be used by
/// the writer to fixup references that point to it.
template<llvm::support::endianness target_endianness, bool is64Bits>
-class ELFAbsoluteAtom final: public AbsoluteAtom {
+class ELFAbsoluteAtom final : public AbsoluteAtom {
+
+ typedef llvm::object::Elf_Sym_Impl<target_endianness, is64Bits> Elf_Sym;
public:
ELFAbsoluteAtom(const File &file,
llvm::StringRef name,
+ const Elf_Sym *symbol,
uint64_t value)
: _owningFile(file)
, _name(name)
+ , _symbol(symbol)
, _value(value)
{}
@@ -130,6 +133,15 @@
return _owningFile;
}
+ virtual Scope scope() const {
+ if (_symbol->st_other == llvm::ELF::STV_HIDDEN)
+ return scopeLinkageUnit;
+ if (_symbol->getBinding() == llvm::ELF::STB_LOCAL)
+ return scopeTranslationUnit;
+ else
+ return scopeGlobal;
+ }
+
virtual llvm::StringRef name() const {
return _name;
}
@@ -141,6 +153,7 @@
private:
const File &_owningFile;
llvm::StringRef _name;
+ const Elf_Sym *_symbol;
uint64_t _value;
};
@@ -308,6 +321,7 @@
ret = typeZeroFill;
break;
}
+
return ret;
}
@@ -319,7 +333,6 @@
|| _symbol->st_shndx == llvm::ELF::SHN_COMMON) {
return Alignment(llvm::Log2_64(_symbol->st_value));
}
-
return Alignment(llvm::Log2_64(_section->sh_addralign));
}
@@ -422,7 +435,6 @@
llvm::StringRef _sectionName;
const Elf_Sym *_symbol;
const Elf_Shdr *_section;
-
// _contentData will hold the bits that make up the atom.
llvm::ArrayRef<uint8_t> _contentData;
@@ -543,7 +555,7 @@
auto *newAtom = new (_readerStorage.Allocate
<ELFAbsoluteAtom<target_endianness, is64Bits> > ())
ELFAbsoluteAtom<target_endianness, is64Bits>
- (*this, symbolName, symbol->st_value);
+ (*this, symbolName, symbol, symbol->st_value);
_absoluteAtoms._atoms.push_back(newAtom);
_symbolToAtomMapping.insert(std::make_pair(symbol, newAtom));
Modified: lld/trunk/lib/ReaderWriter/ELF/WriterELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/WriterELF.cpp?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/WriterELF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/WriterELF.cpp Thu Oct 18 12:16:19 2012
@@ -601,14 +601,28 @@
b = ELF::STB_WEAK;
else
b = ELF::STB_GLOBAL;
- } else if (const AbsoluteAtom *aa = llvm::dyn_cast<const AbsoluteAtom>(a)){
+ } else if (const AbsoluteAtom *aa = llvm::dyn_cast<const AbsoluteAtom>(a)){
//FIXME: Absolute atoms need more properties to differentiate each other
// based on binding and type of symbol
- symbol->st_value = aa->value();
+ t = ELF::STT_OBJECT;
+
+ switch (aa->scope()) {
+ case AbsoluteAtom::scopeLinkageUnit:
+ symbol->st_other = ELF::STV_HIDDEN;
+ b = ELF::STB_LOCAL;
+ break;
+ case AbsoluteAtom::scopeTranslationUnit:
+ b = ELF::STB_LOCAL;
+ break;
+ case AbsoluteAtom::scopeGlobal:
+ b = ELF::STB_GLOBAL;
+ break;
+ }
+ symbol->st_value = aa->value();
} else {
- symbol->st_value = 0;
- t = ELF::STT_NOTYPE;
- b = ELF::STB_LOCAL;
+ symbol->st_value = 0;
+ t = ELF::STT_NOTYPE;
+ b = ELF::STB_LOCAL;
}
symbol->setBindingAndType(b, t);
Modified: lld/trunk/lib/ReaderWriter/Native/NativeFileFormat.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/NativeFileFormat.h?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/NativeFileFormat.h (original)
+++ lld/trunk/lib/ReaderWriter/Native/NativeFileFormat.h Thu Oct 18 12:16:19 2012
@@ -89,6 +89,7 @@
enum NativeChunkSignatures {
NCS_DefinedAtomsV1 = 1,
NCS_AttributesArrayV1 = 2,
+ NCS_AbsoluteAttributesV1 = 12,
NCS_UndefinedAtomsV1 = 3,
NCS_SharedLibraryAtomsV1 = 4,
NCS_AbsoluteAtomsV1 = 5,
@@ -183,6 +184,7 @@
//
struct NativeAbsoluteAtomIvarsV1 {
uint32_t nameOffset;
+ uint32_t attributesOffset;
uint32_t reserved;
uint64_t value;
};
Modified: lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp (original)
+++ lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp Thu Oct 18 12:16:19 2012
@@ -175,12 +175,16 @@
virtual const lld::File& file() const;
virtual StringRef name() const;
-
+ virtual Scope scope() const {
+ const NativeAtomAttributesV1& attr = absAttributes();
+ return (Scope)(attr.scope);
+ }
virtual uint64_t value() const {
return _ivarData->value;
}
private:
+ const NativeAtomAttributesV1& absAttributes() const;
const File *_file;
const NativeAbsoluteAtomIvarsV1 *_ivarData;
};
@@ -289,6 +293,9 @@
case NCS_AbsoluteAtomsV1:
ec = file->processAbsoluteAtomsV1(base, chunk);
break;
+ case NCS_AbsoluteAttributesV1:
+ ec = file->processAbsoluteAttributesV1(base, chunk);
+ break;
case NCS_ReferencesArrayV1:
ec = file->processReferencesV1(base, chunk);
break;
@@ -425,6 +432,19 @@
return make_error_code(native_reader_error::success);
}
+ // set up pointers to attributes array
+ error_code processAbsoluteAttributesV1(const uint8_t *base,
+ const NativeChunk *chunk) {
+ this->_absAttributes = base + chunk->fileOffset;
+ this->_absAbsoluteMaxOffset = chunk->fileSize;
+ DEBUG_WITH_TYPE("ReaderNative", llvm::dbgs()
+ << " chunk AbsoluteAttributesV1: "
+ << " count=" << chunk->elementCount
+ << " chunkSize=" << chunk->fileSize
+ << "\n");
+ return make_error_code(native_reader_error::success);
+ }
+
// instantiate array of UndefinedAtoms from v1 ivar data in file
error_code processUndefinedAtomsV1(const uint8_t *base,
const NativeChunk *chunk) {
@@ -677,6 +697,11 @@
return *reinterpret_cast<const NativeAtomAttributesV1*>(_attributes + off);
}
+ const NativeAtomAttributesV1& absAttribute(uint32_t off) const {
+ assert(off < _absAbsoluteMaxOffset);
+ return *reinterpret_cast<const NativeAtomAttributesV1*>(_absAttributes + off);
+ }
+
const uint8_t* content(uint32_t offset, uint32_t size) const {
const uint8_t* result = _contentStart + offset;
assert((result+size) <= _contentEnd);
@@ -768,6 +793,8 @@
AtomArray<UndefinedAtom> _undefinedAtoms;
AtomArray<SharedLibraryAtom> _sharedLibraryAtoms;
AtomArray<AbsoluteAtom> _absoluteAtoms;
+ const uint8_t* _absAttributes;
+ uint32_t _absAbsoluteMaxOffset;
const uint8_t* _attributes;
uint32_t _attributesMaxOffset;
IvarArray _references;
@@ -868,6 +895,9 @@
return _file->string(_ivarData->nameOffset);
}
+inline const NativeAtomAttributesV1& NativeAbsoluteAtomV1::absAttributes() const {
+ return _file->absAttribute(_ivarData->attributesOffset);
+}
inline const Atom* NativeReferenceV1::target() const {
return _file->target(_ivarData->targetIndex);
Modified: lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp (original)
+++ lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp Thu Oct 18 12:16:19 2012
@@ -102,6 +102,11 @@
_absoluteAtomIvars.size()
* sizeof(NativeAbsoluteAtomIvarsV1));
}
+ if (!_absAttributes.empty()) {
+ assert( out.tell() == findChunk(NCS_AbsoluteAttributesV1).fileOffset );
+ out.write((char*)&_absAttributes[0],
+ _absAttributes.size()*sizeof(NativeAtomAttributesV1));
+ }
if (!_stringPool.empty()) {
assert( out.tell() == findChunk(NCS_Strings).fileOffset );
@@ -164,6 +169,7 @@
_absoluteAtomIndex[&atom] = _absoluteAtomIvars.size();
NativeAbsoluteAtomIvarsV1 ivar;
ivar.nameOffset = getNameOffset(atom);
+ ivar.attributesOffset = getAttributeOffset(atom);
ivar.reserved = 0;
ivar.value = atom.value();
_absoluteAtomIvars.push_back(ivar);
@@ -184,7 +190,7 @@
if ( hasDefines ) chunkCount += 2;
if ( hasUndefines ) ++chunkCount;
if ( hasSharedLibraries ) ++chunkCount;
- if ( hasAbsolutes ) ++chunkCount;
+ if ( hasAbsolutes ) chunkCount += 2;
if ( hasReferences ) ++chunkCount;
if ( hasTargetsTable ) ++chunkCount;
if ( hasAddendTable ) ++chunkCount;
@@ -247,13 +253,21 @@
// create chunk for shared library atom array
if ( hasAbsolutes ) {
- NativeChunk& chsl = chunks[nextIndex++];
- chsl.signature = NCS_AbsoluteAtomsV1;
- chsl.fileOffset = nextFileOffset;
- chsl.fileSize = _absoluteAtomIvars.size() *
+ NativeChunk& chabs = chunks[nextIndex++];
+ chabs.signature = NCS_AbsoluteAtomsV1;
+ chabs.fileOffset = nextFileOffset;
+ chabs.fileSize = _absoluteAtomIvars.size() *
sizeof(NativeAbsoluteAtomIvarsV1);
- chsl.elementCount = _absoluteAtomIvars.size();
- nextFileOffset = chsl.fileOffset + chsl.fileSize;
+ chabs.elementCount = _absoluteAtomIvars.size();
+ nextFileOffset = chabs.fileOffset + chabs.fileSize;
+
+ // create chunk for attributes
+ NativeChunk& cha = chunks[nextIndex++];
+ cha.signature = NCS_AbsoluteAttributesV1;
+ cha.fileOffset = nextFileOffset;
+ cha.fileSize = _absAttributes.size()*sizeof(NativeAtomAttributesV1);
+ cha.elementCount = _absAttributes.size();
+ nextFileOffset = cha.fileOffset + cha.fileSize;
}
// create chunk for symbol strings
@@ -380,6 +394,21 @@
return result;
}
+ uint32_t getAttributeOffset(const class AbsoluteAtom& atom) {
+ NativeAtomAttributesV1 attrs;
+ computeAbsoluteAttributes(atom, attrs);
+ for(unsigned int i=0; i < _absAttributes.size(); ++i) {
+ if ( !memcmp(&_absAttributes[i], &attrs, sizeof(NativeAtomAttributesV1)) ) {
+ // found that this set of attributes already used, so re-use
+ return i * sizeof(NativeAtomAttributesV1);
+ }
+ }
+ // append new attribute set to end
+ uint32_t result = _absAttributes.size() * sizeof(NativeAtomAttributesV1);
+ _absAttributes.push_back(attrs);
+ return result;
+ }
+
uint32_t sectionNameOffset(const class DefinedAtom& atom) {
// if section based on content, then no custom section name available
if ( atom.sectionChoice() == DefinedAtom::sectionBasedOnContent )
@@ -414,6 +443,11 @@
attrs.alias = atom.isAlias();
}
+ void computeAbsoluteAttributes(const class AbsoluteAtom& atom,
+ NativeAtomAttributesV1& attrs) {
+ attrs.scope = atom.scope();
+ }
+
// add references for this atom in a contiguous block in NCS_ReferencesArrayV1
uint32_t getReferencesIndex(const DefinedAtom& atom, unsigned& count) {
count = 0;
@@ -528,6 +562,7 @@
std::vector<uint8_t> _contentPool;
std::vector<NativeDefinedAtomIvarsV1> _definedAtomIvars;
std::vector<NativeAtomAttributesV1> _attributes;
+ std::vector<NativeAtomAttributesV1> _absAttributes;
std::vector<NativeUndefinedAtomIvarsV1> _undefinedAtomIvars;
std::vector<NativeSharedLibraryAtomIvarsV1> _sharedLibraryAtomIvars;
std::vector<NativeAbsoluteAtomIvarsV1> _absoluteAtomIvars;
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp Thu Oct 18 12:16:19 2012
@@ -39,6 +39,10 @@
return OwningFile;
}
+ virtual Scope scope() const {
+ return scopeGlobal;
+ }
+
virtual llvm::StringRef name() const {
return Name;
}
Modified: lld/trunk/lib/ReaderWriter/YAML/ReaderYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/ReaderYAML.cpp?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/YAML/ReaderYAML.cpp (original)
+++ lld/trunk/lib/ReaderWriter/YAML/ReaderYAML.cpp Thu Oct 18 12:16:19 2012
@@ -429,6 +429,10 @@
return _file;
}
+ virtual Scope scope() const {
+ return scopeGlobal;
+ }
+
virtual StringRef name() const {
return _name;
}
Modified: lld/trunk/lib/ReaderWriter/YAML/WriterYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/WriterYAML.cpp?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/YAML/WriterYAML.cpp (original)
+++ lld/trunk/lib/ReaderWriter/YAML/WriterYAML.cpp Thu Oct 18 12:16:19 2012
@@ -412,6 +412,14 @@
<< KeyValues::definition(atom.definition())
<< "\n";
+ if ( atom.scope() != KeyValues::scopeDefault ) {
+ out << " "
+ << "scope:"
+ << spacePadding(strlen("scope"))
+ << KeyValues::scope(atom.scope())
+ << "\n";
+ }
+
out << " "
<< "value:"
<< spacePadding(strlen("value"))
Modified: lld/trunk/lib/ReaderWriter/YAML/YamlKeyValues.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/YamlKeyValues.cpp?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/YAML/YamlKeyValues.cpp (original)
+++ lld/trunk/lib/ReaderWriter/YAML/YamlKeyValues.cpp Thu Oct 18 12:16:19 2012
@@ -75,10 +75,10 @@
};
static const ScopeMapping scopeMappings[] = {
- { "global", DefinedAtom::scopeGlobal },
- { "hidden", DefinedAtom::scopeLinkageUnit },
- { "static", DefinedAtom::scopeTranslationUnit },
- { nullptr, DefinedAtom::scopeGlobal }
+ { "global", Atom::scopeGlobal },
+ { "hidden", Atom::scopeLinkageUnit },
+ { "static", Atom::scopeTranslationUnit },
+ { nullptr, Atom::scopeGlobal }
};
bool KeyValues::scope(StringRef s, DefinedAtom::Scope &out)
@@ -92,7 +92,7 @@
return true;
}
-const char* KeyValues::scope(DefinedAtom::Scope s) {
+const char* KeyValues::scope(Atom::Scope s) {
for (const ScopeMapping* p = scopeMappings; p->string != nullptr; ++p) {
if ( p->value == s )
return p->string;
@@ -106,7 +106,6 @@
-
struct ContentTypeMapping {
const char* string;
DefinedAtom::ContentType value;
Modified: lld/trunk/lib/ReaderWriter/YAML/YamlKeyValues.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/YamlKeyValues.h?rev=166189&r1=166188&r2=166189&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/YAML/YamlKeyValues.h (original)
+++ lld/trunk/lib/ReaderWriter/YAML/YamlKeyValues.h Thu Oct 18 12:16:19 2012
@@ -29,7 +29,7 @@
static const char* const scopeKeyword;
static const DefinedAtom::Scope scopeDefault;
static bool scope(StringRef, DefinedAtom::Scope&);
- static const char* scope(DefinedAtom::Scope);
+ static const char* scope(Atom::Scope);
static const char* const contentTypeKeyword;
static const DefinedAtom::ContentType contentTypeDefault;
Added: lld/trunk/test/elf/Inputs/abs-test.i386
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Inputs/abs-test.i386?rev=166189&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lld/trunk/test/elf/Inputs/abs-test.i386
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: lld/trunk/test/elf/abs.objtxt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/abs.objtxt?rev=166189&view=auto
==============================================================================
--- lld/trunk/test/elf/abs.objtxt (added)
+++ lld/trunk/test/elf/abs.objtxt Thu Oct 18 12:16:19 2012
@@ -0,0 +1,21 @@
+#
+# Source File:
+# .local absGlobalSymbol
+# .set absLocalSymbol,0xC0000
+# .type absLocalSymbol, @object
+# .globl absGlobalSymbol
+# .set absGlobalSymbol,0xD0000
+# .type absGlobalSymbol, @object
+
+# built using: "gcc -m32"
+#
+RUN: lld-core -reader ELF %p/Inputs/abs-test.i386 | FileCheck -check-prefix=YAML %s
+
+YAML: - name: absLocalSymbol
+YAML: definition: absolute
+YAML: value: 0xc0000
+
+YAML: - name: absGlobalSymbol
+YAML: definition: absolute
+YAML: scope: global
+YAML: value: 0xd0000
More information about the llvm-commits
mailing list