[uClinux-dev] arm-uclinux-gcc problem with relocation symbols

Durgesh Pattamatta DPattamatta at valencesemi.com
Thu Nov 1 19:19:00 EST 2001


Finally, I was able to resolve the problem. The problem was with linker
options in the ldelf2flt make file. The make file had the following linker
options

TOOLDIR = /opt/arm-little-uclinux
CC = gcc
CFLAGS = -O2 -I$(TOOLDIR)/include
LDFLAGS = -L$(TOOLDIR)/lib -lbfd -liberty

But somehow gcc on my redhat host was picking it's own( i686-linux) bfd
library instead of the cross compiler bfd library present in TOOLDIR. So, I
had to link ldelf2flt.o explicitly with the cross compiled bfd library by
modifying the LDFLAGS as below

LDFLAGS = -L$(TOOLDIR)/lib $(TOOLDIR)/lib/libbfd.a
$(TOOLDIR)/lib/libiberty.a 

Now ldelf2flt recognizes the relocations and creates reloc table at the end
of FLT image file. And also my uclinux kernel 2.4.x was able to load the
program and relocate the symbols.
But now I am facing a new problem with init program present under
cvs\userland. Inside the init program I am not able to open "ttyS0" device.
I think I have to post this as a separate problem to the list.

Thanks everyone for the help.

regards,
durgesh


-----Original Message-----
From: Tom Walsh [mailto:tom at cyberiansoftware.com]
Sent: Thursday, November 01, 2001 3:18 PM
To: uclinux-dev at geekcreek.net
Subject: Re: [uClinux-dev] arm-uclinux-gcc problem with relocation
symbols


Durgesh Pattamatta wrote:
> 
> I checked my vmlinux.lds file and it looks fine with the memory map on my
> board. But what puzzles me is how vmlinux.lds linker script is related to
> the userland binaries ? I just compiled a small hello world program with
> "-mdisable-got -Wl,-r" options and did a objdump of relocation symbols
> (objdump --reloc hello.elf). The dump shows the proper relocation types.
But
> when ldelf2flt.c reads the same file it reads wrong relocation type for
the
> symbols ie., it reads relocation type 0 for all the symbols. I think with
> "-Wl,-r" option gcc uses
> /opt/arm/arm-little-uclinux/lib/ldscripts/armelf_uclinux.xr linker script.
> Do you think there is a problem with my libgcc.a which is used by
ldelf2flt
> to parse the elf image file ???
> 

No, I think that it may have something to do with the -mdisable-got
option.  I am not sure what that option does, but, if you look through
the mail archives for the past month (or so), there had been some
information about when to use it, and when to not use it.  See:
http://www.uclinux.org/pub/uClinux/archive/index.html


TomW


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------
This message resent by the uclinux-dev at uclinux.org list server
http://www.uClinux.org/
This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/
This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/



More information about the uClinux-dev mailing list