LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 51243 - [PE/COFF] Error when processing files that don't have debug entry in directories header
Summary: [PE/COFF] Error when processing files that don't have debug entry in director...
Status: NEW
Alias: None
Product: tools
Classification: Unclassified
Component: llvm-objcopy/strip (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Alfonso Sánchez-Beato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-28 02:21 PDT by Alfonso Sánchez-Beato
Modified: 2021-07-28 03:18 PDT (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments
Input file that triggers the bug (74.95 KB, application/x-ms-dos-executable)
2021-07-28 02:21 PDT, Alfonso Sánchez-Beato
Details
Proposed fix (1.29 KB, patch)
2021-07-28 02:24 PDT, Alfonso Sánchez-Beato
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alfonso Sánchez-Beato 2021-07-28 02:21:51 PDT
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.
Comment 1 Alfonso Sánchez-Beato 2021-07-28 02:24:45 PDT
Created attachment 25080 [details]
Proposed fix
Comment 2 James Henderson 2021-07-28 02:36:32 PDT
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.
Comment 3 Alfonso Sánchez-Beato 2021-07-28 03:18:56 PDT
Right, created https://reviews.llvm.org/D106940 now