summaryrefslogtreecommitdiff
path: root/lld/ELF/Writer.h
diff options
context:
space:
mode:
authorEugene Leviant <evgeny.leviant@gmail.com>2016-07-19 09:25:43 +0000
committerEugene Leviant <evgeny.leviant@gmail.com>2016-07-19 09:25:43 +0000
commit0701968e70db5aa80a8dc9e62ba9e805cad9b9d9 (patch)
tree4f7719b96afd9166b23579f3722ea44a748072e1 /lld/ELF/Writer.h
parentf51e7b8e54da44145730cad2168aa9b5f0688d8e (diff)
[ELF] Minimal PHDRS parser and section to segment assignment support
Diffstat (limited to 'lld/ELF/Writer.h')
-rw-r--r--lld/ELF/Writer.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/lld/ELF/Writer.h b/lld/ELF/Writer.h
index df25d8e404c..ec7a2eb6d59 100644
--- a/lld/ELF/Writer.h
+++ b/lld/ELF/Writer.h
@@ -10,6 +10,7 @@
#ifndef LLD_ELF_WRITER_H
#define LLD_ELF_WRITER_H
+#include <cstdint>
#include <memory>
namespace llvm {
@@ -18,13 +19,30 @@ namespace llvm {
namespace lld {
namespace elf {
+template <class ELFT> class OutputSectionBase;
template <class ELFT> class InputSectionBase;
template <class ELFT> class ObjectFile;
template <class ELFT> class SymbolTable;
-
template <class ELFT> void writeResult(SymbolTable<ELFT> *Symtab);
-
template <class ELFT> void markLive();
+template <class ELFT> bool needsInterpSection();
+template <class ELFT> bool isOutputDynamic();
+template <class ELFT> bool isRelroSection(OutputSectionBase<ELFT> *Sec);
+template <class ELFT> bool needsPtLoad(OutputSectionBase<ELFT> *Sec);
+uint32_t toPhdrFlags(uint64_t Flags);
+
+// This describes a program header entry.
+// Each contains type, access flags and range of output sections that will be
+// placed in it.
+template<class ELFT>
+struct Phdr {
+ Phdr(unsigned Type, unsigned Flags);
+ void AddSec(OutputSectionBase<ELFT> *Sec);
+
+ typename ELFT::Phdr H = {};
+ OutputSectionBase<ELFT> *First = nullptr;
+ OutputSectionBase<ELFT> *Last = nullptr;
+};
template <class ELFT>
llvm::StringRef getOutputSectionName(InputSectionBase<ELFT> *S);