Coverage Report

Created: 2018-08-19 21:11

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/lld/ELF/Relocations.h
Line
Count
Source (jump to first uncovered line)
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_GOT_OFF,
71
  R_RELAX_TLS_GD_TO_IE_PAGE_PC,
72
  R_RELAX_TLS_GD_TO_LE,
73
  R_RELAX_TLS_GD_TO_LE_NEG,
74
  R_RELAX_TLS_IE_TO_LE,
75
  R_RELAX_TLS_LD_TO_LE,
76
  R_RELAX_TLS_LD_TO_LE_ABS,
77
  R_RISCV_PC_INDIRECT,
78
  R_SIZE,
79
  R_TLS,
80
  R_TLSDESC,
81
  R_TLSDESC_CALL,
82
  R_TLSDESC_PAGE,
83
  R_TLSGD_GOT,
84
  R_TLSGD_GOT_FROM_END,
85
  R_TLSGD_PC,
86
  R_TLSLD_GOT,
87
  R_TLSLD_GOT_FROM_END,
88
  R_TLSLD_GOT_OFF,
89
  R_TLSLD_HINT,
90
  R_TLSLD_PC,
91
};
92
93
// Build a bitmask with one bit set for each RelExpr.
94
//
95
// Constexpr function arguments can't be used in static asserts, so we
96
// use template arguments to build the mask.
97
// But function template partial specializations don't exist (needed
98
// for base case of the recursion), so we need a dummy struct.
99
template <RelExpr... Exprs> struct RelExprMaskBuilder {
100
66.7k
  static inline uint64_t build() { return 0; }
101
};
102
103
// Specialization for recursive case.
104
template <RelExpr Head, RelExpr... Tail>
105
struct RelExprMaskBuilder<Head, Tail...> {
106
541k
  static inline uint64_t build() {
107
541k
    static_assert(0 <= Head && Head < 64,
108
541k
                  "RelExpr is too large for 64-bit mask!");
109
541k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
541k
  }
Unexecuted instantiation: lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)25>::build()
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)13, (lld::elf::RelExpr)23>::build()
Line
Count
Source
106
13.2k
  static inline uint64_t build() {
107
13.2k
    static_assert(0 <= Head && Head < 64,
108
13.2k
                  "RelExpr is too large for 64-bit mask!");
109
13.2k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
13.2k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)23>::build()
Line
Count
Source
106
13.2k
  static inline uint64_t build() {
107
13.2k
    static_assert(0 <= Head && Head < 64,
108
13.2k
                  "RelExpr is too large for 64-bit mask!");
109
13.2k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
13.2k
  }
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
106
13.1k
  static inline uint64_t build() {
107
13.1k
    static_assert(0 <= Head && Head < 64,
108
13.1k
                  "RelExpr is too large for 64-bit mask!");
109
13.1k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
13.1k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)6, (lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)31>::build()
Line
Count
Source
106
13.1k
  static inline uint64_t build() {
107
13.1k
    static_assert(0 <= Head && Head < 64,
108
13.1k
                  "RelExpr is too large for 64-bit mask!");
109
13.1k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
13.1k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)7, (lld::elf::RelExpr)8, (lld::elf::RelExpr)31>::build()
Line
Count
Source
106
13.1k
  static inline uint64_t build() {
107
13.1k
    static_assert(0 <= Head && Head < 64,
108
13.1k
                  "RelExpr is too large for 64-bit mask!");
109
13.1k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
13.1k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)8, (lld::elf::RelExpr)31>::build()
Line
Count
Source
106
13.1k
  static inline uint64_t build() {
107
13.1k
    static_assert(0 <= Head && Head < 64,
108
13.1k
                  "RelExpr is too large for 64-bit mask!");
109
13.1k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
13.1k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)31>::build()
Line
Count
Source
106
13.1k
  static inline uint64_t build() {
107
13.1k
    static_assert(0 <= Head && Head < 64,
108
13.1k
                  "RelExpr is too large for 64-bit mask!");
109
13.1k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
13.1k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)47, (lld::elf::RelExpr)49, (lld::elf::RelExpr)48>::build()
Line
Count
Source
106
302
  static inline uint64_t build() {
107
302
    static_assert(0 <= Head && Head < 64,
108
302
                  "RelExpr is too large for 64-bit mask!");
109
302
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
302
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)49, (lld::elf::RelExpr)48>::build()
Line
Count
Source
106
302
  static inline uint64_t build() {
107
302
    static_assert(0 <= Head && Head < 64,
108
302
                  "RelExpr is too large for 64-bit mask!");
109
302
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
302
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)48>::build()
Line
Count
Source
106
302
  static inline uint64_t build() {
107
302
    static_assert(0 <= Head && Head < 64,
108
302
                  "RelExpr is too large for 64-bit mask!");
109
302
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
302
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)53, (lld::elf::RelExpr)54, (lld::elf::RelExpr)57, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
284
  static inline uint64_t build() {
107
284
    static_assert(0 <= Head && Head < 64,
108
284
                  "RelExpr is too large for 64-bit mask!");
109
284
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
284
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)54, (lld::elf::RelExpr)57, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
284
  static inline uint64_t build() {
107
284
    static_assert(0 <= Head && Head < 64,
108
284
                  "RelExpr is too large for 64-bit mask!");
109
284
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
284
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)57, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
284
  static inline uint64_t build() {
107
284
    static_assert(0 <= Head && Head < 64,
108
284
                  "RelExpr is too large for 64-bit mask!");
109
284
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
284
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)56>::build()
Line
Count
Source
106
13.2k
  static inline uint64_t build() {
107
13.2k
    static_assert(0 <= Head && Head < 64,
108
13.2k
                  "RelExpr is too large for 64-bit mask!");
109
13.2k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
13.2k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)47, (lld::elf::RelExpr)49, (lld::elf::RelExpr)48, (lld::elf::RelExpr)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52>::build()
Line
Count
Source
106
221
  static inline uint64_t build() {
107
221
    static_assert(0 <= Head && Head < 64,
108
221
                  "RelExpr is too large for 64-bit mask!");
109
221
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
221
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)49, (lld::elf::RelExpr)48, (lld::elf::RelExpr)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52>::build()
Line
Count
Source
106
221
  static inline uint64_t build() {
107
221
    static_assert(0 <= Head && Head < 64,
108
221
                  "RelExpr is too large for 64-bit mask!");
109
221
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
221
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)48, (lld::elf::RelExpr)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52>::build()
Line
Count
Source
106
221
  static inline uint64_t build() {
107
221
    static_assert(0 <= Head && Head < 64,
108
221
                  "RelExpr is too large for 64-bit mask!");
109
221
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
221
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52>::build()
Line
Count
Source
106
221
  static inline uint64_t build() {
107
221
    static_assert(0 <= Head && Head < 64,
108
221
                  "RelExpr is too large for 64-bit mask!");
109
221
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
221
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)51, (lld::elf::RelExpr)52>::build()
Line
Count
Source
106
221
  static inline uint64_t build() {
107
221
    static_assert(0 <= Head && Head < 64,
108
221
                  "RelExpr is too large for 64-bit mask!");
109
221
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
221
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)52>::build()
Line
Count
Source
106
221
  static inline uint64_t build() {
107
221
    static_assert(0 <= Head && Head < 64,
108
221
                  "RelExpr is too large for 64-bit mask!");
109
221
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
221
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)4, (lld::elf::RelExpr)9, (lld::elf::RelExpr)12, (lld::elf::RelExpr)11>::build()
Line
Count
Source
106
158
  static inline uint64_t build() {
107
158
    static_assert(0 <= Head && Head < 64,
108
158
                  "RelExpr is too large for 64-bit mask!");
109
158
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
158
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)9, (lld::elf::RelExpr)12, (lld::elf::RelExpr)11>::build()
Line
Count
Source
106
158
  static inline uint64_t build() {
107
158
    static_assert(0 <= Head && Head < 64,
108
158
                  "RelExpr is too large for 64-bit mask!");
109
158
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
158
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)12, (lld::elf::RelExpr)11>::build()
Line
Count
Source
106
158
  static inline uint64_t build() {
107
158
    static_assert(0 <= Head && Head < 64,
108
158
                  "RelExpr is too large for 64-bit mask!");
109
158
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
158
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)11>::build()
Line
Count
Source
106
158
  static inline uint64_t build() {
107
158
    static_assert(0 <= Head && Head < 64,
108
158
                  "RelExpr is too large for 64-bit mask!");
109
158
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
158
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)28, (lld::elf::RelExpr)30, (lld::elf::RelExpr)26, (lld::elf::RelExpr)27>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)30, (lld::elf::RelExpr)26, (lld::elf::RelExpr)27>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)26, (lld::elf::RelExpr)27>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)27>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
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
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
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
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
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
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
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
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)19, (lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)11, (lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)12, (lld::elf::RelExpr)9>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)9>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)9, (lld::elf::RelExpr)10, (lld::elf::RelExpr)55, (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)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)10, (lld::elf::RelExpr)55, (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)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)55, (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)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
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)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
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)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
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)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
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)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
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)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
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)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
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)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)12, (lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)5, (lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)6, (lld::elf::RelExpr)28, (lld::elf::RelExpr)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)28, (lld::elf::RelExpr)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)13, (lld::elf::RelExpr)56>::build()
Line
Count
Source
106
12.9k
  static inline uint64_t build() {
107
12.9k
    static_assert(0 <= Head && Head < 64,
108
12.9k
                  "RelExpr is too large for 64-bit mask!");
109
12.9k
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
12.9k
  }
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
106
579
  static inline uint64_t build() {
107
579
    static_assert(0 <= Head && Head < 64,
108
579
                  "RelExpr is too large for 64-bit mask!");
109
579
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
579
  }
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
106
579
  static inline uint64_t build() {
107
579
    static_assert(0 <= Head && Head < 64,
108
579
                  "RelExpr is too large for 64-bit mask!");
109
579
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
579
  }
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
106
579
  static inline uint64_t build() {
107
579
    static_assert(0 <= Head && Head < 64,
108
579
                  "RelExpr is too large for 64-bit mask!");
109
579
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
579
  }
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
106
579
  static inline uint64_t build() {
107
579
    static_assert(0 <= Head && Head < 64,
108
579
                  "RelExpr is too large for 64-bit mask!");
109
579
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
579
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)29, (lld::elf::RelExpr)30, (lld::elf::RelExpr)24, (lld::elf::RelExpr)32>::build()
Line
Count
Source
106
579
  static inline uint64_t build() {
107
579
    static_assert(0 <= Head && Head < 64,
108
579
                  "RelExpr is too large for 64-bit mask!");
109
579
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
579
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)30, (lld::elf::RelExpr)24, (lld::elf::RelExpr)32>::build()
Line
Count
Source
106
579
  static inline uint64_t build() {
107
579
    static_assert(0 <= Head && Head < 64,
108
579
                  "RelExpr is too large for 64-bit mask!");
109
579
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
579
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)24, (lld::elf::RelExpr)32>::build()
Line
Count
Source
106
579
  static inline uint64_t build() {
107
579
    static_assert(0 <= Head && Head < 64,
108
579
                  "RelExpr is too large for 64-bit mask!");
109
579
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
579
  }
lld::elf::RelExprMaskBuilder<(lld::elf::RelExpr)32>::build()
Line
Count
Source
106
579
  static inline uint64_t build() {
107
579
    static_assert(0 <= Head && Head < 64,
108
579
                  "RelExpr is too large for 64-bit mask!");
109
579
    return (uint64_t(1) << Head) | RelExprMaskBuilder<Tail...>::build();
110
579
  }
111
};
112
113
// Return true if `Expr` is one of `Exprs`.
114
// There are fewer than 64 RelExpr's, so we can represent any set of
115
// RelExpr's as a constant bit mask and test for membership with a
116
// couple cheap bitwise operations.
117
66.7k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
118
66.7k
  assert(0 <= Expr && (int)Expr < 64 &&
119
66.7k
         "RelExpr is too large for 64-bit mask!");
120
66.7k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
121
66.7k
}
Unexecuted instantiation: bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)25>(lld::elf::RelExpr)
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)13, (lld::elf::RelExpr)23>(lld::elf::RelExpr)
Line
Count
Source
117
13.2k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
118
13.2k
  assert(0 <= Expr && (int)Expr < 64 &&
119
13.2k
         "RelExpr is too large for 64-bit mask!");
120
13.2k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
121
13.2k
}
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
117
13.1k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
118
13.1k
  assert(0 <= Expr && (int)Expr < 64 &&
119
13.1k
         "RelExpr is too large for 64-bit mask!");
120
13.1k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
121
13.1k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)47, (lld::elf::RelExpr)49, (lld::elf::RelExpr)48>(lld::elf::RelExpr)
Line
Count
Source
117
302
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
118
302
  assert(0 <= Expr && (int)Expr < 64 &&
119
302
         "RelExpr is too large for 64-bit mask!");
120
302
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
121
302
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)53, (lld::elf::RelExpr)54, (lld::elf::RelExpr)57, (lld::elf::RelExpr)56>(lld::elf::RelExpr)
Line
Count
Source
117
284
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
118
284
  assert(0 <= Expr && (int)Expr < 64 &&
119
284
         "RelExpr is too large for 64-bit mask!");
120
284
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
121
284
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)47, (lld::elf::RelExpr)49, (lld::elf::RelExpr)48, (lld::elf::RelExpr)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52>(lld::elf::RelExpr)
Line
Count
Source
117
221
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
118
221
  assert(0 <= Expr && (int)Expr < 64 &&
119
221
         "RelExpr is too large for 64-bit mask!");
120
221
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
121
221
}
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
117
158
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
118
158
  assert(0 <= Expr && (int)Expr < 64 &&
119
158
         "RelExpr is too large for 64-bit mask!");
120
158
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
121
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
117
12.9k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
118
12.9k
  assert(0 <= Expr && (int)Expr < 64 &&
119
12.9k
         "RelExpr is too large for 64-bit mask!");
120
12.9k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
121
12.9k
}
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
117
12.9k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
118
12.9k
  assert(0 <= Expr && (int)Expr < 64 &&
119
12.9k
         "RelExpr is too large for 64-bit mask!");
120
12.9k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
121
12.9k
}
bool lld::elf::isRelExprOneOf<(lld::elf::RelExpr)9, (lld::elf::RelExpr)10, (lld::elf::RelExpr)55, (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)50, (lld::elf::RelExpr)51, (lld::elf::RelExpr)52, (lld::elf::RelExpr)30, (lld::elf::RelExpr)48, (lld::elf::RelExpr)49, (lld::elf::RelExpr)13, (lld::elf::RelExpr)56>(lld::elf::RelExpr)
Line
Count
Source
117
12.9k
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
118
12.9k
  assert(0 <= Expr && (int)Expr < 64 &&
119
12.9k
         "RelExpr is too large for 64-bit mask!");
120
12.9k
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
121
12.9k
}
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
117
579
template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
118
579
  assert(0 <= Expr && (int)Expr < 64 &&
119
579
         "RelExpr is too large for 64-bit mask!");
120
579
  return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
121
579
}
122
123
// Architecture-neutral representation of relocation.
124
struct Relocation {
125
  RelExpr Expr;
126
  RelType Type;
127
  uint64_t Offset;
128
  int64_t Addend;
129
  Symbol *Sym;
130
};
131
132
struct RelocationOffsetComparator {
133
0
  bool operator()(const Relocation &Lhs, const Relocation &Rhs) {
134
0
    return Lhs.Offset < Rhs.Offset;
135
0
  }
136
137
  // For std::lower_bound, std::upper_bound, std::equal_range.
138
0
  bool operator()(const Relocation &Rel, uint64_t Val) {
139
0
    return Rel.Offset < Val;
140
0
  }
141
142
0
  bool operator()(uint64_t Val, const Relocation &Rel) {
143
0
    return Val < Rel.Offset;
144
0
  }
145
};
146
147
template <class ELFT> void scanRelocations(InputSectionBase &);
148
149
class ThunkSection;
150
class Thunk;
151
struct InputSectionDescription;
152
153
class ThunkCreator {
154
public:
155
  // Return true if Thunks have been added to OutputSections
156
  bool createThunks(ArrayRef<OutputSection *> OutputSections);
157
158
  // The number of completed passes of createThunks this permits us
159
  // to do one time initialization on Pass 0 and put a limit on the
160
  // number of times it can be called to prevent infinite loops.
161
  uint32_t Pass = 0;
162
163
private:
164
  void mergeThunks(ArrayRef<OutputSection *> OutputSections);
165
166
  ThunkSection *getISDThunkSec(OutputSection *OS, InputSection *IS,
167
                               InputSectionDescription *ISD, uint32_t Type,
168
                               uint64_t Src);
169
170
  ThunkSection *getISThunkSec(InputSection *IS);
171
172
  void createInitialThunkSections(ArrayRef<OutputSection *> OutputSections);
173
174
  void forEachInputSectionDescription(
175
      ArrayRef<OutputSection *> OutputSections,
176
      llvm::function_ref<void(OutputSection *, InputSectionDescription *)> Fn);
177
178
  std::pair<Thunk *, bool> getThunk(Symbol &Sym, RelType Type, uint64_t Src);
179
180
  ThunkSection *addThunkSection(OutputSection *OS, InputSectionDescription *,
181
                                uint64_t Off);
182
183
  bool normalizeExistingThunk(Relocation &Rel, uint64_t Src);
184
185
  // Record all the available Thunks for a Symbol
186
  llvm::DenseMap<std::pair<SectionBase *, uint64_t>, std::vector<Thunk *>>
187
      ThunkedSymbolsBySection;
188
  llvm::DenseMap<Symbol *, std::vector<Thunk *>> ThunkedSymbols;
189
190
  // Find a Thunk from the Thunks symbol definition, we can use this to find
191
  // the Thunk from a relocation to the Thunks symbol definition.
192
  llvm::DenseMap<Symbol *, Thunk *> Thunks;
193
194
  // Track InputSections that have an inline ThunkSection placed in front
195
  // an inline ThunkSection may have control fall through to the section below
196
  // so we need to make sure that there is only one of them.
197
  // The Mips LA25 Thunk is an example of an inline ThunkSection.
198
  llvm::DenseMap<InputSection *, ThunkSection *> ThunkedSections;
199
};
200
201
// Return a int64_t to make sure we get the sign extension out of the way as
202
// early as possible.
203
template <class ELFT>
204
36
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
205
36
  return 0;
206
36
}
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
204
6
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
205
6
  return 0;
206
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
204
2
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
205
2
  return 0;
206
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
204
16
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
205
16
  return 0;
206
16
}
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
204
12
static inline int64_t getAddend(const typename ELFT::Rel &Rel) {
205
12
  return 0;
206
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&)
207
template <class ELFT>
208
12.5k
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
209
12.5k
  return Rel.r_addend;
210
12.5k
}
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
208
79
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
209
79
  return Rel.r_addend;
210
79
}
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
208
38
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
209
38
  return Rel.r_addend;
210
38
}
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
208
251
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
209
251
  return Rel.r_addend;
210
251
}
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
208
4
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
209
4
  return Rel.r_addend;
210
4
}
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
208
72
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
209
72
  return Rel.r_addend;
210
72
}
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
208
13
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
209
13
  return Rel.r_addend;
210
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
208
1.82k
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
209
1.82k
  return Rel.r_addend;
210
1.82k
}
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
208
10.2k
static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
209
10.2k
  return Rel.r_addend;
210
10.2k
}
211
} // namespace elf
212
} // namespace lld
213
214
#endif