summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/ELFTargetHandler.h
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2013-01-29 19:53:41 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2013-01-29 19:53:41 +0000
commit43ecac5a2c398674955382311c6a321282ba4b3e (patch)
treed7a0bb6a2924846c5a761686859e48c910f5a748 /lld/lib/ReaderWriter/ELF/ELFTargetHandler.h
parentddaa9be9783928ecd802c433821fe7c8e05bf8b9 (diff)
downloadbcm5719-llvm-43ecac5a2c398674955382311c6a321282ba4b3e.tar.gz
bcm5719-llvm-43ecac5a2c398674955382311c6a321282ba4b3e.zip
[ELF] Fix header sort order.
llvm-svn: 173822
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/ELFTargetHandler.h')
-rw-r--r--lld/lib/ReaderWriter/ELF/ELFTargetHandler.h55
1 files changed, 7 insertions, 48 deletions
diff --git a/lld/lib/ReaderWriter/ELF/ELFTargetHandler.h b/lld/lib/ReaderWriter/ELF/ELFTargetHandler.h
index 6afbd963f26..196f143fb74 100644
--- a/lld/lib/ReaderWriter/ELF/ELFTargetHandler.h
+++ b/lld/lib/ReaderWriter/ELF/ELFTargetHandler.h
@@ -16,12 +16,13 @@
#ifndef LLD_READER_WRITER_ELF_TARGETHANDLER_H
#define LLD_READER_WRITER_ELF_TARGETHANDLER_H
+#include "lld/Core/InputFiles.h"
#include "lld/Core/LinkerOptions.h"
#include "lld/Core/LLVM.h"
#include "lld/Core/TargetInfo.h"
#include "lld/ReaderWriter/ELFTargetInfo.h"
-#include "DefaultELFLayout.h"
-#include "AtomsELF.h"
+
+#include "llvm/ADT/Hashing.h"
#include <memory>
#include <vector>
@@ -30,6 +31,10 @@
namespace lld {
template <class ELFT> class ELFDefinedAtom;
namespace elf {
+template <class ELFT> class ELFTargetLayout;
+template <class ELFT> class ELFHeader;
+template <class ELFT> class Section;
+
/// \brief The target registers a set of handlers for overriding target specific
/// attributes for a DefinedAtom. The Reader uses this class to query for the
/// type of atom and its permissions
@@ -52,52 +57,6 @@ public:
}
};
-/// \brief The target can override certain functions in the DefaultELFLayout
-/// class so that the order, the name of the section and the segment type could
-/// be changed in the final layout
-template <class ELFT> class ELFTargetLayout : public DefaultELFLayout<ELFT> {
-public:
- ELFTargetLayout(ELFTargetInfo &targetInfo, DefaultELFLayout<ELFT> &layout)
- : _targetInfo(targetInfo), _layout(layout) {
- }
-
- /// isTargetSection provides a way to determine if the section that
- /// we are processing has been registered by the target and the target
- /// wants to handle them.
- /// For example: the Writer may be processing a section but the target
- /// might want to override the functionality on how atoms are inserted
- /// into the section. Such sections are set the K_TargetSection flag in
- /// the SectionKind after they are created
- virtual bool isTargetSection(const StringRef name, const int32_t contentType,
- const int32_t contentPermissions) = 0;
-
- /// The target may want to override the sectionName to a different
- /// section Name in the output
- virtual StringRef sectionName(const StringRef name, const int32_t contentType,
- const int32_t contentPermissions) = 0;
-
- /// The target may want to override the section order that has been
- /// set by the DefaultLayout
- virtual ELFLayout::SectionOrder getSectionOrder(
- const StringRef name, int32_t contentType,
- int32_t contentPermissions) = 0;
-
- /// The target can set the segment type for a Section
- virtual ELFLayout::SegmentType segmentType(Section<ELFT> *section) const = 0;
-
- /// Returns true/false depending on whether the section has a Output
- // segment or not
- bool hasOutputSegment(Section<ELFT> *section) = 0;
-
- /// Returns the target Section for a section name and content Type
- Section<ELFT> *getSection(const StringRef name,
- DefinedAtom::ContentPermissions permissions) = 0;
-
-private:
- const ELFTargetInfo &_targetInfo;
- const DefaultELFLayout<ELFT> &_layout;
-};
-
/// \brief An interface to override functions that are provided by the
/// the default ELF Layout
template <class ELFT> class ELFTargetHandler : public ELFTargetHandlerBase {
OpenPOWER on IntegriCloud