[Cbe-oss-dev] MARS and SPU-GCC 4.6

Ulrich Weigand Ulrich.Weigand at de.ibm.com
Fri Jan 28 04:19:35 EST 2011


Paul Keir <pkeir at dcs.gla.ac.uk> wrote on 01/27/2011 05:55:50 PM:

> It looks like the new compiler adds a new, first program
> header segment: .interrupt. I've put the full spu-readelf
> output at the end.

Hmm, there was a change regarding .interrupt, but that
happened in newlib, not gcc.  Did you by any chance update
your newlib to a more recent version as well, such that
compiles with the new compiler use the new newlib?

It used to be that you'd only ever get an .interrupt section
if you create that in your sources (or link against a library
that does, e.g. the SPU timer library).  However, with the new
newlib, you will *always* get an .interrupt section, provided
by newlib's crtn.o startup file.

This has the practical effect that .init used to be the
first section in most executable, while now .interrupt
will always be the first section.

> spu-gcc -Wall -O3 -funroll-loops -o mpu_task.task mpu_task.task_o -
> lmars_task -Wl,--section-start,.init=0x4000 -lmars_base -Wl,-gc-sections

When .init was the first section, this in effect set the start of
the text LOAD segment to 0x4000.  Now that .interrupt is the first
section, this line has the effect of leaving .interrupt at 0,
then creating a new LOAD segment starting at 0x4000 which contains
the .init section and subsequent sections.

> I'm still not sure how to get round this, but it seems that this
> spu-gcc command is only useful in that it invokes the linker. I'm
> unsure of the spu-ld syntax (e.g. Should it be a comma that
> follows --section-start?), but I'm working to replace that
> call to spu-gcc with one to spu-ld. Or am I barking up the
> wrong tree...?

For your purposes, it should probably just work if you simply
use .interrupt instead of .init in the command line above ...


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand | Phone: +49-7031/16-3727
  STSM, GNU compiler and toolchain for Linux on System z and Cell/B.E.
  IBM Deutschland Research & Development GmbH
  Vorsitzender des Aufsichtsrats: Martin Jetter | Geschäftsführung: Dirk
Wittkopp
  Sitz der Gesellschaft: Böblingen | Registergericht: Amtsgericht
Stuttgart, HRB 243294



More information about the cbe-oss-dev mailing list