[RFC] BFD sets wrong start address during format detection
Frederic RISS
frederic.riss@st.com
Wed Nov 23 10:26:00 GMT 2005
(Please CC me on replies as I'm not suscribed to binutils@)
Hi,
I've hit a strange issue yesterday. I was working with a GDB targeted
for elf32-shl and inferior calls made by GDB were failing. GDB uses the
ELF entry point address in some way to do these inferior calls. In fact,
the BFD was telling GDB that the entry point was 0xffffffff88002000
instead of 0x88002000.
I first thought that BFD misdetected my file as being elf32-sh64 which
does sign extension. In fact, the file was correctly detected as
elf32-shl, but in the process of testing the binary, the entry point
address of the struct bfd* was overwritten during the elf32-sh64 backend
test that happened afterwards.
The attached patch fixes this issue for me. It moves the entry point
recording down after the last point of failure, so that it's done only
when the backend actually matches the file.
Does that seem safe ?
Fred.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: init_start_address_later.patch
Type: text/x-patch
Size: 994 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20051123/95c374da/attachment.bin>
More information about the Binutils
mailing list