cancel
Showing results for 
Search instead for 
Did you mean: 

loader error

Pavan Rao
Occasional Contributor

loader error

Hi ,

I am portin a java and C application ( mostly java and very little C ) from Solaris to HPUX and i have hit the below error

/opt/java1.5//bin/IA64N/javac -d . Des.java
cc -g -I/opt/java1.5//include -I/opt/java1.5//include/hp-ux -c DesImp.c
"DesImp.c", line 54: warning #3056-D: returning pointer to local variable
return(ddd);
^

"DesImp.c", line 69: warning #3056-D: returning pointer to local variable
return(ddd);
^

ld -G DesImp.o des.a -o libDes.so
ld: Bad machine type: 2 in file des.a[des.o]
Fatal error.
*** Error exit code 1

Stop.

Can you tell me

1. what this means ?
could it be that the binary is not in elf format ??

2.how can i fix it ?
1 REPLY
Dennis Handly
Acclaimed Contributor

Re: loader error

>warning #3056-D: returning pointer to local variable

This code is illegal, what is the type of ddd?

>ld -G DesImp.o des.a -o libDes.so

Why are you invoking ld directly? You should NOT do that. You should use cc to create your shlibs:
cc -b -o libDes.so DesImp.o des.a
(I'm not sure why you have -G?)

>1. what this means? could it be that the binary is not in ELF format?
>2. how can I fix it?

The object file or archive is corrupt. Remove des.a and rebuild it.