This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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.

(bfd/opncls.c: bfd_make_readable)
	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:

(bfd/coffcode.h: coff_write_object_contents)
-	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:

amount		169187232
lineno_base	169187232
reloc_base	198
scn_base	20
sym_base	198
reloc_size	30
lnno_size	168176232

And that's as far as I've been able to get.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]