[PATCH] D107324: [llvm-objcopy] [COFF] Do not patch debug entries with Repro type

Pirama Arumuga Nainar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 13:39:35 PDT 2021


pirama added inline comments.


================
Comment at: llvm/tools/llvm-objcopy/COFF/Writer.cpp:432
+            Debug->Type != COFF::IMAGE_DEBUG_TYPE_REPRO) {
+          if (!Debug->AddressOfRawData)
+            return createStringError(object_error::parse_failed,
----------------
>>! In D107324#2923059, @mstorsjo wrote:
> LGTM, thanks!
> 
> I’m considering if it’d be good to change the existing code even further; if the field in the file is zero, regardless of type, we’d just leave it as is, and one error out of its nonzero but can’t be found. WDYT?

Are you suggesting we remove the error check here and call `virtualAddressToFileAddress` only if `Debug->AddressOfRawData` is not `0`?

I considered it but thought I didn't quite understand the connection between the conditional and the error message.  I can amend the patch if you think this is a better choice.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107324/new/

https://reviews.llvm.org/D107324



More information about the llvm-commits mailing list