This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PE known sections having certain flags enforced
- From: "Jan Beulich" <JBeulich at suse dot com>
- To: "Nick Clifton" <nickc at redhat dot com>
- Cc: <binutils at sourceware dot org>
- Date: Mon, 09 Oct 2017 05:54:28 -0600
- Subject: PE known sections having certain flags enforced
- Authentication-results: sourceware.org; auth=none
Hi Nick,
back in 2003 you've changed bfd/peXXigen.c's
_bfd_XXi_swap_scnhdr_out() to force certain flags for known
sections. Considering the function this lives in, the change appears
to make it impossible to create binaries with flags varying from the
ones being enforced there, as even objcopy would come through
that path. As per
https://lists.xenproject.org/archives/html/xen-devel/2017-09/msg02485.html
we've found a need to produce .reloc sections without the
discardable flag set, as the Xen image itself re-uses the relocation
tables to relocate itself a second time after having been loaded by
the UEFI loader.
Do you have any suggestion how to achieve this without creating
a custom tool to effect the change, and also without renaming the
section (since, as sad as it is, it's likely not just binutils to imply
section purpose from section name)?
Jan