diff options
| author | Rui Ueyama <ruiu@google.com> | 2013-06-16 17:14:58 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2013-06-16 17:14:58 +0000 |
| commit | e96044a370851cd0dd5cadf9e537f863696a8c3a (patch) | |
| tree | 60808f9f9df4e89115d0b05b4e0f561cc91afe6a /lld/lib/ReaderWriter/ELF/Layout.h | |
| parent | a97f12e00a4069a03df2f9e1016fba912162d2ca (diff) | |
| download | bcm5719-llvm-e96044a370851cd0dd5cadf9e537f863696a8c3a.tar.gz bcm5719-llvm-e96044a370851cd0dd5cadf9e537f863696a8c3a.zip | |
[lld] Move AtomLayout from ELF to ReaderWriter so that it can be used by non-ELF writers.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D977
llvm-svn: 184061
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/Layout.h')
| -rw-r--r-- | lld/lib/ReaderWriter/ELF/Layout.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/lld/lib/ReaderWriter/ELF/Layout.h b/lld/lib/ReaderWriter/ELF/Layout.h index 9f73a132dc9..7224d50becd 100644 --- a/lld/lib/ReaderWriter/ELF/Layout.h +++ b/lld/lib/ReaderWriter/ELF/Layout.h @@ -11,6 +11,7 @@ #define LLD_READER_WRITER_ELF_LAYOUT_H #include "lld/Core/DefinedAtom.h" +#include "lld/ReaderWriter/AtomLayout.h" #include "llvm/ADT/StringRef.h" #include "llvm/Object/ELF.h" @@ -21,17 +22,6 @@ namespace lld { namespace elf { -struct AtomLayout { - AtomLayout(const Atom *a, uint64_t fileOff, uint64_t virAddr) - : _atom(a), _fileOffset(fileOff), _virtualAddr(virAddr) { - } - - AtomLayout() : _atom(nullptr), _fileOffset(0), _virtualAddr(0) {} - - const Atom *_atom; - uint64_t _fileOffset; - uint64_t _virtualAddr; -}; /// \brief The ELFLayout is an abstract class for managing the final layout for /// the kind of binaries(Shared Libraries / Relocatables / Executables 0 @@ -51,7 +41,7 @@ public: /// \brief Append the Atom to the layout and create appropriate sections. /// \returns A reference to the atom layout or an error. The atom layout will /// be updated as linking progresses. - virtual ErrorOr<const AtomLayout &> addAtom(const Atom *atom) = 0; + virtual ErrorOr<const lld::AtomLayout &> addAtom(const Atom *atom) = 0; /// find the Atom Address in the current layout virtual bool findAtomAddrByName(StringRef name, uint64_t &addr) = 0; /// associates a section to a segment |

