This is the mail archive of the binutils@sources.redhat.com 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]
Other format: [Raw text]

Re: Branching for 2.12


This bug is still present on mingw  target.
 
RE: http://sources.redhat.com/ml/binutils/2002-01/msg00477.html


I am still having probelms with dll import libs built with ld -shared
since hash lookup of sections was introduced  on 2001-12-17. 

With this testcase, test,c
/* test.c */
int __attribute__((dllexport)) 
dll_int (int i)
{
  return i * i;
}

and using binutils from 20011216,
this script

gcc -shared -v -o test20011216.dll -Bd:/binutils-20011216/bin/ \
	-Wl,--out-implib,lib20011216.a  test.c
pedump lib20011216.a

produces a good imort lib:

Contents of LIB20011216.A 1478 bytes


Archive header:1
Name:'/               '
Date:' 1012247688 (Tue Jan 29 07:54:48 2002) '
User id:'0     '
Group id:'0     '
File Mode:'0       '
File Size:'110       '

First linker member
----- ------ ------
5 (5) symbols contained in the archive
[   0] _test20011216_dll_iname Offset 178
[   1] __head_test20011216_dll Offset 506
[   2] _dll_int Offset 906
[   3] __imp__dll_int Offset 906
[   4] __nm__dll_int Offset 906

Archive header:2
<snip>

That one works.

While using  binutils from 20011217 (or later),

gcc -shared -v -o test20011217.dll -Bd:/binutils-20011217/bin/ \
	-Wl,--out-implib,lib20011217.a  test.c
pedump lib20011217.a

produces:

Contents of LIB20011217.A 1372 bytes


Archive header:1
Name:'/               '
Date:' 1012247692 (Tue Jan 29 07:54:52 2002) '
User id:'0     '
Group id:'0     '
File Mode:'0       '
File Size:'4         '

First linker member
----- ------ ------
0 (0) symbols contained in the archive

Archive header:2
<snip>

That one of course fails.  The dll itself, however, is ok. 

I suspect the code in ld/pd-dll.c, particularly, here in make_head(),


line 1591 and follows:
  /* OK, pay attention here.  I got confused myself looking back at
     it.  We create a four-byte section to mark the beginning of the
     list, and we include an offset of 4 in the section, so that the
     pointer to the list points to the *end* of this section, which is
     the start of the list of sections from other objects.  */


I can't, however, see what am I missing, since make_head is also used to
build dll and that works.  The problem is only in the list head in the
import lib.  
Danny


http://my.yahoo.com.au - My Yahoo!
- It's My Yahoo! Get your own!


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