]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
bfd / PE/COFF: avoid setting SEC_ALLOC when finding IMAGE_SCN_MEM_DISCARDABLE
authorJan Beulich <jbeulich@suse.com>
Fri, 10 Oct 2025 13:58:30 +0000 (15:58 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Oct 2025 13:58:30 +0000 (15:58 +0200)
commitef3816215dfa95a298d26bad0be8ccf7cb74153f
tree5a51659c1fd447bed1b35af912717740bd9cc80c
parent6e870bea5f3d79a63604e1b5141385e011061df7
bfd / PE/COFF: avoid setting SEC_ALLOC when finding IMAGE_SCN_MEM_DISCARDABLE

Before teaching _bfd_XXi_swap_scnhdr_out() to respect SEC_ALLOC when
considering whether to force IMAGE_SCN_MEM_DISCARDABLE for a section,
make sure we won't "invert" present wrong behavior when transforming an
incoming object's section attributes to an outgoing one's (objcopy or
"ld -r"): Right now, IMAGE_SCN_MEM_DISCARDABLE would appear out of the
blue for certain sections. We don't want the opposite, though, i.e. we
want avoid silently dropping IMAGE_SCN_MEM_DISCARDABLE when it's present
for an incoming object's section.
bfd/coffcode.h