]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
ld/PE: special-case relocation types only for COFF inputs
authorJan Beulich <jbeulich@suse.com>
Wed, 11 Jun 2025 12:32:34 +0000 (14:32 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 11 Jun 2025 12:32:34 +0000 (14:32 +0200)
commit4e7b9bd8ab96b9afb02646c0b5b70b2a5ad90fec
treef99938118fae9996588423e5f42d1964219010e7
parent24849da5a8990bd5a3019ba62f7286274c2a8359
ld/PE: special-case relocation types only for COFF inputs

In 72cd2c709779 ("ld/PE: no base relocs for section (relative) ones") I
made a pre-existing problem quite a bit worse: When looking at a
relocation's (numerical) howto->type, that value is meaningful only if
the object was of corresponding COFF type. ELF objects in particular
have their own enumeration. As it stands, specifically the not entirely
unusual R_X86_64_32 and R_X86_64_32S did no longer have relocations
emitted for them, due to matching R_AMD64_SECTION and R_AMD64_SECREL in
value respectively.
ld/pe-dll.c