@@ -1986,17 +1986,10 @@ static void maybeAddAddressTakenFunction(SymbolRVASet &addressTakenSyms,
1986
1986
// Common is always data, so it is ignored.
1987
1987
break ;
1988
1988
case Symbol::DefinedAbsoluteKind:
1989
+ case Symbol::DefinedSyntheticKind:
1989
1990
// Absolute is never code, synthetic generally isn't and usually isn't
1990
1991
// determinable.
1991
1992
break ;
1992
- case Symbol::DefinedSyntheticKind:
1993
- // For EC export thunks, mark both the thunk itself and its target.
1994
- if (auto expChunk = dyn_cast_or_null<ECExportThunkChunk>(
1995
- cast<Defined>(s)->getChunk ())) {
1996
- addSymbolToRVASet (addressTakenSyms, cast<Defined>(s));
1997
- addSymbolToRVASet (addressTakenSyms, expChunk->target );
1998
- }
1999
- break ;
2000
1993
case Symbol::LazyArchiveKind:
2001
1994
case Symbol::LazyObjectKind:
2002
1995
case Symbol::LazyDLLSymbolKind:
@@ -2061,11 +2054,9 @@ void Writer::createGuardCFTables() {
2061
2054
// with /guard:cf.
2062
2055
for (ObjFile *file : ctx.objFileInstances ) {
2063
2056
if (file->hasGuardCF ()) {
2064
- ctx.forEachSymtab ([&](SymbolTable &symtab) {
2065
- Symbol *flagSym = symtab.findUnderscore (" __guard_flags" );
2066
- cast<DefinedAbsolute>(flagSym)->setVA (
2067
- uint32_t (GuardFlags::CF_INSTRUMENTED));
2068
- });
2057
+ Symbol *flagSym = ctx.symtab .findUnderscore (" __guard_flags" );
2058
+ cast<DefinedAbsolute>(flagSym)->setVA (
2059
+ uint32_t (GuardFlags::CF_INSTRUMENTED));
2069
2060
break ;
2070
2061
}
2071
2062
}
@@ -2147,10 +2138,8 @@ void Writer::createGuardCFTables() {
2147
2138
guardFlags |= uint32_t (GuardFlags::CF_LONGJUMP_TABLE_PRESENT);
2148
2139
if (config->guardCF & GuardCFLevel::EHCont)
2149
2140
guardFlags |= uint32_t (GuardFlags::EH_CONTINUATION_TABLE_PRESENT);
2150
- ctx.forEachSymtab ([guardFlags](SymbolTable &symtab) {
2151
- Symbol *flagSym = symtab.findUnderscore (" __guard_flags" );
2152
- cast<DefinedAbsolute>(flagSym)->setVA (guardFlags);
2153
- });
2141
+ Symbol *flagSym = ctx.symtab .findUnderscore (" __guard_flags" );
2142
+ cast<DefinedAbsolute>(flagSym)->setVA (guardFlags);
2154
2143
}
2155
2144
2156
2145
// Take a list of input sections containing symbol table indices and add those
@@ -2221,12 +2210,10 @@ void Writer::maybeAddRVATable(SymbolRVASet tableSymbols, StringRef tableSym,
2221
2210
tableChunk = make<RVATableChunk>(std::move (tableSymbols));
2222
2211
rdataSec->addChunk (tableChunk);
2223
2212
2224
- ctx.forEachSymtab ([&](SymbolTable &symtab) {
2225
- Symbol *t = symtab.findUnderscore (tableSym);
2226
- Symbol *c = symtab.findUnderscore (countSym);
2227
- replaceSymbol<DefinedSynthetic>(t, t->getName (), tableChunk);
2228
- cast<DefinedAbsolute>(c)->setVA (tableChunk->getSize () / (hasFlag ? 5 : 4 ));
2229
- });
2213
+ Symbol *t = ctx.symtab .findUnderscore (tableSym);
2214
+ Symbol *c = ctx.symtab .findUnderscore (countSym);
2215
+ replaceSymbol<DefinedSynthetic>(t, t->getName (), tableChunk);
2216
+ cast<DefinedAbsolute>(c)->setVA (tableChunk->getSize () / (hasFlag ? 5 : 4 ));
2230
2217
}
2231
2218
2232
2219
// Create CHPE metadata chunks.
0 commit comments