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 ObjFile;
25 template <class ELFT> void writeResult();
27 // This describes a program header entry.
28 // Each contains type, access flags and range of output sections that will be
31 PhdrEntry(unsigned Type, unsigned Flags) : p_type(Type), p_flags(Flags) {}
32 void add(OutputSection *Sec);
37 uint64_t p_filesz = 0;
38 uint64_t p_offset = 0;
43 OutputSection *FirstSec = nullptr;
44 OutputSection *LastSec = nullptr;
47 uint64_t LMAOffset = 0;
50 void addReservedSymbols();
51 llvm::StringRef getOutputSectionName(const InputSectionBase *S);
53 template <class ELFT> uint32_t calcMipsEFlags();
55 uint8_t getMipsFpAbiFlag(uint8_t OldFlag, uint8_t NewFlag,
56 llvm::StringRef FileName);
58 bool isMipsN32Abi(const InputFile *F);