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

linux-xtensa at linux-xtensa.org linux-xtensa at linux-xtensa.org
Mon Jan 5 10:48:33 PST 2009


Support for memory map in linker scriptHi 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,

-Marc



Sanu wrote:
  Hi,

     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

  CROSS_COMPILE=xtensa_mycpu-linux

  CC =${CROSS_COMPILE}-gcc
  CPP=${CROSS_COMPILE}-g++
  AR =${CROSS_COMPILE}-ar
  AS =${CROSS_COMPILE}-as
  LD =${CROSS_COMPILE}-ld

  PLATFORM_LDFLAGS =
  LDSCRIPT= u-boot.lds
  LDFLAGS = -Bstatic -T $(LDSCRIPT) $(PLATFORM_LDFLAGS)


    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)

  test:$(LIB)
          $(LD) $(LDFLAGS) -o $@ $(LIB)


     I know many are working with xtensa-variant-linux-* tools. How do you
guys link with the correct memory map ?

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


More information about the linux-xtensa mailing list