1 //===- Writer.h -------------------------------------------------*- C++ -*-===//
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLD_ELF_WRITER_H
11 #define LLD_ELF_WRITER_H
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/StringRef.h"
22 class InputSectionBase;
23 template <class ELFT> class ObjectFile;
24 template <class ELFT> class SymbolTable;
25 template <class ELFT> void writeResult();
26 template <class ELFT> void markLive();
27 template <class ELFT> bool isRelroSection(const OutputSection *Sec);
29 // This describes a program header entry.
30 // Each contains type, access flags and range of output sections that will be
33 PhdrEntry(unsigned Type, unsigned Flags);
34 void add(OutputSection *Sec);
39 uint64_t p_filesz = 0;
40 uint64_t p_offset = 0;
45 OutputSection *First = nullptr;
46 OutputSection *Last = nullptr;
50 llvm::StringRef getOutputSectionName(llvm::StringRef Name);
52 template <class ELFT> uint32_t getMipsEFlags();
54 uint8_t getMipsFpAbiFlag(uint8_t OldFlag, uint8_t NewFlag,
55 llvm::StringRef FileName);
57 bool isMipsN32Abi(const InputFile *F);