Created attachment 25079 [details] Input file that triggers the bug I get this error when trying to add a section: $ llvm-objcopy --add-section .sect_name=<any_file> linuxaa64.efi.stub output_f llvm-objcopy: error: 'output_f': debug directory payload outside of mapped sections not supported While actually linuxaa64.efi.stub does not have a debug entry in the Data Directories header.
Created attachment 25080 [details] Proposed fix
Hi Alfonso, I see you've uploaded a proposed fix. It's likely this will get fixed quicker, if you go through the LLVM contribution process yourself, uploading it to Phabricator for review. See https://llvm.org/docs/Contributing.html#how-to-submit-a-patch for details of the patch review and commit process, if you're not familiar with it. You will need to make sure you add a test to the patch too.
Right, created https://reviews.llvm.org/D106940 now