[llvm] [llvm-objcopy][COFF] Update WinCFGuard section contents after stripping (PR #153322)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 02:39:21 PDT 2025


================
@@ -92,6 +93,63 @@ Error COFFWriter::finalizeSymbolContents() {
   return Error::success();
 }
 
+Error COFFWriter::finalizeCFGuardContents() {
+  DenseMap<size_t, size_t> SymIdMap;
+  bool NeedUpdate = false;
+  for (Symbol &Sym : Obj.getMutableSymbols()) {
----------------
jh7370 wrote:

> Yes, fixed.

This doesn't look fixed to me. You're still calling `getMutableSymbols` and not `getSymbols` here. Also, please use `const &` where possible, not just `&`.

https://github.com/llvm/llvm-project/pull/153322


More information about the llvm-commits mailing list