[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNU/Linker and Microsoft object code.
From: |
Pascal Obry |
Subject: |
Re: GNU/Linker and Microsoft object code. |
Date: |
Fri, 29 Jun 2001 10:36:27 +0200 |
Hi Nick,
Here is a simple way to reproduce the problem using only C code.
File simple.c
<<
#include <stdio.h>
int a = 34;
int b = 12;
void c_simple (void);
int
main (void)
{
printf ("a = %d\n", a);
printf ("b = %d\n", b);
c_simple ();
}
>>
File c_vsimple.c
<<
#include <stdio.h>
int u = 2;
int c = 0;
void
c_simple (void)
{
printf ("local C = %d\n", c);
}
>>
How to reproduce:
$ gcc -c simple.c
$ cl /C /MD c_vsimple.c
$ ld --print-map -o csimple.exe d:/usr/gnat/lib/crt2.o
-Ld:/usr/gnat/lib/gcc-lib/pentium-mingw32msv/2.8.1 -Ld:/usr/gnat/lib simple.o
c_vsimple.obj -lmingw32 -lgcc -lmoldname -lmsvcrt -lkernel32 -ladvapi32
-lshell32 -lmingw32 -lgcc -lmoldname -lmsvcrt
In this map we have 'a' and 'b' defined, but 'c' is not ! All variables in C
code compiled with Microsoft Linker and initialized to 0 is not mapped. This
is the bug and you should be able to reproduce it.
Do you see where the problem could come from ?
Cheers,
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"