]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
ld/PE: adjust .reloc and .edata section flags
authorJan Beulich <jbeulich@suse.com>
Fri, 10 Oct 2025 13:57:36 +0000 (15:57 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Oct 2025 13:57:36 +0000 (15:57 +0200)
commit3f80863fbf9b8dfb70c8dbf1f71220c4910318f9
tree6cd93e4a8d3b4f09a12cfab3110c6183d1b3d75e
parent16ca38abaa67b0c02f7f6f504cfeb55f75ec1344
ld/PE: adjust .reloc and .edata section flags

Both really want to be SEC_DATA, even if _bfd_XXi_swap_scnhdr_out()
makes sure that IMAGE_SCN_CNT_INITIALIZED_DATA is set in the final
section header. Otoh, .reloc - being IMAGE_SCN_MEM_DISCARDABLE at least
by default - shouldn't have SEC_ALLOC set.

In an early form of the patch I also dropped SEC_ALLOC for .reloc. While
I've undone that, I think the then necessary testsuite adjustments still
want retaining:

1) I can't explain why the removal of _both_ SEC_ALLOC and SEC_LOAD for
.reloc causes ld-scripts/provide-8 to XPASS on PE targets. Placing a
symbol outside of the image isn't well-defined in PE anyway though, so
convert the xfail-s to notarget-s.

2) The ld-pe/pe-aarch64 fragility is now dealt with in a separate patch.
ld/pe-dll.c
ld/testsuite/ld-scripts/provide-8.d