Coverage Report

Created: 2019-05-19 14:56

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/lld/ELF/Writer.h
Line
Count
Source
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
//===----------------------------------------------------------------------===//
8
9
#ifndef LLD_ELF_WRITER_H
10
#define LLD_ELF_WRITER_H
11
12
#include "llvm/ADT/ArrayRef.h"
13
#include "llvm/ADT/StringRef.h"
14
#include <cstdint>
15
#include <memory>
16
17
namespace lld {
18
namespace elf {
19
class InputFile;
20
class OutputSection;
21
class InputSectionBase;
22
template <class ELFT> void writeResult();
23
24
// This describes a program header entry.
25
// Each contains type, access flags and range of output sections that will be
26
// placed in it.
27
struct PhdrEntry {
28
17.0k
  PhdrEntry(unsigned Type, unsigned Flags) : p_type(Type), p_flags(Flags) {}
29
  void add(OutputSection *Sec);
30
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;
39
40
  OutputSection *FirstSec = nullptr;
41
  OutputSection *LastSec = nullptr;
42
  bool HasLMA = false;
43
44
  uint64_t LMAOffset = 0;
45
};
46
47
void addReservedSymbols();
48
llvm::StringRef getOutputSectionName(const InputSectionBase *S);
49
50
template <class ELFT> uint32_t calcMipsEFlags();
51
52
uint8_t getMipsFpAbiFlag(uint8_t OldFlag, uint8_t NewFlag,
53
                         llvm::StringRef FileName);
54
55
bool isMipsN32Abi(const InputFile *F);
56
bool isMicroMips();
57
bool isMipsR6();
58
} // namespace elf
59
} // namespace lld
60
61
#endif