PE-COFF and import tables
Pedro Alves
pedro@codesourcery.com
Sun May 10 12:05:00 GMT 2009
More information about the Binutils mailing list
Sun May 10 12:05:00 GMT 2009
- Previous message (by thread): PE-COFF and import tables
- Next message (by thread): PE-COFF and import tables
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
--
Pedro Alves
- Previous message (by thread): PE-COFF and import tables
- Next message (by thread): PE-COFF and import tables
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list