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

Evgenii Kudriashov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 06:27:26 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()) {
----------------
e-kud wrote:

The code changed, now we collect `coff_aux_section_definition` that need to be mutable to set the checksum. We can use `const_cast` though but I hope this is not what is meant.

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


More information about the llvm-commits mailing list