This is the mail archive of the binutils@sourceware.org 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: PE-COFF and import tables


On Sun, 10 May 2009 13:05:43 +0100, Pedro Alves <pedro@codesourcery.com>
wrote:
> On Sunday 10 May 2009 12:42:01, Vincent R. wrote:
> 
>> I tried to understand why only _fileno and _strdup are put in a separate
>> entry and the only common
>> point is the fact these two symbols are actually defines and also that
>> they
>> are defined in libcoredll.a 
>> and in libceoldname.a
>> 
>> in libcoredll.a they are defined as : _strdup and _fileno (prefixed by a
>> _)
>> in libceoldname.a they are defined as : strdup and fileno
> 
> The underscored versions are what really exists in coredll.dll. 
> lib*oldname.a
> is a compatibility import lib that through .def file magic allows
> references
> to a few non-underscored functions to still link and resolve to the
> underscored
> versions, otherwise, this wouldn't link:
> 
>  int main ()
>  {
>     strdup (0);
>  }
> 
> , because there's no real strdup function in MSFT's runtimes.
> 
> The proper way to write that for Windows would be:
> 
>  int main ()
>  {
>     _strdup (0);
>  }
> 
> , but, this is a portability nuisance, hence, the magic *oldname.a
> import lib.
> 
> You have references to both `strdup' and `fileno' somewhere
> in your code.
So in my opinion 




So I have tested after having modified mingw/Makefile.in and now I get the
same name :

 0001a050       0001a12c 00000000 00000000 0001a94c 0001a298

        DLL Name: COREDLL.dll
        vma:  Hint/Ord Member-Name Bound-To
        1a5ac       4  _fileno
        1a5b6      19  _strdup

 0001a064       0001a138 00000000 00000000 0001aa1c 0001a2a4

        DLL Name: COREDLL.dll
        vma:  Hint/Ord Member-Name Bound-To
        1a5c0     174  CreateFileW
        1a5ce     240  DeleteCriticalSection
        1a5e6     243  DeleteFileW
        ...
        ...            _strdup
 


but still in two different entries.


Then I have removed the /* #  define strdup(s) _strdup(s) */ in Evil.h and 
now I still have two entries but _strdup is only referenced in first one.
So from what I understand I shouldn't link with libceoldname because it's
the reason
I have two entries.














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