[Linux-Xtensa] Support for memory map in linker script

linux-xtensa at linux-xtensa.org linux-xtensa at linux-xtensa.org
Mon Jan 5 19:37:01 PST 2009

Hi Marc,


    Thanks for the reply. I'll try to clarify so that you can give a
better input.


    I'm not trying to build u-boot. U-boot for xtensa Lx2.1.1 core is up
and running. I'm trying to develop some test cases/diagnostic code which
I can use for system bring up. This code will be run before u-boot is
run and will be downloaded and debugged via xt-ocd/xt-gdb. I'm using the
u-boot code as reference for understanding the Makefile part of linker
script/memory map part but haven't succeeded so far in correctly using
u-boot.lds which gets generated from u-boot.lds.S. When I take the
objdump without linker script the code is coorect except for the memory
map but when its is generated with linker script support, its not
happening as inteneded.


  I'm also trying to build a project for another xtensa core with no


  Looking for some suggestion.


Thanks and regards




From: linux-xtensa-bounces at linux-xtensa.org
[mailto:linux-xtensa-bounces at linux-xtensa.org] On Behalf Of
linux-xtensa at linux-xtensa.org
Sent: Tuesday, January 06, 2009 12:19 AM
To: linux-xtensa at linux-xtensa.org
Subject: RE: [Linux-Xtensa] Support for memory map in linker script


Hi Sanu,


It might help to know more what you're trying to build.  Is it U-Boot?
Some other bootloader or application running directly on the processor?
I assume it's neither a Linux application or a Linux kernel.  Also, does
your core have an MMU?


If it's U-Boot, get the latest U-Boot sources for Xtensa cores on
git.linux-xtensa.org .  They have linker scripts that deal with most or
all Xtensa processors.  The bulk of testing has been done on cores with
an MMU, but the sources may work on other cores as well (which have a
different memory map).


If it's not U-Boot, it's probably useful to have a look at the U-Boot
sources (in particular, linker scripts in those sources) anyway.  That's
the only solid case I know of so far of using open source tools to
target an arbitrary Xtensa core running something other than Linux.


Hope that helps,






Sanu wrote:

	   I'm trying to build a project with the tools build for linux.
So far I was building my test code in TenSilica IDE, using xt-x* tools (
xt-xcc etc). Now I would like to migrate all my projects to use
xtensa-linux-* tools (eg. xtensa-variant_linux-* etc )
	  My compiler/assembler etc are set as follows
	LDSCRIPT= u-boot.lds
	  I'm able to generate sample.lds from sample.lds.S
	$(obj)sample.lds: sample.lds.S
	        $(CC) -P -C -E $(CFLAGS) -U$(ARCH) $< > $@
	  I'm making some mistake in the following rules because I'm not
getting the right output file. If I don't use the $(LD) part, the o/p
file is correct but offcourse, not matching my memory map.
	$(LIB): $(OBJS)
	        $(AR) $(ARFLAGS) $@ $(OBJS)
	        $(LD) $(LDFLAGS) -o $@ $(LIB)
	   I know many are working with xtensa-variant-linux-* tools.
How do you guys link with the correct memory map ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux-xtensa.org/pipermail/linux-xtensa/attachments/20090105/dcf930b2/attachment.html

More information about the linux-xtensa mailing list