diff options
Diffstat (limited to 'lld/ELF/Writer.h')
-rw-r--r-- | lld/ELF/Writer.h | 22 |
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); |