problem with 64 bits binary

jerome duquennoy <[email protected]> Thu, 27 Sep 2007 10:31:14 +0200
Newsgroups gmane.comp.gcc.gnat
Message-ID <[email protected]>
--===============0921946223==
Content-type: multipart/alternative;
 boundary="Boundary_(ID_Mv68T1PMGxfYjl++hvQzHg)"


--Boundary_(ID_Mv68T1PMGxfYjl++hvQzHg)
Content-type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Content-transfer-encoding: 7BIT

Hello,

I have a serious problem with gnat on solaris 9 :

I need to compile my code in 64bits mode.
So, in the gpr file, I added the m64 and RTS=rts-m64 options.
The RTS=rts-m64 don't seem to work, I had to export ADA_INCLUDE_PATH  
and ADA_OBJECTS_PATH to be able to link my soft.

Now, my code is compiled in 64 bits, and the executable linked. It is  
seen by the OS as a 64bits sparcv9 binary :

bash-2.05$ file factory
factory:        ELF 64-bit MSB executable SPARCV9 Version 1,  
dynamically linked, not stripped

But when I launch the binary, it immediately crashes (core dump).

GDB told me it crashed on b~factory.adb, line 2152 :

Program received signal SIGSEGV, Segmentation fault.
0x0000000100434ea4 in main (argc=0, argv=(system.address) 0x0, envp= 
(system.address) 0x0) at b~factory.adb:2152
2152       function main

This line is :

2152:   function main
2153:     (argc : Integer;
2154:      argv : System.Address;
2155:      envp : System.Address)
2156:      return Integer

How can a program crash on the main function header ???
Can the binary code be invalid ?

The 32 bit version executes fine on the same OS, compiled with the  
same version of gnat (GNAT Pro 5.04a1).

Thanks for your help !

--Boundary_(ID_Mv68T1PMGxfYjl++hvQzHg)
Content-type: text/html; charset=ISO-8859-1
Content-transfer-encoding: quoted-printable

<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; ">Hello,<BR><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>I have a serious problem =
with gnat on solaris 9 :</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>I need to compile my code =
in 64bits mode.</DIV><DIV>So, in the gpr file, I added the m64 and =
RTS=3Drts-m64 options.</DIV><DIV>The RTS=3Drts-m64 don't seem to work, I =
had to export ADA_INCLUDE_PATH and ADA_OBJECTS_PATH to be able to link =
my soft.</DIV><DIV><BR class=3D"khtml-block-placeholder"></DIV><DIV>Now, =
my code is compiled in 64 bits, and the executable linked. It is seen by =
the OS as a 64bits sparcv9 binary :</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV><I>bash-2.05$ file factory=A0=
 </I></DIV><DIV><I>factory:=A0 =A0 =A0 =A0 ELF 64-bit MSB executable =
SPARCV9 Version 1, dynamically linked, not stripped</I></DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>But when I launch the =
binary, it=A0immediately crashes (core dump).</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>GDB told me it crashed on =
b~factory.adb, line 2152 :</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV><I>Program received signal =
SIGSEGV, Segmentation fault.</I></DIV><DIV><I>0x0000000100434ea4 in main =
(argc=3D0, argv=3D(system.address) 0x0, envp=3D(system.address) 0x0) at =
b~factory.adb:2152</I></DIV><DIV><I>2152=A0 =A0 =A0=A0 function =
main</I></DIV><DIV><BR class=3D"khtml-block-placeholder"></DIV><DIV>This =
line is :=A0</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV><I>2152:=A0 =A0function =
main</I></DIV><DIV><I>2153:=A0 =A0=A0 (argc : =
Integer;</I></DIV><DIV><I>2154:=A0 =A0 =A0 argv : =
System.Address;</I></DIV><DIV><I>2155:=A0 =A0 =A0 envp : =
System.Address)</I></DIV><DIV><I>2156:=A0 =A0 =A0 return =
Integer</I></DIV><DIV><I><BR =
class=3D"khtml-block-placeholder"></I></DIV><DIV>How can a program crash =
on the main function header ???</DIV><DIV>Can=A0the binary code be =
invalid ?</DIV><DIV><BR class=3D"khtml-block-placeholder"></DIV><DIV>The =
32 bit version executes fine on the same OS, compiled with the same =
version of gnat (GNAT Pro 5.04a1).</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>Thanks for your help =
!</DIV></BODY></HTML>=

--Boundary_(ID_Mv68T1PMGxfYjl++hvQzHg)--



--===============0921946223==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
help-gnat mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gnat

--===============0921946223==--