Link Error: GCC 4.2.0 on SunOS-5.8

Ian Lance Taylor iant@google.com
Fri Feb 4 16:26:00 GMT 2011


"HEGDE, ASHA (ASHA)" <asha.hegde@alcatel-lucent.com> writes:

> Final link of ecemcectl.vx ...
>         /vobs/gnu/gcc/SunOS-5.8/bin/g++ cectl_dummy.o newmain.o tmp/__ecemcectl_vx_what.o /vobs/ecem_ucu/make/lib/ecectl/solaris/libecectl_appl.o /vobs/ecem_common/make/lib/ecectl/solaris/libcectl_common.o /vobs/ecem_common_oam/ucu/mhuapp/ecectl/solaris/mhuapp.o /vobs/ecem_rtcx/make/lib/ecectl/solaris/libcectl_rtcx.o /vobs/ecem_1bts/build/usl/pub/lib/ecectl/ram/solaris/usl_ecectl_ram_tgt.a /vobs/ecem_1bts/build/vxWorks4Host/solaris/libvxWorks4SunOS.a -v -uuslAppMain  -uusl_menu  -Wl,-R -Wl,/vobs/gnu/gcc/SunOS-5.8/lib -Wl,-R -Wl,/vobs/ecem_gnulibs/tclreadline/SunOS-5.8/lib -Wl,-R -Wl,/vobs/ecem_gnulibs/readline/SunOS-5.8/lib -W -L -Wl /vobs/ecem_gnulibs/zlib/SunOS-5.8/lib/libz_z.a -X -lnsl -lsocket -lposix4 -lthread -ldl   -o ecemcectl.vx
> Using built-in specs.
> g++: unrecognized option '-X'

g++ does not have a -X option.  I don't know where the problem is here,
but it doesn't seem to be with g++.  The linker does have a -X option;
perhaps this is intended by -Wl,-X?  But the linker's -X option is
rarely used.

> ld: warning: relocation error: file /vobs/ecem_ucu/make/lib/ecectl/solaris/libecectl_appl.o: section .rela.stab: skipping null relocation record

This seems very strange.  You appear to be using the Solaris linker, and
I assume you are also using the Solaris assembler.  The compiler does
not create relocation records; the assembler does.  I do not know why
the Solaris assembler would create an object file that the Solaris
linker complains about.

> ld: fatal: relocation error: R_SPARC_UA32: file .rela.eh_frame: section: /vobs/ecem_ucu/make/lib/ecectl/solaris/libecectl_appl.o: offset: 0x320: relocation requires reference symbol

This one, on the other hand, could be gcc's fault, or it could be the
assembler's fault.  You're going to need to look at that .o file and how
it was created to find out what is wrong.

Ian



More information about the Gcc-help mailing list