ld: warn about PE base relocations to sections above .reloc
authorJan Beulich <jbeulich@suse.com>
Tue, 6 Apr 2021 08:54:57 +0000 (10:54 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 6 Apr 2021 08:54:57 +0000 (10:54 +0200)
commitbd3d1480a80effbbf3eedf1bd51368730ec9078d
tree3e8e96c1c85af04173449ac81abf74b245a6e004
parentd811a7cf74fa8523f67a13c0527b27f4954e9ae1
ld: warn about PE base relocations to sections above .reloc

Due to a bogus linker script, or perhaps because a section doesn't get
placed by a linker script while default placement puts it too high up,
sections can end up above .reloc. Since the process of determining its
contents (and hence its size) happens before final section placement,
relocations needed for such sections would no longer point at the
correct address in the final binary. Warn about this (down the road this
may want to become an error, unless size determination and content
creation for .reloc would get decoupled).

To avoid triggering the warning when .reloc gets discarded, suppress
populating the section in the first place in this case.
ld/ChangeLog
ld/pe-dll.c
This page took 0.023906 seconds and 4 git commands to generate.