[C++20] [Modules] Treat in class defined member functions in language linkage as...
[llvm-project.git] / lld / ELF / Writer.h
blobe3787987aca75ca2fdfbeb3e3e9c8283a9ba0aad
1 //===- Writer.h -------------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLD_ELF_WRITER_H
10 #define LLD_ELF_WRITER_H
12 #include "Config.h"
13 #include "llvm/ADT/StringRef.h"
14 #include <cstdint>
16 namespace lld::elf {
17 class InputFile;
18 class OutputSection;
19 void copySectionsIntoPartitions();
20 template <class ELFT> void writeResult();
22 // This describes a program header entry.
23 // Each contains type, access flags and range of output sections that will be
24 // placed in it.
25 struct PhdrEntry {
26 PhdrEntry(unsigned type, unsigned flags)
27 : p_align(type == llvm::ELF::PT_LOAD ? config->maxPageSize : 0),
28 p_type(type), p_flags(flags) {}
29 void add(OutputSection *sec);
31 uint64_t p_paddr = 0;
32 uint64_t p_vaddr = 0;
33 uint64_t p_memsz = 0;
34 uint64_t p_filesz = 0;
35 uint64_t p_offset = 0;
36 uint32_t p_align = 0;
37 uint32_t p_type = 0;
38 uint32_t p_flags = 0;
40 OutputSection *firstSec = nullptr;
41 OutputSection *lastSec = nullptr;
42 bool hasLMA = false;
44 uint64_t lmaOffset = 0;
47 void addReservedSymbols();
48 bool includeInSymtab(const Symbol &b);
49 unsigned getSectionRank(OutputSection &osec);
51 template <class ELFT> uint32_t calcMipsEFlags();
53 uint8_t getMipsFpAbiFlag(uint8_t oldFlag, uint8_t newFlag,
54 llvm::StringRef fileName);
56 bool isMipsN32Abi(const InputFile *f);
57 bool isMicroMips();
58 bool isMipsR6();
60 } // namespace lld::elf
62 #endif