old-cross-binutils/ld/testsuite/ld-pe/direct2_client.c
Kai Tietz 8a9eab9b5e 2009-11-15 Kai Tietz <kai.tietz@onevision.com>
* pe-dll.c (pe_undef_alias_cdecl_match): New function.
	(pe_find_cdecl_alias_match): New function.
	(pe_process_import_defs): Add matching for import symbols
	declared as cdecl for fastcall/stdcall.
	* emultempl/pe.em (pe_undef_cdecl_match): Treat fastcall
	symbols, too.
	(pe_fixup_stdcalls): Likewise.
	(gld_XXX_after_open): Redo scanning for imported
	fastcall/stdcall symbols as cdecl one.
	* emultempl/pep.em (pep_undef_cdecl_match): Treat fastcall
	symbols, too.
	(pep_fixup_stdcalls): Likewise.
	(gld_XXX_after_open): Redo scanning for imported
	fastcall/stdcall symbols as cdecl one.

2009-11-15  Kai Tietz  <kai.tietz@onevision.com>

	* ld-pe/direct2_client.c: New file.
	* ld-pe/direct2_dll.c: Likewise.
	* ld-pe/direct2_dll.def: Likewise.
	* ld-pe/pe-run2.exp: Likewise.
2009-11-15 07:52:45 +00:00

47 lines
668 B
C

extern void abort (void);
void
__cdecl
lib2foocdecl(int junk1, int* junk2);
void
__stdcall
lib2foostdcall(int junk1, int* junk2);
void
__fastcall
lib2foofastcall(int junk1, int* junk2);
void
__cdecl
lib1foocdecl(int junk1, int* junk2)
{
lib2foocdecl(junk1, junk2);
}
void
__stdcall
lib1foostdcall(int junk1, int* junk2)
{
lib2foostdcall(junk1, junk2);
}
void
__fastcall
lib1foofastcall(int junk1, int* junk2)
{
lib2foofastcall(junk1, junk2);
}
int main()
{
int junk[3];
lib1foofastcall (1, &junk[0]);
lib1foostdcall (2, &junk[1]);
lib1foocdecl (3, &junk[2]);
if (junk[1] != 2 || junk[0] != 1 || junk[2] != 3)
abort ();
return 0;
}