Coverage Report

Created: 2018-06-25 02:00

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/lld/ELF/Relocations.h
Line
Count
Source
1
//===- Relocations.h -------------------------------------------*- C++ -*-===//
2
//
3
//                             The LLVM Linker
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLD_ELF_RELOCATIONS_H
11
#define LLD_ELF_RELOCATIONS_H
12
13
#include "lld/Common/LLVM.h"
14
#include "llvm/ADT/DenseMap.h"
15
#include <map>
16
#include <vector>
17
18
namespace lld {
19
namespace elf {
20
class Symbol;
21
class InputSection;
22
class InputSectionBase;
23
class OutputSection;
24
class SectionBase;
25
26
// Represents a relocation type, such as R_X86_64_PC32 or R_ARM_THM_CALL.
27
typedef uint32_t RelType;
28
29
// List of target-independent relocation types. Relocations read
30
// from files are converted to these types so that the main code
31
// doesn't have to know about architecture-specific details.
32
enum RelExpr {
33
  R_INVALID,
34
  R_ABS,
35
  R_ADDEND,
36
  R_ARM_SBREL,
37
  R_GOT,
38
  R_GOTONLY_PC,
39
  R_GOTONLY_PC_FROM_END,
40
  R_GOTREL,
41
  R_GOTREL_FROM_END,
42
  R_GOT_FROM_END,
43
  R_GOT_OFF,
44
  R_GOT_PAGE_PC,
45
  R_GOT_PC,
46
  R_HINT,
47
  R_MIPS_GOTREL,
48
  R_MIPS_GOT_GP,
49
  R_MIPS_GOT_GP_PC,
50
  R_MIPS_GOT_LOCAL_PAGE,
51
  R_MIPS_GOT_OFF,
52
  R_MIPS_GOT_OFF32,
53
  R_MIPS_TLSGD,
54
  R_MIPS_TLSLD,
55
  R_NEG_TLS,
56
  R_NONE,
57
  R_PAGE_PC,
58
  R_PC,
59
  R_PLT,
60
  R_PLT_PAGE_PC,
61
  R_PLT_PC,
62
  R_PPC_CALL,
63
  R_PPC_CALL_PLT,
64
  R_PPC_TOC,
65
  R_RELAX_GOT_PC,
66
  R_RELAX_GOT_PC_NOPIC,
67
  R_RELAX_TLS_GD_TO_IE,
68
  R_RELAX_TLS_GD_TO_IE_ABS,
69
  R_RELAX_TLS_GD_TO_IE_END,
70
  R_RELAX_TLS_GD_TO_IE_PAGE_PC,
71
  R_RELAX_TLS_GD_TO_LE,
72
  R_RELAX_TLS_GD_TO_LE_NEG,
73
  R_RELAX_TLS_IE_TO_LE,
74
  R_RELAX_TLS_LD_TO_LE,
75
  R_SIZE,
76
  R_TLS,
77
  R_TLSDESC,
78
  R_TLSDESC_CALL,
79
  R_TLSDESC_PAGE,
80
  R_TLSGD_GOT,
81
  R_TLSGD_GOT_FROM_END,
82
  R_TLSGD_PC,
83
  R_TLSLD_GOT_FROM_END,
84
  R_TLSLD_GOT,
85
  R_TLSLD_PC,
86
};
87
88
// Build a bitmask with one bit set for each RelExpr.
89
//
90
// Constexpr function arguments can't be used in static asserts, so we
91
// use template arguments to build the mask.
92
// But function template partial specializations don't exist (needed
93
// for base case of the recursion), so we need a dummy struct.
94
template <RelExpr... Exprs> struct RelExprMaskBuilder {
95
65.3k
  static inline uint64_t build() { return 0; }
96
};
97
98
// Specialization for recursive case.
99
template <RelExpr Head, RelExpr... Tail>
100
struct RelExprMaskBuilder<Head, Tail...> {
101
504k
  static inline uint64_t build() {
102
504k
    static_assert(0 <= Head && Head < 64,
103
504k
                  "RelExpr is too large for 64-bit mask!");
104
504k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
504k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)13, (lld::elf::RelExpr)23>::build()
Line
Count
Source
101
12.8k
  static inline uint64_t build() {
102
12.8k
    static_assert(0 <= Head && Head < 64,
103
12.8k
                  "RelExpr is too large for 64-bit mask!");
104
12.8k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.8k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)23>::build()
Line
Count
Source
101
12.8k
  static inline uint64_t build() {
102
12.8k
    static_assert(0 <= Head && Head < 64,
103
12.8k
                  "RelExpr is too large for 64-bit mask!");
104
12.8k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.8k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)31>::build()
Line
Count
Source
101
12.8k
  static inline uint64_t build() {
102
12.8k
    static_assert(0 <= Head && Head < 64,
103
12.8k
                  "RelExpr is too large for 64-bit mask!");
104
12.8k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.8k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)6, (lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)31>::build()
Line
Count
Source
101
12.8k
  static inline uint64_t build() {
102
12.8k
    static_assert(0 <= Head && Head < 64,
103
12.8k
                  "RelExpr is too large for 64-bit mask!");
104
12.8k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.8k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)31>::build()
Line
Count
Source
101
12.8k
  static inline uint64_t build() {
102
12.8k
    static_assert(0 <= Head && Head < 64,
103
12.8k
                  "RelExpr is too large for 64-bit mask!");
104
12.8k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.8k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)8, (lld::elf::RelExpr)31>::build()
Line
Count
Source
101
12.8k
  static inline uint64_t build() {
102
12.8k
    static_assert(0 <= Head && Head < 64,
103
12.8k
                  "RelExpr is too large for 64-bit mask!");
104
12.8k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.8k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)31>::build()
Line
Count
Source
101
12.8k
  static inline uint64_t build() {
102
12.8k
    static_assert(0 <= Head && Head < 64,
103
12.8k
                  "RelExpr is too large for 64-bit mask!");
104
12.8k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.8k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)44, (lld::elf::RelExpr)46, (lld::elf::RelExpr)45>::build()
Line
Count
Source
101
250
  static inline uint64_t build() {
102
250
    static_assert(0 <= Head && Head < 64,
103
250
                  "RelExpr is too large for 64-bit mask!");
104
250
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
250
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)46, (lld::elf::RelExpr)45>::build()
Line
Count
Source
101
250
  static inline uint64_t build() {
102
250
    static_assert(0 <= Head && Head < 64,
103
250
                  "RelExpr is too large for 64-bit mask!");
104
250
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
250
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)45>::build()
Line
Count
Source
101
250
  static inline uint64_t build() {
102
250
    static_assert(0 <= Head && Head < 64,
103
250
                  "RelExpr is too large for 64-bit mask!");
104
250
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
250
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)51, (lld::elf::RelExpr)50, (lld::elf::RelExpr)52>::build()
Line
Count
Source
101
234
  static inline uint64_t build() {
102
234
    static_assert(0 <= Head && Head < 64,
103
234
                  "RelExpr is too large for 64-bit mask!");
104
234
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
234
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)50, (lld::elf::RelExpr)52>::build()
Line
Count
Source
101
438
  static inline uint64_t build() {
102
438
    static_assert(0 <= Head && Head < 64,
103
438
                  "RelExpr is too large for 64-bit mask!");
104
438
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
438
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)52>::build()
Line
Count
Source
101
438
  static inline uint64_t build() {
102
438
    static_assert(0 <= Head && Head < 64,
103
438
                  "RelExpr is too large for 64-bit mask!");
104
438
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
438
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)1, (lld::elf::RelExpr)50, (lld::elf::RelExpr)52>::build()
Line
Count
Source
101
204
  static inline uint64_t build() {
102
204
    static_assert(0 <= Head && Head < 64,
103
204
                  "RelExpr is too large for 64-bit mask!");
104
204
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
204
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)44, (lld::elf::RelExpr)46, (lld::elf::RelExpr)45, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49>::build()
Line
Count
Source
101
197
  static inline uint64_t build() {
102
197
    static_assert(0 <= Head && Head < 64,
103
197
                  "RelExpr is too large for 64-bit mask!");
104
197
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
197
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)46, (lld::elf::RelExpr)45, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49>::build()
Line
Count
Source
101
197
  static inline uint64_t build() {
102
197
    static_assert(0 <= Head && Head < 64,
103
197
                  "RelExpr is too large for 64-bit mask!");
104
197
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
197
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)45, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49>::build()
Line
Count
Source
101
197
  static inline uint64_t build() {
102
197
    static_assert(0 <= Head && Head < 64,
103
197
                  "RelExpr is too large for 64-bit mask!");
104
197
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
197
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49>::build()
Line
Count
Source
101
197
  static inline uint64_t build() {
102
197
    static_assert(0 <= Head && Head < 64,
103
197
                  "RelExpr is too large for 64-bit mask!");
104
197
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
197
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)48, (lld::elf::RelExpr)49>::build()
Line
Count
Source
101
197
  static inline uint64_t build() {
102
197
    static_assert(0 <= Head && Head < 64,
103
197
                  "RelExpr is too large for 64-bit mask!");
104
197
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
197
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)49>::build()
Line
Count
Source
101
197
  static inline uint64_t build() {
102
197
    static_assert(0 <= Head && Head < 64,
103
197
                  "RelExpr is too large for 64-bit mask!");
104
197
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
197
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)4, (lld::elf::RelExpr)9, (lld::elf::RelExpr)12, (lld::elf::RelExpr)11>::build()
Line
Count
Source
101
158
  static inline uint64_t build() {
102
158
    static_assert(0 <= Head && Head < 64,
103
158
                  "RelExpr is too large for 64-bit mask!");
104
158
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
158
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)9, (lld::elf::RelExpr)12, (lld::elf::RelExpr)11>::build()
Line
Count
Source
101
158
  static inline uint64_t build() {
102
158
    static_assert(0 <= Head && Head < 64,
103
158
                  "RelExpr is too large for 64-bit mask!");
104
158
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
158
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)12, (lld::elf::RelExpr)11>::build()
Line
Count
Source
101
158
  static inline uint64_t build() {
102
158
    static_assert(0 <= Head && Head < 64,
103
158
                  "RelExpr is too large for 64-bit mask!");
104
158
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
158
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)11>::build()
Line
Count
Source
101
158
  static inline uint64_t build() {
102
158
    static_assert(0 <= Head && Head < 64,
103
158
                  "RelExpr is too large for 64-bit mask!");
104
158
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
158
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)28, (lld::elf::RelExpr)30, (lld::elf::RelExpr)26, (lld::elf::RelExpr)27>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)30, (lld::elf::RelExpr)26, (lld::elf::RelExpr)27>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)26, (lld::elf::RelExpr)27>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)27>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)4, (lld::elf::RelExpr)10, (lld::elf::RelExpr)17, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)10, (lld::elf::RelExpr)17, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)17, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)19, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)9>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)9, (lld::elf::RelExpr)10, (lld::elf::RelExpr)17, (lld::elf::RelExpr)14, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)16, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)10, (lld::elf::RelExpr)17, (lld::elf::RelExpr)14, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)16, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)17, (lld::elf::RelExpr)14, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)16, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)14, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)16, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)16, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)19, (lld::elf::RelExpr)16, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)16, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)46, (lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)13>::build()
Line
Count
Source
101
12.6k
  static inline uint64_t build() {
102
12.6k
    static_assert(0 <= Head && Head < 64,
103
12.6k
                  "RelExpr is too large for 64-bit mask!");
104
12.6k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
12.6k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)25, (lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)14, (lld::elf::RelExpr)29, (lld::elf::RelExpr)30, (lld::elf::RelExpr)24, (lld::elf::RelExpr)32>::build()
Line
Count
Source
101
483
  static inline uint64_t build() {
102
483
    static_assert(0 <= Head && Head < 64,
103
483
                  "RelExpr is too large for 64-bit mask!");
104
483
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
483
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)14, (lld::elf::RelExpr)29, (lld::elf::RelExpr)30, (lld::elf::RelExpr)24, (lld::elf::RelExpr)32>::build()
Line
Count
Source
101
483
  static inline uint64_t build() {
102
483
    static_assert(0 <= Head && Head < 64,
103
483
                  "RelExpr is too large for 64-bit mask!");
104
483
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
483
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)8, (lld::elf::RelExpr)14, (lld::elf::RelExpr)29, (lld::elf::RelExpr)30, (lld::elf::RelExpr)24, (lld::elf::RelExpr)32>::build()
Line
Count
Source
101
483
  static inline uint64_t build() {
102
483
    static_assert(0 <= Head && Head < 64,
103
483
                  "RelExpr is too large for 64-bit mask!");
104
483
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
483
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)14, (lld::elf::RelExpr)29, (lld::elf::RelExpr)30, (lld::elf::RelExpr)24, (lld::elf::RelExpr)32>::build()
Line
Count
Source
101
483
  static inline uint64_t build() {
102
483
    static_assert(0 <= Head && Head < 64,
103
483
                  "RelExpr is too large for 64-bit mask!");
104
483
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
483
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)29, (lld::elf::RelExpr)30, (lld::elf::RelExpr)24, (lld::elf::RelExpr)32>::build()
Line
Count
Source
101
483
  static inline uint64_t build() {
102
483
    static_assert(0 <= Head && Head < 64,
103
483
                  "RelExpr is too large for 64-bit mask!");
104
483
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
483
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)30, (lld::elf::RelExpr)24, (lld::elf::RelExpr)32>::build()
Line
Count
Source
101
483
  static inline uint64_t build() {
102
483
    static_assert(0 <= Head && Head < 64,
103
483
                  "RelExpr is too large for 64-bit mask!");
104
483
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
483
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)24, (lld::elf::RelExpr)32>::build()
Line
Count
Source
101
483
  static inline uint64_t build() {
102
483
    static_assert(0 <= Head && Head < 64,
103
483
                  "RelExpr is too large for 64-bit mask!");
104
483
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
483
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)32>::build()
Line
Count
Source
101
483
  static inline uint64_t build() {
102
483
    static_assert(0 <= Head && Head < 64,
103
483
                  "RelExpr is too large for 64-bit mask!");
104
483
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
105
483
  }
106
};
107
108
// Return true if `Expr` is one of `Exprs`.
109
// There are fewer than 64 RelExpr's, so we can represent any set of
110
// RelExpr's as a constant bit mask and test for membership with a
111
// couple cheap bitwise operations.
112
65.3k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
113
65.3k
  assert(0 <= Expr && (int)Expr < 64 &&
114
65.3k
         "RelExpr is too large for 64-bit mask!");
115
65.3k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
116
65.3k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)13, (lld::elf::RelExpr)23>(lld::elf::RelExpr)
Line
Count
Source
112
12.8k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
113
12.8k
  assert(0 <= Expr && (int)Expr < 64 &&
114
12.8k
         "RelExpr is too large for 64-bit mask!");
115
12.8k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
116
12.8k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)31>(lld::elf::RelExpr)
Line
Count
Source
112
12.8k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
113
12.8k
  assert(0 <= Expr && (int)Expr < 64 &&
114
12.8k
         "RelExpr is too large for 64-bit mask!");
115
12.8k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
116
12.8k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)44, (lld::elf::RelExpr)46, (lld::elf::RelExpr)45>(lld::elf::RelExpr)
Line
Count
Source
112
250
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
113
250
  assert(0 <= Expr && (int)Expr < 64 &&
114
250
         "RelExpr is too large for 64-bit mask!");
115
250
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
116
250
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)51, (lld::elf::RelExpr)50, (lld::elf::RelExpr)52>(lld::elf::RelExpr)
Line
Count
Source
112
234
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
113
234
  assert(0 <= Expr && (int)Expr < 64 &&
114
234
         "RelExpr is too large for 64-bit mask!");
115
234
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
116
234
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)1, (lld::elf::RelExpr)50, (lld::elf::RelExpr)52>(lld::elf::RelExpr)
Line
Count
Source
112
204
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
113
204
  assert(0 <= Expr && (int)Expr < 64 &&
114
204
         "RelExpr is too large for 64-bit mask!");
115
204
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
116
204
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)44, (lld::elf::RelExpr)46, (lld::elf::RelExpr)45, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49>(lld::elf::RelExpr)
Line
Count
Source
112
197
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
113
197
  assert(0 <= Expr && (int)Expr < 64 &&
114
197
         "RelExpr is too large for 64-bit mask!");
115
197
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
116
197
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)4, (lld::elf::RelExpr)9, (lld::elf::RelExpr)12, (lld::elf::RelExpr)11>(lld::elf::RelExpr)
Line
Count
Source
112
158
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
113
158
  assert(0 <= Expr && (int)Expr < 64 &&
114
158
         "RelExpr is too large for 64-bit mask!");
115
158
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
116
158
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)28, (lld::elf::RelExpr)30, (lld::elf::RelExpr)26, (lld::elf::RelExpr)27>(lld::elf::RelExpr)
Line
Count
Source
112
12.6k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
113
12.6k
  assert(0 <= Expr && (int)Expr < 64 &&
114
12.6k
         "RelExpr is too large for 64-bit mask!");
115
12.6k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
116
12.6k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)4, (lld::elf::RelExpr)10, (lld::elf::RelExpr)17, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>(lld::elf::RelExpr)
Line
Count
Source
112
12.6k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
113
12.6k
  assert(0 <= Expr && (int)Expr < 64 &&
114
12.6k
         "RelExpr is too large for 64-bit mask!");
115
12.6k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
116
12.6k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)9, (lld::elf::RelExpr)10, (lld::elf::RelExpr)17, (lld::elf::RelExpr)14, (lld::elf::RelExpr)18, (lld::elf::RelExpr)19, (lld::elf::RelExpr)16, (lld::elf::RelExpr)20, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)47, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)30, (lld::elf::RelExpr)45, (lld::elf::RelExpr)46, (lld::elf::RelExpr)13>(lld::elf::RelExpr)
Line
Count
Source
112
12.6k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
113
12.6k
  assert(0 <= Expr && (int)Expr < 64 &&
114
12.6k
         "RelExpr is too large for 64-bit mask!");
115
12.6k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
116
12.6k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)25, (lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)14, (lld::elf::RelExpr)29, (lld::elf::RelExpr)30, (lld::elf::RelExpr)24, (lld::elf::RelExpr)32>(lld::elf::RelExpr)
Line
Count
Source
112
483
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
113
483
  assert(0 <= Expr && (int)Expr < 64 &&
114
483
         "RelExpr is too large for 64-bit mask!");
115
483
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
116
483
}
117
118
// Architecture-neutral representation of relocation.
119
struct Relocation {
120
  RelExpr Expr;
121
  RelType Type;
122
  uint64_t Offset;
123
  int64_t Addend;
124
  Symbol *Sym;
125
};
126
127
template <class ELFT> void scanRelocations(InputSectionBase &);
128
129
class ThunkSection;
130
class Thunk;
131
struct InputSectionDescription;
132
133
class ThunkCreator {
134
public:
135
  // Return true if Thunks have been added to OutputSections
136
  bool createThunks(ArrayRef<OutputSection *> OutputSections);
137
138
  // The number of completed passes of createThunks this permits us
139
  // to do one time initialization on Pass 0 and put a limit on the
140
  // number of times it can be called to prevent infinite loops.
141
  uint32_t Pass = 0;
142
143
private:
144
  void mergeThunks(ArrayRef<OutputSection *> OutputSections);
145
146
  ThunkSection *getISDThunkSec(OutputSection *OS, InputSection *IS,
147
                               InputSectionDescription *ISD, uint32_t Type,
148
                               uint64_t Src);
149
150
  ThunkSection *getISThunkSec(InputSection *IS);
151
152
  void createInitialThunkSections(ArrayRef<OutputSection *> OutputSections);
153
154
  void forEachInputSectionDescription(
155
      ArrayRef<OutputSection *> OutputSections,
156
      llvm::function_ref<void(OutputSection *, InputSectionDescription *)> Fn);
157
158
  std::pair<Thunk *, bool> getThunk(Symbol &Sym, RelType Type, uint64_t Src);
159
160
  ThunkSection *addThunkSection(OutputSection *OS, InputSectionDescription *,
161
                                uint64_t Off);
162
163
  bool normalizeExistingThunk(Relocation &Rel, uint64_t Src);
164
165
  // Record all the available Thunks for a Symbol
166
  llvm::DenseMap<std::pair<SectionBase *, uint64_t>, std::vector<Thunk *>>
167
      ThunkedSymbolsBySection;
168
  llvm::DenseMap<Symbol *, std::vector<Thunk *>> ThunkedSymbols;
169
170
  // Find a Thunk from the Thunks symbol definition, we can use this to find
171
  // the Thunk from a relocation to the Thunks symbol definition.
172
  llvm::DenseMap<Symbol *, Thunk *> Thunks;
173
174
  // Track InputSections that have an inline ThunkSection placed in front
175
  // an inline ThunkSection may have control fall through to the section below
176
  // so we need to make sure that there is only one of them.
177
  // The Mips LA25 Thunk is an example of an inline ThunkSection.
178
  llvm::DenseMap<InputSection *, ThunkSection *> ThunkedSections;
179
};
180
181
// Return a int64_t to make sure we get the sign extension out of the way as
182
// early as possible.
183
template <class ELFT>
184
34
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
185
34
  return 0;
186
34
}
GdbIndex.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rel const&)
Line
Count
Source
184
6
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
185
6
  return 0;
186
6
}
Unexecuted instantiation: GdbIndex.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rel const&)
Unexecuted instantiation: GdbIndex.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rel const&)
Unexecuted instantiation: GdbIndex.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rel const&)
ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rel const&)
Line
Count
Source
184
2
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
185
2
  return 0;
186
2
}
Unexecuted instantiation: ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rel const&)
Unexecuted instantiation: ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rel const&)
Unexecuted instantiation: ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rel const&)
InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rel const&)
Line
Count
Source
184
14
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
185
14
  return 0;
186
14
}
InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rel const&)
Line
Count
Source
184
12
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
185
12
  return 0;
186
12
}
Unexecuted instantiation: InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rel const&)
Unexecuted instantiation: InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rel const&)
Unexecuted instantiation: Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rel const&)
Unexecuted instantiation: Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rel const&)
Unexecuted instantiation: Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rel const&)
Unexecuted instantiation: Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rel const&)
187
template <class ELFT>
188
12.2k
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
189
12.2k
  return Rel.r_addend;
190
12.2k
}
Unexecuted instantiation: GdbIndex.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rela const&)
Unexecuted instantiation: GdbIndex.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rela const&)
GdbIndex.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rela const&)
Line
Count
Source
188
77
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
189
77
  return Rel.r_addend;
190
77
}
Unexecuted instantiation: GdbIndex.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rela const&)
Unexecuted instantiation: ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rela const&)
Unexecuted instantiation: ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rela const&)
ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rela const&)
Line
Count
Source
188
26
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
189
26
  return Rel.r_addend;
190
26
}
Unexecuted instantiation: ICF.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rela const&)
Unexecuted instantiation: InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rela const&)
Unexecuted instantiation: InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rela const&)
InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rela const&)
Line
Count
Source
188
249
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
189
249
  return Rel.r_addend;
190
249
}
InputSection.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rela const&)
Line
Count
Source
188
6
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
189
6
  return Rel.r_addend;
190
6
}
Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, false> >(llvm::object::ELFType<(llvm::support::endianness)1, false>::Rela const&)
Line
Count
Source
188
2
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
189
2
  return Rel.r_addend;
190
2
}
Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, false> >(llvm::object::ELFType<(llvm::support::endianness)0, false>::Rela const&)
Line
Count
Source
188
13
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
189
13
  return Rel.r_addend;
190
13
}
Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::Rela const&)
Line
Count
Source
188
1.68k
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
189
1.68k
  return Rel.r_addend;
190
1.68k
}
Relocations.cpp:long long lld::elf::getAddend<llvm::object::ELFType<(llvm::support::endianness)0, true> >(llvm::object::ELFType<(llvm::support::endianness)0, true>::Rela const&)
Line
Count
Source
188
10.1k
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
189
10.1k
  return Rel.r_addend;
190
10.1k
}
191
} // namespace elf
192
} // namespace lld
193
194
#endif