diff -Nru /opt/ibm/cell-sdk/prototype/src/samples/overlay/overview/Makefile ./overview/Makefile --- /opt/ibm/cell-sdk/prototype/src/samples/overlay/overview/Makefile 2006-11-28 03:14:53.000000000 +0900 +++ ./overview/Makefile 2006-12-20 23:27:37.600542680 +0900 @@ -6,6 +6,8 @@ # --------------------------------------------------------------- # PROLOG END TAG zYx +CELL_TOP = /opt/ibm/cell-sdk/prototype + ######################################################################## # Subdirectories ######################################################################## @@ -17,7 +19,8 @@ # Target ######################################################################## -PROGRAM_ppu = $(SDKBIN)/samples/overlay_overview +#PROGRAM_ppu = $(SDKBIN)/samples/overlay_overview +PROGRAM_ppu = overlay_overview ######################################################################## # Local Declarations diff -Nru /opt/ibm/cell-sdk/prototype/src/samples/overlay/overview/spu/Makefile ./overview/spu/Makefile --- /opt/ibm/cell-sdk/prototype/src/samples/overlay/overview/spu/Makefile 2006-11-28 03:14:53.000000000 +0900 +++ ./overview/spu/Makefile 2006-12-22 22:19:13.704465928 +0900 @@ -6,6 +6,8 @@ # --------------------------------------------------------------- # PROLOG END TAG zYx +CELL_TOP = /opt/ibm/cell-sdk/prototype + ######################################################################## # Target ######################################################################## diff -Nru /opt/ibm/cell-sdk/prototype/src/samples/overlay/overview/spu/linker.script ./overview/spu/linker.script --- /opt/ibm/cell-sdk/prototype/src/samples/overlay/overview/spu/linker.script 2006-11-28 03:14:53.000000000 +0900 +++ ./overview/spu/linker.script 2006-12-22 21:48:02.008007040 +0900 @@ -51,7 +51,7 @@ .plt : { *(.plt) } .text : { - *( EXCLUDE_FILE(sc.o sg.o sd.o sf.o sh.o si.o) .text .stub .text.* .gnu.linkonce.t.*) + *( EXCLUDE_FILE(sc.o sg.o sd.o se.o sf.o sh.o si.o sj.o) .text .stub .text.* .gnu.linkonce.t.*) KEEP (*(.text.*personality*)) *(.spu.elf) /* .gnu.warning sections are handled specially by elf32.em. */ @@ -66,6 +66,7 @@ { .segment2 {sd.o(.text) se.o(.text)} .segment3 {sf.o(.text)} + .segment7 {sj.o(.text) sj.o(.rodata) sj.o(.data)} } OVERLAY : { @@ -79,7 +80,11 @@ PROVIDE (__etext = .); PROVIDE (_etext = .); PROVIDE (etext = .); - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } + .rodata : + { + *( EXCLUDE_FILE(sj.o) .rodata) + *(.rodata .rodata.* .gnu.linkonce.r.*) + } .rodata1 : { *(.rodata1) } .eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } @@ -140,6 +145,7 @@ .got : { *(.got.plt) *(.got) } .data : { + *( EXCLUDE_FILE(sj.o) .data) *(.data .data.* .gnu.linkonce.d.*) KEEP (*(.gnu.linkonce.d.*personality*)) SORT(CONSTRUCTORS) diff -Nru /opt/ibm/cell-sdk/prototype/src/samples/overlay/overview/spu/sh.c ./overview/spu/sh.c --- /opt/ibm/cell-sdk/prototype/src/samples/overlay/overview/spu/sh.c 2006-11-28 03:14:53.000000000 +0900 +++ ./overview/spu/sh.c 2006-12-22 11:49:43.155462160 +0900 @@ -9,7 +9,12 @@ int sh(int p) { + int rc; + printf("sh prints %d\n", p); + rc = sj(300600106); // r=3, s=6, f='j' + TEST('j',rc); + return 'h'; } diff -Nru /opt/ibm/cell-sdk/prototype/src/samples/overlay/overview/spu/sj.c ./overview/spu/sj.c --- /opt/ibm/cell-sdk/prototype/src/samples/overlay/overview/spu/sj.c 1970-01-01 09:00:00.000000000 +0900 +++ ./overview/spu/sj.c 2006-12-22 22:07:45.678061840 +0900 @@ -0,0 +1,29 @@ +/* --------------------------------------------------------------- */ +/* (C) Copyright 2001,2006, */ +/* International Business Machines Corporation, */ +/* */ +/* All Rights Reserved. */ +/* --------------------------------------------------------------- */ +/* PROLOG END TAG zYx */ +#include "spu_main.h" + +static char msg1[32] = "Hello World!"; /* .data */ +static const char *msg2 = "modified!"; /* .rodata */ + +int sj(int p) +{ + int i; + +// for (i = 0 ; i < 10 ; i++) +// msg1[i] = msg2[i]; + + printf("sj prints %d\n", p); + + printf("sj overlay message: %s\n", msg1); + + /* BUG */ + for (i = 0 ; i < 10 ; i++) + msg1[i] = msg2[i]; + + return 'j'; +} diff -Nru /opt/ibm/cell-sdk/prototype/src/samples/overlay/overview/spu/spu_main.h ./overview/spu/spu_main.h --- /opt/ibm/cell-sdk/prototype/src/samples/overlay/overview/spu/spu_main.h 2006-11-28 03:14:53.000000000 +0900 +++ ./overview/spu/spu_main.h 2006-12-22 22:19:34.234344912 +0900 @@ -19,6 +19,7 @@ extern int sg(int); extern int sh(int); extern int si(int); +extern int sj(int); #define TEST(x, y) \ if ((x) != (y)) { \