You probably need to change "-64" to "-m64" or "-xarch=amd64"
to pickup 64-bit compiler libraries and run-time support.

Peter.


> Date: Fri, 17 Mar 2006 06:52:31 -0800 (PST)
> From: Anunay <guptaanunay at rediffmail.com>
> Subject: [tools-linking] wrong ELF class: ELFCLASS64 Error
> To: tools-linking at opensolaris.org
> X-BeenThere: tools-linking at opensolaris.org
> Delivered-to: tools-linking at opensolaris.org
> X-PMX-Version: 5.1.2.240295
> X-Original-To: tools-linking at opensolaris.org
> X-Mailman-Version: 2.1.4
> List-Post: <mailto:tools-linking at opensolaris.org>
> List-Subscribe: <http://mail.opensolaris.org/mailman/listinfo/tools-linking>, 
<mailto:tools-linking-request at opensolaris.org?subject=subscribe>
> List-Unsubscribe: 
<http://mail.opensolaris.org/mailman/listinfo/tools-linking>, 
<mailto:tools-linking-request at opensolaris.org?subject=unsubscribe>
> List-Archive: <http://mail.opensolaris.org/pipermail/tools-linking>
> List-Help: <mailto:tools-linking-request at opensolaris.org?subject=help>
> List-Id: Dynamic Linking <tools-linking.opensolaris.org>
> 
> Hello all,
> 
> I am trying to build my application in 64-bit mode.
> 
> My command line for compilation is :-
> # CC -mt [b]-64[/b] -o 
/export/home1/etpki/obj/sol_i386_5.10/libtme/test1/test1 -R/usr/lib/amd64 
/export/home1/etpki/obj/sol_i386_5.10/libtme/test1/test1.o   
/export/home1/etpki/obj/sol_i386_5.10/libtme/test1/../libtme.a -lposix4
> 
> The error reported is as follows:-
> CC: Warning: Option -64 passed to ld, if ld is invoked, ignored otherwise
> ld: fatal: file /export/home1/etpki/obj/sol_i386_5.10/libtme/test1/test1.o: 
[b]wrong ELF class: ELFCLASS64[/b]
> ld: fatal: File processing errors. No output written to 
/export/home1/etpki/obj/sol_i386_5.10/libtme/test1/test1
> 
> Doing file on test1.o shows:-
> bash-3.00# file /export/home1/etpki/obj/sol_i386_5.10/libtme/test1/test1.o
> /export/home1/etpki/obj/sol_i386_5.10/libtme/test1/test1.o:     [b]ELF 
64-bit[/b] LSB relocatable AMD64 Version 1
> 
> bash-3.00# which ld
> /usr/bin/ld
> bash-3.00# ls -l /usr/bin/ld
> lrwxrwxrwx   1 root     other         21 Mar  7 13:43 /usr/bin/ld -> 
/usr/ccs/bin/amd64/ld
> 
> So, as the file output shows, the .o is 64-bit. So, the linker should create 
the test1 binary in 64-bit mode, instead it reports this wrong ELF class error.
> Machine specifications: Solaris 10 x86_64 bit
> Compiler: Sun Studio 11
> 
> Any help will be grateful,
> Thanks,
> Anunay
> This message posted from opensolaris.org
> _______________________________________________
> tools-linking mailing list
> tools-linking at opensolaris.org


Reply via email to