[lld] r207886 - Revert "Remove dead code."
Rui Ueyama
ruiu at google.com
Fri May 2 16:45:28 PDT 2014
Author: ruiu
Date: Fri May 2 18:45:28 2014
New Revision: 207886
URL: http://llvm.org/viewvc/llvm-project?rev=207886&view=rev
Log:
Revert "Remove dead code."
This reverts commit r207884 which was prematurely committed by accident.
Modified:
lld/trunk/include/lld/Core/DefinedAtom.h
lld/trunk/include/lld/ReaderWriter/Simple.h
lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp
lld/trunk/lib/ReaderWriter/ELF/Atoms.h
lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp
lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp
lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h
lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
Modified: lld/trunk/include/lld/Core/DefinedAtom.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/DefinedAtom.h?rev=207886&r1=207885&r2=207886&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/DefinedAtom.h (original)
+++ lld/trunk/include/lld/Core/DefinedAtom.h Fri May 2 18:45:28 2014
@@ -270,6 +270,12 @@ public:
/// is R__.
virtual ContentPermissions permissions() const;
+ /// \brief means this is a zero size atom that exists to provide an alternate
+ /// name for another atom. Alias atoms must have a special Reference to the
+ /// atom they alias which the layout engine recognizes and forces the alias
+ /// atom to layout right before the target atom.
+ virtual bool isAlias() const = 0;
+
/// \brief returns a reference to the raw (unrelocated) bytes of this Atom's
/// content.
virtual ArrayRef<uint8_t> rawContent() const = 0;
Modified: lld/trunk/include/lld/ReaderWriter/Simple.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/Simple.h?rev=207886&r1=207885&r2=207886&view=diff
==============================================================================
--- lld/trunk/include/lld/ReaderWriter/Simple.h (original)
+++ lld/trunk/include/lld/ReaderWriter/Simple.h Fri May 2 18:45:28 2014
@@ -140,6 +140,8 @@ public:
return DefinedAtom::deadStripNormal;
}
+ bool isAlias() const override { return false; }
+
DefinedAtom::reference_iterator begin() const override {
uintptr_t index = 0;
const void *it = reinterpret_cast<const void *>(index);
Modified: lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp?rev=207886&r1=207885&r2=207886&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp Fri May 2 18:45:28 2014
@@ -63,6 +63,8 @@ public:
return DefinedAtom::permR_X;
}
+ bool isAlias() const override { return false; }
+
ArrayRef<uint8_t> rawContent() const override { return ArrayRef<uint8_t>(); }
reference_iterator begin() const override {
@@ -126,6 +128,8 @@ public:
return DefinedAtom::permRW_;
}
+ bool isAlias() const override { return false; }
+
ArrayRef<uint8_t> rawContent() const override { return ArrayRef<uint8_t>(); }
reference_iterator begin() const override {
@@ -269,3 +273,4 @@ void CoreLinkingContext::addPasses(PassM
}
Writer &CoreLinkingContext::writer() const { return *_writer; }
+
Modified: lld/trunk/lib/ReaderWriter/ELF/Atoms.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Atoms.h?rev=207886&r1=207885&r2=207886&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Atoms.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Atoms.h Fri May 2 18:45:28 2014
@@ -381,6 +381,9 @@ public:
}
}
+ // FIXME: Not Sure if ELF supports alias atoms. Find out more.
+ bool isAlias() const override { return false; }
+
ArrayRef<uint8_t> rawContent() const override { return _contentData; }
DefinedAtom::reference_iterator begin() const override {
@@ -484,6 +487,8 @@ public:
virtual bool isThumb() const { return false; }
+ bool isAlias() const override { return false; }
+
ArrayRef<uint8_t> rawContent() const override { return _contentData; }
DefinedAtom::reference_iterator begin() const override {
@@ -566,6 +571,8 @@ public:
ContentPermissions permissions() const override { return permRW_; }
+ bool isAlias() const override { return false; }
+
ArrayRef<uint8_t> rawContent() const override { return ArrayRef<uint8_t>(); }
DefinedAtom::reference_iterator begin() const override {
Modified: lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp?rev=207886&r1=207885&r2=207886&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp (original)
+++ lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp Fri May 2 18:45:28 2014
@@ -98,6 +98,10 @@ public:
return (DefinedAtom::ContentPermissions)(attributes().permissions);
}
+ bool isAlias() const override {
+ return (attributes().alias != 0);
+ }
+
ArrayRef<uint8_t> rawContent() const override;
reference_iterator begin() const override;
Modified: lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp?rev=207886&r1=207885&r2=207886&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp (original)
+++ lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp Fri May 2 18:45:28 2014
@@ -431,6 +431,7 @@ private:
attrs.deadStrip = atom.deadStrip();
attrs.dynamicExport = atom.dynamicExport();
attrs.permissions = atom.permissions();
+ attrs.alias = atom.isAlias();
return attrs;
}
Modified: lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h?rev=207886&r1=207885&r2=207886&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h Fri May 2 18:45:28 2014
@@ -105,6 +105,7 @@ public:
return sectionPositionAny;
}
DeadStripKind deadStrip() const override { return deadStripNormal; }
+ bool isAlias() const override { return false; }
Kind getKind() const { return _kind; }
Modified: lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp?rev=207886&r1=207885&r2=207886&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp (original)
+++ lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp Fri May 2 18:45:28 2014
@@ -892,6 +892,7 @@ template <> struct MappingTraits<const l
DeadStripKind deadStrip() const override { return _deadStrip; }
DynamicExport dynamicExport() const override { return _dynamicExport; }
ContentPermissions permissions() const override { return _permissions; }
+ bool isAlias() const override { return false; }
bool isGroupChild() const { return _isGroupChild; }
ArrayRef<uint8_t> rawContent() const override {
if (!occupiesDiskSpace())
More information about the llvm-commits
mailing list