https://sourceware.org/bugzilla/show_bug.cgi?id=27425
Bug ID: 27425 Summary: erroneous __ImageBase relocation using Microsoft COFF .OBJ linked to .ELF x86_64 Product: binutils Version: 2.36 Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: minnowware at hotmail dot com Target Milestone: --- Hi H.J. there are two (2) more bugs related closely to https://sourceware.org/bugzilla/show_bug.cgi?id=26583 and https://sourceware.org/bugzilla/show_bug.cgi?id=27171. Microsoft COFF x86-64 introduces the "__ImageBase" relative addressing method. In the .OBJ file a new relocation type is used: IMAGE_REL_AMD64_ADDR32NB. Please find my comprehensive description here: https://github.com/KilianKegel/GNU-ld-for-MicrosoftCOFF-to-LinuxELF#__imagebase-bugs This is mishandled in 2 ways 1a. the 32Bit field ADDR32NB is a DISPLACEMENT only field, but initialized by GNU ld with data offset + 64Bit __executable_start address 1b. the base address address register involved in this addressing scheme is initialized to ZERO instead to __executable_start / __ImageBase https://github.com/KilianKegel/GNU-ld-for-MicrosoftCOFF-to-LinuxELF#addr32nb-initialization-w-__imagebase 2. the symbol addresses taken for __ImageBase addressing scheme are wrong. EIP relative addresses taken from the same section instead are correct. https://github.com/KilianKegel/GNU-ld-for-MicrosoftCOFF-to-LinuxELF#addr32nb-offset-miscalculation I would really appreciate if you could fix this issue. Best regards, Kilian -- You are receiving this mail because: You are on the CC list for the bug.