This is the mail archive of the
mailing list for the binutils project.
Re: binutils-20000625 ld.exe --shared broken
DJ Delorie wrote:
> > I agree with DJ, although I must confess I had to read the explanation
> > and look through the code a couple of times before understanding what
> > is going on.
> I wish I had understood it after just a *couple* of reads. It took me
> a lot longer than that to figure out why pe-dll was having such a hard
> time of it, until Ian clued me in that BFD_IN_MEMORY was an old hack
> and unlikely to still work right.
> I'll work up a comment for that part of the code, though.
Okay, further investigation shows:
'pe_dll_generate_implib' calls 'make_head', 'make_one' (many times), and
'make_tail' -- so each member bfd of the implib is processed by one of
these three routines. Each of these three routines call
'bfd_make_readable' on the bfd. However, that call fails.
So, 'bfd_make_readable' is broken.
613 if (! BFD_SEND_FMT (abfd, _bfd_write_contents, (abfd)))
614 return false;
The clause expands to 'if (! coff_write_object_contents(abfd))' based on
all the #define's and stuff, so:
- 3250 if (bfd_seek (abfd, scn_base, SEEK_SET) != 0)
- 3251 return false;
And this clause is tripped, so coff_write_... returns false, and
bfd_make_readable returns false, and the bfd is still set to direction =
write_direction, etc, etc.
Just before the return, the values of some of the variables are:
And that's as far as I've been able to get.