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 51244 - [PE/COFF] --set-section-flags is ignored when used jointly with --add-section, so size and VMA are not set
Summary: [PE/COFF] --set-section-flags is ignored when used jointly with --add-section...
Status: NEW
Alias: None
Product: tools
Classification: Unclassified
Component: llvm-objcopy/strip (show other bugs)
Version: trunk
Hardware: PC Linux
: P enhancement
Assignee: Alfonso Sánchez-Beato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-28 02:33 PDT by Alfonso Sánchez-Beato
Modified: 2021-07-28 03:21 PDT (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments
Proposed fix (3.32 KB, patch)
2021-07-28 02:42 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:33:37 PDT
When running

llvm-objcopy --add-section .sect=<file> --set-section-flags .sect=data <input> <output>

for a PE/COFF binary, the section flags are ignored, so VirtualSize and VirtualAddress in the section header are always set to 0.
Comment 1 Alfonso Sánchez-Beato 2021-07-28 02:42:56 PDT
Created attachment 25081 [details]
Proposed fix
Comment 2 Alfonso Sánchez-Beato 2021-07-28 03:21:40 PDT
Created differential: https://reviews.llvm.org/D106942