aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lld/COFF/Symbols.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lld/COFF/Symbols.h')
-rw-r--r--contrib/llvm-project/lld/COFF/Symbols.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/contrib/llvm-project/lld/COFF/Symbols.h b/contrib/llvm-project/lld/COFF/Symbols.h
index 1da4df366966..13e7488d6b87 100644
--- a/contrib/llvm-project/lld/COFF/Symbols.h
+++ b/contrib/llvm-project/lld/COFF/Symbols.h
@@ -103,8 +103,8 @@ protected:
explicit Symbol(Kind k, StringRef n = "")
: symbolKind(k), isExternal(true), isCOMDAT(false),
writtenToSymtab(false), pendingArchiveLoad(false), isGCRoot(false),
- isRuntimePseudoReloc(false), nameSize(n.size()),
- nameData(n.empty() ? nullptr : n.data()) {}
+ isRuntimePseudoReloc(false), deferUndefined(false), canInline(true),
+ nameSize(n.size()), nameData(n.empty() ? nullptr : n.data()) {}
const unsigned symbolKind : 8;
unsigned isExternal : 1;
@@ -130,6 +130,16 @@ public:
unsigned isRuntimePseudoReloc : 1;
+ // True if we want to allow this symbol to be undefined in the early
+ // undefined check pass in SymbolTable::reportUnresolvable(), as it
+ // might be fixed up later.
+ unsigned deferUndefined : 1;
+
+ // False if LTO shouldn't inline whatever this symbol points to. If a symbol
+ // is overwritten after LTO, LTO shouldn't inline the symbol because it
+ // doesn't know the final contents of the symbol.
+ unsigned canInline : 1;
+
protected:
// Symbol name length. Assume symbol lengths fit in a 32-bit integer.
uint32_t nameSize;
@@ -343,6 +353,13 @@ public:
uint16_t getOrdinal() { return file->hdr->OrdinalHint; }
ImportFile *file;
+
+ // This is a pointer to the synthetic symbol associated with the load thunk
+ // for this symbol that will be called if the DLL is delay-loaded. This is
+ // needed for Control Flow Guard because if this DefinedImportData symbol is a
+ // valid call target, the corresponding load thunk must also be marked as a
+ // valid call target.
+ DefinedSynthetic *loadThunkSym = nullptr;
};
// This class represents a symbol for a jump table entry which jumps
@@ -461,7 +478,9 @@ void replaceSymbol(Symbol *s, ArgT &&... arg) {
"SymbolUnion not aligned enough");
assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&
"Not a Symbol");
+ bool canInline = s->canInline;
new (s) T(std::forward<ArgT>(arg)...);
+ s->canInline = canInline;
}
} // namespace coff