1

When I compile a SPU program, I get the following compilation error:

(.text+0x28): relocation truncated to fit: SPU_ADDR18 against symbol `_end' defined in *ABS* section in spu

What does it mean?

The error comes only after I have included at the very beginning:

#define CACHE_NAME MY_CACHE

#define CACHED_TYPE double

#define CACHELINE_LOG2SIZE 11

#define CACHE_LOG2NWAY 2

#define CACHE_LOG2NSETS 4

#include <cache-api.h>
Mateen Ulhaq
  • 24,552
  • 19
  • 101
  • 135
Madrugada
  • 1,261
  • 8
  • 24
  • 44

2 Answers2

1

The error means:

  • an object references the symbol '_end' using the relocation mode SPU_ADDR18

  • the actual adress of the symbol '_end' is too big for the mode of reference used.

_end is a symbol traditionally defined at the end of code and data segment. So most probably, you have more code and static data than the SPU support. (SPU support 256Kb that is 18 bits of address, so I guess that the relocation kind SPU_ADDR18 is the most flexible one).

AProgrammer
  • 51,233
  • 8
  • 91
  • 143
  • Adding to this: You've asked for a 16 sets times 4-way times 2048-byte lines, which is 128Kb of cache -- a significant fraction of your local store. – Brooks Moses Dec 18 '11 at 22:11
0

The error means that the elf executable that you're building doesn't fit into SPU memory; probably because the cache-api.h header defines some static/global variables. Notice that your executable can't use more than 251Kb of memory (part of which will likely be part of the job kernel, code and data).

Jasper Bekkers
  • 6,711
  • 32
  • 46