[uClibc]elf2flt linker error

Bob Cheng hdrhg at hotmail.com
Mon Aug 5 03:17:09 UTC 2002


Hi Eric:

  Please let me describe my problem more clearly again:

(1) I downloaded your gcc-3.1-uclibc-20020711.src.tar.gz on a Redhat 7.2 
host.
I modify the Makefile like this:

ARCH:=arm
HAS_MMU:=false
USE_UCLIBC_SNAPSHOT:=false
TARGETS:=gcc_final
TARGET_LANGUAGES:=c,c++
#ifneq ($(HAS_MMU),true)
###TARGETS:=elf2flt
#TARGET_LANGUAGES:=c
#endif

Then I successfully build the toolchain. Next I compile the C++ code 
(openh323 & openisdngw) with the toolchain's g++, it compiles ok but leave 
me an object file that I can't load and run on uClinux:

[bob at voip obj_linux_arm_r]$ file openisdngw
openisdngw.gccfinal: ELF 32-bit LSB executable, ARM, version 1, statically 
linke
d, stripped

(2) I restart the whole process by editing the Makefile of toolchain to 
remove '###' from '###TARGETS:=elf2flt' line. Rebuild toolchain ok. Compile 
C++ code produces errors on the final link step:

/home/bob/gcc-3.1/toolchain/lib/gcc-lib/arm-linux/3.1/../../../../arm-linux/lib/
libstdc++.a(locale.o):/home/bob/gcc-3.1/build/gcc-3.1/libstdc++-v3/src/locale.cc
:308: the 'setlocale' function supports only C|POSIX locales
/home/bob/gcc-3.1/toolchain/bin/arm-uclibc-ld.real: address 0x42ad80 of 
obj_linu
x_arm_r/openisdngw.elf section .text is not within region flatmem
collect2: ld returned 1 exit status
make[1]: *** [obj_linux_arm_r/openisdngw] Error 1

However, it leaves a big file to me:

[bob at voip obj_linux_arm_r]$ file openisdngw.elf2flt
openisdngw.elf2flt: ELF 32-bit LSB relocatable, ARM, version 1, not stripped

I try to do elf2flt manually:

[bob at voip obj_linux_arm_r]$ 
/home/bob/gcc-3.1/toolchain/bin/arm-uclibc-elf2flt o
penisdngw.elf2flt
ERROR: text=31ada8 overlaps data=0 ?

>From: Erik Andersen <andersen at codepoet.org>
>Reply-To: andersen at codepoet.org
>To: Bob Cheng <hdrhg at hotmail.com>
>CC: uclibc at uclibc.org
>Subject: Re: [uClibc]elf2flt linker error
>Date: Fri, 2 Aug 2002 04:46:06 -0600
>
>On Fri Aug 02, 2002 at 06:13:39PM +0800, Bob Cheng wrote:
> > If I enable the 'TARGETS:=elf2flt' line, I will get linker error:
> >
> > 
>/home/bob/gcc-3.1/toolchain/lib/gcc-lib/arm-linux/3.1/../../../../arm-linux/lib/
> > 
>libstdc++.a(locale.o):/home/bob/gcc-3.1/build/gcc-3.1/libstdc++-v3/src/locale.cc
> > :308: the 'setlocale' function supports only C|POSIX locales
> > /home/bob/gcc-3.1/toolchain/bin/arm-uclibc-ld.real: address 0x42ad80 of
> > obj_linu
> > x_arm_r/openisdngw.elf section .text is not within region flatmem
> > collect2: ld returned 1 exit status
> > make[1]: *** [obj_linux_arm_r/openisdngw] Error 1
>
>I am not sure why, but it appears you are trying to compile
>elf2flt using the target compiler!?!?!  elf2flt runs on your
>development system, not the target system.   I think you must
>have done something to the Makefile for this to happen,
>
>  -Erik
>
>--
>Erik B. Andersen             http://codepoet-consulting.com/
>--This message was written using 73% post-consumer electrons--




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com




More information about the uClibc mailing list