Topic
  • 45 replies
  • Latest Post - ‏2009-03-25T03:46:17Z by SystemAdmin
SystemAdmin
SystemAdmin
10114 Posts

Pinned topic Discussion about the IBM Full-System Simulator for the CBE

‏2005-11-09T04:32:07Z |
On Wednesday, November 9th, we will be releasing a full-system simulator for the CBE.

[b]Please use this forum thread for discussing questions related to the simulator.[/b]

The system simulator is capable of running the latest Linux kernel with CBEA architecture extensions and runtime support. This simulated environment allows Cell programmers to develop and run Cell applications even without the access to a CBE hardware system.

Please see the alphaWorks Research Topic on CBE at http://www.ibm.com/alphaworks/topics/cell and developerWorks CBE resources at http://www.ibm.com/developerworks/power/cell
Updated on 2009-03-25T03:46:17Z at 2009-03-25T03:46:17Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    10114 Posts

    initrd and zImage handling

    ‏2005-11-14T10:41:18Z  
    I've been trying to get the Fedora rawhide kernel working on the sim, so I can do full system installs 'properly' and make sure the installer is working.

    However, the use of initrd seems to be problematic. I don't see a way to ask the sim to load an initrd -- it seems only to load the kernel. I tried a zImage containing both kernel and initrd, but that didn't work out of the box either.

    However, when I linked the zImage so that its load address and entry point were both 0x1000000 instead of the normal 0x400000, it did work.

    Please could we have initrd support in the sim? Failing that, could we please at least honour the load address and entry point of the loaded 'kernel'?

    On a vaguely related note, is the networking support expected to work in this version? If we compile mambonet into the cell kernel, is there documentation available on setting it up on the host side?
  • pbohrer@us.ibm.com
    pbohrer@us.ibm.com
    20 Posts

    Re: initrd and zImage handling

    ‏2005-11-14T14:38:50Z  
    I've been trying to get the Fedora rawhide kernel working on the sim, so I can do full system installs 'properly' and make sure the installer is working.

    However, the use of initrd seems to be problematic. I don't see a way to ask the sim to load an initrd -- it seems only to load the kernel. I tried a zImage containing both kernel and initrd, but that didn't work out of the box either.

    However, when I linked the zImage so that its load address and entry point were both 0x1000000 instead of the normal 0x400000, it did work.

    Please could we have initrd support in the sim? Failing that, could we please at least honour the load address and entry point of the loaded 'kernel'?

    On a vaguely related note, is the networking support expected to work in this version? If we compile mambonet into the cell kernel, is there documentation available on setting it up on the host side?
    Typically we use the zImage approach also for loading the initrd with the kernel. I am not aware of a problem with the loader not recognizing the entry location in the zImage executable. If you turn on "simdebug set elf_loader 1" before you load zImage, you should be able to see additional debug messages. I will try to use a zImage today to see if I can encounter any problems.
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: initrd and zImage handling

    ‏2005-11-14T14:41:14Z  
    Typically we use the zImage approach also for loading the initrd with the kernel. I am not aware of a problem with the loader not recognizing the entry location in the zImage executable. If you turn on "simdebug set elf_loader 1" before you load zImage, you should be able to see additional debug messages. I will try to use a zImage today to see if I can encounter any problems.
    I'll try that when I get home. My experience was that the zImage was loaded to 0x1000000 and executed there, even when those weren't the load and entrypoint addresses. Just changing the zImage to match was sufficient to make it work for me.
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: initrd and zImage handling

    ‏2005-11-14T21:52:25Z  
    Typically we use the zImage approach also for loading the initrd with the kernel. I am not aware of a problem with the loader not recognizing the entry location in the zImage executable. If you turn on "simdebug set elf_loader 1" before you load zImage, you should be able to see additional debug messages. I will try to use a zImage today to see if I can encounter any problems.
    The command 'simdebug set elf_loader 1' doesn't seem to make much difference. Having invoked the sim with '../run_gui' in the run/cell/linux/ directory, I then typed that at the 'systemsim %' prompt, and it replied 'ELF_LOADER = 1'.

    Then I clicked 'run' in the tk gui, and the same thing happens as before...

    systemsim % WARNING: 7: 0:0: Invalid/unsupported instr 0x00000000 PC(EA): 0x0000000000000000 PC(RA):0x0000000000000000 MSR: 0x1000000000000000 LR: 0x0000000000000000
    numInstructions = 7
    FATAL ERROR: 7: Stopping execution.
    7: ** Execution stopped: Mambo Error, **
    7: ** finished running 7 instructions **

    My kernel image is http://david.woodhou.se/zImage.2

    Single-stepping into it seems to show that it was loaded to the wrong address, and executed at that same address. The load and entrypoint addresses in the ELF file are ignored.
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: initrd and zImage handling

    ‏2005-11-14T21:58:38Z  
    The command 'simdebug set elf_loader 1' doesn't seem to make much difference. Having invoked the sim with '../run_gui' in the run/cell/linux/ directory, I then typed that at the 'systemsim %' prompt, and it replied 'ELF_LOADER = 1'.

    Then I clicked 'run' in the tk gui, and the same thing happens as before...

    systemsim % WARNING: 7: 0:0: Invalid/unsupported instr 0x00000000 PC(EA): 0x0000000000000000 PC(RA):0x0000000000000000 MSR: 0x1000000000000000 LR: 0x0000000000000000
    numInstructions = 7
    FATAL ERROR: 7: Stopping execution.
    7: ** Execution stopped: Mambo Error, **
    7: ** finished running 7 instructions **

    My kernel image is http://david.woodhou.se/zImage.2

    Single-stepping into it seems to show that it was loaded to the wrong address, and executed at that same address. The load and entrypoint addresses in the ELF file are ignored.
    Aha. It had loaded the kernel already before I set the debugging option. If I use the GUI to make it reload the kernel, it does seem to work correctly...

    $ ../run_gui
    ==============================================================================
    THIS CELL BROADBAND ENGINE SYSTEM SIMULATOR, TOGETHER WITH ALL PERFORMANCE
    DATA RESULTING THEREFROM, IS PROVIDED BY IBM AND RECEIVED BY YOU ON AN "AS-IS"
    BASIS, WITHOUT WARRANTY OF ANY KIND. SEE THE APPLICABLE LICENSE FOR ADDITIONAL
    TERMS AND CONDITIONS.
    ==============================================================================
    GUI Enabled
    Licensed Materials - Property of IBM.
    (C) Copyright IBM Corporation 2001, 2005
    All Rights Reserved.
    GUI not initialized. Execute tcl command 'gui_init'.
    WARNING: 0: Closing gdb listener on port 2345, reopening on port 2345
    LOAD : Opening ELF image file: ../../../images/cell/vmlinux
    Elf text start address saved is 0x0000000001000000
    LOAD : ELF startup: PC=0x0000000001000000, msr=0x1000000000000000
    LOAD : gpr[1]=0x0000000007FFFF90, gpr[2]=0x0000000000000000
    building tree....
    clearing existing Openfirmware tree
    done building tree.
    systemsim % simdebug set elf_loader 1
    ELF_LOADER = 1
    systemsim % LOAD : Opening ELF image file: /home/dwmw2/systemsim-cell-release/images/cell/vmlinux
    DEBUG: 0: ELF_LOADER : Loading a 32-bit Elf File
    DEBUG: 0: ELF_LOADER : Class:01 Data:02 Version:01
    DEBUG: 0: ELF_LOADER : Type :02 Machine:20 Version:01
    DEBUG: 0: ELF_LOADER : Entry:0x00401BCC Flags:32768 Elf-Header Size:52 bytes
    DEBUG: 0: ELF_LOADER : Section that contains the String Table : 6
    DEBUG: 0: ELF_LOADER : Program Headers : (Offset:52,Entry-Size:32,Entries:4)
    DEBUG: 0: ELF_LOADER : Section Headers: (Offset:2269260,Entry-Size:40,Entries:9)DEBUG: 0: ELF_LOADER : Section 0 : (Type:00 NULL)
    Flags 0x00 :
    DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 0
    DEBUG: 0: ELF_LOADER : Size 00 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 00 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Section 1 : .text (Type:01 PROGBITS)
    Flags 0x06 : MEM-DURING-EXEC EXECUTABLE
    DEBUG: 0: ELF_LOADER : Address 0x00400000 : File Offset 65536
    DEBUG: 0: ELF_LOADER : Size 21280 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 16 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Copy 21280 bytes from file offset 65536 to memory 0x0000000000400000
    Elf text start address saved is 0x0000000000400000
    DEBUG: 0: ELF_LOADER : look for starting address at offset 0x0000000000001BCC in file
    DEBUG: 0: ELF_LOADER : starting address = 0x0000000048000005
    DEBUG: 0: ELF_LOADER : Section 2 : .data (Type:01 PROGBITS)
    Flags 0x03 : WRITABLE MEM-DURING-EXEC
    DEBUG: 0: ELF_LOADER : Address 0x00406000 : File Offset 90112
    DEBUG: 0: ELF_LOADER : Size 2840 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 04 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Copy 2840 bytes from file offset 90112 to memory 0x0000000000406000
    DEBUG: 0: ELF_LOADER : Section 3 : .kernel:vmlinux.strip (Type:01 PROGBITS)
    Flags 0x02 : MEM-DURING-EXEC
    DEBUG: 0: ELF_LOADER : Address 0x00407000 : File Offset 94208
    DEBUG: 0: ELF_LOADER : Size 2174570 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 01 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Copy 2174570 bytes from file offset 94208 to memory 0x0000000000407000
    DEBUG: 0: ELF_LOADER : Section 4 : .bss (Type:08 UNKNOWN TYPE)
    Flags 0x03 : WRITABLE MEM-DURING-EXEC
    DEBUG: 0: ELF_LOADER : Address 0x0061A000 : File Offset 2268778
    DEBUG: 0: ELF_LOADER : Size 48252 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 04 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Section 5 : .comment (Type:01 PROGBITS)
    Flags 0x00 :
    DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 2268778
    DEBUG: 0: ELF_LOADER : Size 405 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 01 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Section 6 : .shstrtab (Type:03 STRTAB)
    Flags 0x00 :
    DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 2269183
    DEBUG: 0: ELF_LOADER : Size 75 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 01 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Section 7 : .symtab (Type:02 SYMTAB)
    Flags 0x00 :
    DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 2269620
    DEBUG: 0: ELF_LOADER : Size 1536 : Link 08 : Info 31
    DEBUG: 0: ELF_LOADER : Addr Align 04 : Ent Size 16
    DEBUG: 0: ELF_LOADER : Section 8 : .strtab (Type:03 STRTAB)
    Flags 0x00 :
    DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 2271156
    DEBUG: 0: ELF_LOADER : Size 1050 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 01 : Ent Size 00
    LOAD : ELF startup: PC=0x0000000000401BCC, msr=0x1000000000000000
    LOAD : gpr[1]=0x0000000007FFFF90, gpr[2]=0x0000000000000000
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: initrd and zImage handling

    ‏2005-11-14T22:16:40Z  
    Aha. It had loaded the kernel already before I set the debugging option. If I use the GUI to make it reload the kernel, it does seem to work correctly...

    $ ../run_gui
    ==============================================================================
    THIS CELL BROADBAND ENGINE SYSTEM SIMULATOR, TOGETHER WITH ALL PERFORMANCE
    DATA RESULTING THEREFROM, IS PROVIDED BY IBM AND RECEIVED BY YOU ON AN "AS-IS"
    BASIS, WITHOUT WARRANTY OF ANY KIND. SEE THE APPLICABLE LICENSE FOR ADDITIONAL
    TERMS AND CONDITIONS.
    ==============================================================================
    GUI Enabled
    Licensed Materials - Property of IBM.
    (C) Copyright IBM Corporation 2001, 2005
    All Rights Reserved.
    GUI not initialized. Execute tcl command 'gui_init'.
    WARNING: 0: Closing gdb listener on port 2345, reopening on port 2345
    LOAD : Opening ELF image file: ../../../images/cell/vmlinux
    Elf text start address saved is 0x0000000001000000
    LOAD : ELF startup: PC=0x0000000001000000, msr=0x1000000000000000
    LOAD : gpr[1]=0x0000000007FFFF90, gpr[2]=0x0000000000000000
    building tree....
    clearing existing Openfirmware tree
    done building tree.
    systemsim % simdebug set elf_loader 1
    ELF_LOADER = 1
    systemsim % LOAD : Opening ELF image file: /home/dwmw2/systemsim-cell-release/images/cell/vmlinux
    DEBUG: 0: ELF_LOADER : Loading a 32-bit Elf File
    DEBUG: 0: ELF_LOADER : Class:01 Data:02 Version:01
    DEBUG: 0: ELF_LOADER : Type :02 Machine:20 Version:01
    DEBUG: 0: ELF_LOADER : Entry:0x00401BCC Flags:32768 Elf-Header Size:52 bytes
    DEBUG: 0: ELF_LOADER : Section that contains the String Table : 6
    DEBUG: 0: ELF_LOADER : Program Headers : (Offset:52,Entry-Size:32,Entries:4)
    DEBUG: 0: ELF_LOADER : Section Headers: (Offset:2269260,Entry-Size:40,Entries:9)DEBUG: 0: ELF_LOADER : Section 0 : (Type:00 NULL)
    Flags 0x00 :
    DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 0
    DEBUG: 0: ELF_LOADER : Size 00 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 00 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Section 1 : .text (Type:01 PROGBITS)
    Flags 0x06 : MEM-DURING-EXEC EXECUTABLE
    DEBUG: 0: ELF_LOADER : Address 0x00400000 : File Offset 65536
    DEBUG: 0: ELF_LOADER : Size 21280 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 16 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Copy 21280 bytes from file offset 65536 to memory 0x0000000000400000
    Elf text start address saved is 0x0000000000400000
    DEBUG: 0: ELF_LOADER : look for starting address at offset 0x0000000000001BCC in file
    DEBUG: 0: ELF_LOADER : starting address = 0x0000000048000005
    DEBUG: 0: ELF_LOADER : Section 2 : .data (Type:01 PROGBITS)
    Flags 0x03 : WRITABLE MEM-DURING-EXEC
    DEBUG: 0: ELF_LOADER : Address 0x00406000 : File Offset 90112
    DEBUG: 0: ELF_LOADER : Size 2840 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 04 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Copy 2840 bytes from file offset 90112 to memory 0x0000000000406000
    DEBUG: 0: ELF_LOADER : Section 3 : .kernel:vmlinux.strip (Type:01 PROGBITS)
    Flags 0x02 : MEM-DURING-EXEC
    DEBUG: 0: ELF_LOADER : Address 0x00407000 : File Offset 94208
    DEBUG: 0: ELF_LOADER : Size 2174570 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 01 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Copy 2174570 bytes from file offset 94208 to memory 0x0000000000407000
    DEBUG: 0: ELF_LOADER : Section 4 : .bss (Type:08 UNKNOWN TYPE)
    Flags 0x03 : WRITABLE MEM-DURING-EXEC
    DEBUG: 0: ELF_LOADER : Address 0x0061A000 : File Offset 2268778
    DEBUG: 0: ELF_LOADER : Size 48252 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 04 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Section 5 : .comment (Type:01 PROGBITS)
    Flags 0x00 :
    DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 2268778
    DEBUG: 0: ELF_LOADER : Size 405 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 01 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Section 6 : .shstrtab (Type:03 STRTAB)
    Flags 0x00 :
    DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 2269183
    DEBUG: 0: ELF_LOADER : Size 75 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 01 : Ent Size 00
    DEBUG: 0: ELF_LOADER : Section 7 : .symtab (Type:02 SYMTAB)
    Flags 0x00 :
    DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 2269620
    DEBUG: 0: ELF_LOADER : Size 1536 : Link 08 : Info 31
    DEBUG: 0: ELF_LOADER : Addr Align 04 : Ent Size 16
    DEBUG: 0: ELF_LOADER : Section 8 : .strtab (Type:03 STRTAB)
    Flags 0x00 :
    DEBUG: 0: ELF_LOADER : Address 0x00000000 : File Offset 2271156
    DEBUG: 0: ELF_LOADER : Size 1050 : Link 00 : Info 0
    DEBUG: 0: ELF_LOADER : Addr Align 01 : Ent Size 00
    LOAD : ELF startup: PC=0x0000000000401BCC, msr=0x1000000000000000
    LOAD : gpr[1]=0x0000000007FFFF90, gpr[2]=0x0000000000000000

    ELF Header:
    Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
    Class: ELF32
    Data: 2's complement, big endian
    Version: 1 (current)
    OS/ABI: UNIX - System V
    ABI Version: 0
    Type: EXEC (Executable file)
    Machine: PowerPC
    Version: 0x1
    Entry point address: 0x401bcc
    Start of program headers: 52 (bytes into file)
    Start of section headers: 2269260 (bytes into file)
    Flags: 0x8000, relocatable-lib
    Size of this header: 52 (bytes)
    Size of program headers: 32 (bytes)
    Number of program headers: 4
    Size of section headers: 40 (bytes)
    Number of section headers: 9
    Section header string table index: 6
    The problem is that you have a 32-bit image and the simulator wants a 64-bit image.
  • pbohrer@us.ibm.com
    pbohrer@us.ibm.com
    20 Posts

    Re: initrd and zImage handling

    ‏2005-11-14T22:23:24Z  

    ELF Header:
    Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
    Class: ELF32
    Data: 2's complement, big endian
    Version: 1 (current)
    OS/ABI: UNIX - System V
    ABI Version: 0
    Type: EXEC (Executable file)
    Machine: PowerPC
    Version: 0x1
    Entry point address: 0x401bcc
    Start of program headers: 52 (bytes into file)
    Start of section headers: 2269260 (bytes into file)
    Flags: 0x8000, relocatable-lib
    Size of this header: 52 (bytes)
    Size of program headers: 32 (bytes)
    Number of program headers: 4
    Size of section headers: 40 (bytes)
    Number of section headers: 9
    Section header string table index: 6
    The problem is that you have a 32-bit image and the simulator wants a 64-bit image.
    The loader should handle either 32 or 64 bit.
    Thanks for pointing to the zImage in an earlier post.
    I will take a look at it this evening.
    Sorry I have been swamped today.
  • pbohrer@us.ibm.com
    pbohrer@us.ibm.com
    20 Posts

    Re: initrd and zImage handling

    ‏2005-11-15T22:38:33Z  
    The command 'simdebug set elf_loader 1' doesn't seem to make much difference. Having invoked the sim with '../run_gui' in the run/cell/linux/ directory, I then typed that at the 'systemsim %' prompt, and it replied 'ELF_LOADER = 1'.

    Then I clicked 'run' in the tk gui, and the same thing happens as before...

    systemsim % WARNING: 7: 0:0: Invalid/unsupported instr 0x00000000 PC(EA): 0x0000000000000000 PC(RA):0x0000000000000000 MSR: 0x1000000000000000 LR: 0x0000000000000000
    numInstructions = 7
    FATAL ERROR: 7: Stopping execution.
    7: ** Execution stopped: Mambo Error, **
    7: ** finished running 7 instructions **

    My kernel image is http://david.woodhou.se/zImage.2

    Single-stepping into it seems to show that it was loaded to the wrong address, and executed at that same address. The load and entrypoint addresses in the ELF file are ignored.
    Thanks for pointing me to the zImage. That was a big help.

    By default, the simulator will run whatever commands it finds in the local startup file called .systemsim.tcl unless it is told otherwise with the -f option.

    In run/cell/linux, I copied .systemsim.tcl to zimage.tcl and changed the vmlinux load command :
    mysim load vmlinux $imagefile 0x1000000
    to be:
    mysim load elf zImage.2

    and then ran ../run_gui -f zimage.tcl

    When I did this, your image booted up just fine.
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: initrd and zImage handling

    ‏2005-11-15T22:50:34Z  
    Thanks for pointing me to the zImage. That was a big help.

    By default, the simulator will run whatever commands it finds in the local startup file called .systemsim.tcl unless it is told otherwise with the -f option.

    In run/cell/linux, I copied .systemsim.tcl to zimage.tcl and changed the vmlinux load command :
    mysim load vmlinux $imagefile 0x1000000
    to be:
    mysim load elf zImage.2

    and then ran ../run_gui -f zimage.tcl

    When I did this, your image booted up just fine.
    Excellent; thanks. Is there an advantage to loading a kernel as 'vmlinux' instead of 'elf'? Should the default .systemsim.tcl be changed?

    Now, I'm trying to load yaboot the same way. It seems to load and run fine, but I can't interact with it. I have the xterm window in which I see this...

    /pci@fff7f09000/ide@1/hd@1:1,/etc/yaboot.conf: Unable to open file, Invalid device
    Can't open config file
    Welcome to yaboot version 1.3.13 (Red Hat 1.3.13-0.16)
    Enter "help" to get some basic usage information
    Default supplied on the command line: lpj=8000000 console=bogus0 root=/dev/mambobd0 rw init=/bin/bash
    boot:

    ... but I can't do anything. Is that expected?
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-11-27T14:46:16Z  
    I know this is untested, I tried it nevertheless
    I try to run the cell full system simulator on a ia32e gentoo distribution, probably one of the worst possible combinations (no native fedora libs, no rpm, no/very few 32bit x86 libs/tools).
    I built the toolchain from scratch. I had to change some makefiles of the other parts (sdk, kernel, libspe) due to different paths. I built the sysroot_image by hand and run the simulator against the binary fedora libstdc++ (my multilib one didn't work).
    I can know boot linux in the simulator, but not everything seems to work as expected, my observations (everything in fast mode):

    I can run 32 bit binaries compiled in the simulator or on the host. I can neither run nor compile 64 bit binaries on the simulated system (due to a incomplete toolchain on the simulated system).

    run properly (second paragraph is from spu/bin):
    euler_scalar, euler_simd_aos, euler_simd_soa, audio, curve, fft_2d, gmath, image, intrinsics_si, intrinsics_vmx, math1, matrix, misc, noise, predicates_vmx, surface, vector
    hello, spe-cp, spe-sum, spu_interrupt, abi, audio, c, c_malloc, curve, fft_1d, fft_2d, gmath, image, intrinsics_si, intrinsics_spu, large_matrix, math1, math2, matrix, misc, mpm1, mpm2, mpm3, noise, surface, test_spu_ext, vector

    segfault:
    euler_multi_spe, euler_spe

    can't create thread (errno=22):
    atomic_op_sample, dma_sample, driver, mutex_sample, simple, simpleDMA, simple_cesof, cpex

    hang:
    cond_sample

    atomic_op_sample:
    fails the first 2 tests, passes the next 2 ones, fails the last one (cannot create thread errno=22)

    cannot locate SPU executable:
    ppu_add, ppu_sync_add

    So, all in all, for me it looks like if libspe doesn't work.
    Ideas?

    Oh, and I find it really impractical that the size of the virtual terminal changes when I start vi in the simulation.
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Gentoo

    ‏2005-12-02T18:39:15Z  
    I know this is untested, I tried it nevertheless
    I try to run the cell full system simulator on a ia32e gentoo distribution, probably one of the worst possible combinations (no native fedora libs, no rpm, no/very few 32bit x86 libs/tools).
    I built the toolchain from scratch. I had to change some makefiles of the other parts (sdk, kernel, libspe) due to different paths. I built the sysroot_image by hand and run the simulator against the binary fedora libstdc++ (my multilib one didn't work).
    I can know boot linux in the simulator, but not everything seems to work as expected, my observations (everything in fast mode):

    I can run 32 bit binaries compiled in the simulator or on the host. I can neither run nor compile 64 bit binaries on the simulated system (due to a incomplete toolchain on the simulated system).

    run properly (second paragraph is from spu/bin):
    euler_scalar, euler_simd_aos, euler_simd_soa, audio, curve, fft_2d, gmath, image, intrinsics_si, intrinsics_vmx, math1, matrix, misc, noise, predicates_vmx, surface, vector
    hello, spe-cp, spe-sum, spu_interrupt, abi, audio, c, c_malloc, curve, fft_1d, fft_2d, gmath, image, intrinsics_si, intrinsics_spu, large_matrix, math1, math2, matrix, misc, mpm1, mpm2, mpm3, noise, surface, test_spu_ext, vector

    segfault:
    euler_multi_spe, euler_spe

    can't create thread (errno=22):
    atomic_op_sample, dma_sample, driver, mutex_sample, simple, simpleDMA, simple_cesof, cpex

    hang:
    cond_sample

    atomic_op_sample:
    fails the first 2 tests, passes the next 2 ones, fails the last one (cannot create thread errno=22)

    cannot locate SPU executable:
    ppu_add, ppu_sync_add

    So, all in all, for me it looks like if libspe doesn't work.
    Ideas?

    Oh, and I find it really impractical that the size of the virtual terminal changes when I start vi in the simulation.
    I'm also working on setting up the systemsim in gentoo.

    Please have a look and/or post replies to the thread on the gentoo forums:
    http://forums.gentoo.org/viewtopic-t-407765.html
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-08T15:48:08Z  
    I know this is untested, I tried it nevertheless
    I try to run the cell full system simulator on a ia32e gentoo distribution, probably one of the worst possible combinations (no native fedora libs, no rpm, no/very few 32bit x86 libs/tools).
    I built the toolchain from scratch. I had to change some makefiles of the other parts (sdk, kernel, libspe) due to different paths. I built the sysroot_image by hand and run the simulator against the binary fedora libstdc++ (my multilib one didn't work).
    I can know boot linux in the simulator, but not everything seems to work as expected, my observations (everything in fast mode):

    I can run 32 bit binaries compiled in the simulator or on the host. I can neither run nor compile 64 bit binaries on the simulated system (due to a incomplete toolchain on the simulated system).

    run properly (second paragraph is from spu/bin):
    euler_scalar, euler_simd_aos, euler_simd_soa, audio, curve, fft_2d, gmath, image, intrinsics_si, intrinsics_vmx, math1, matrix, misc, noise, predicates_vmx, surface, vector
    hello, spe-cp, spe-sum, spu_interrupt, abi, audio, c, c_malloc, curve, fft_1d, fft_2d, gmath, image, intrinsics_si, intrinsics_spu, large_matrix, math1, math2, matrix, misc, mpm1, mpm2, mpm3, noise, surface, test_spu_ext, vector

    segfault:
    euler_multi_spe, euler_spe

    can't create thread (errno=22):
    atomic_op_sample, dma_sample, driver, mutex_sample, simple, simpleDMA, simple_cesof, cpex

    hang:
    cond_sample

    atomic_op_sample:
    fails the first 2 tests, passes the next 2 ones, fails the last one (cannot create thread errno=22)

    cannot locate SPU executable:
    ppu_add, ppu_sync_add

    So, all in all, for me it looks like if libspe doesn't work.
    Ideas?

    Oh, and I find it really impractical that the size of the virtual terminal changes when I start vi in the simulation.
    hi,

    I didn't have a look at this for a while...
    first I strace'd the call to simple [1]. This didn't seem to be so helpful. Next I built libspe with -DDEBUG, when I now call simple, I get "invalid ELF header" as the initial problem [2]. Is this helpful?

    [1]:

    execve("opt/IBM/cell-sdk-1.0/bin/samples/simple", , [/* 12 vars */]) = 0
    brk(0) = 0x1815000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fe1000
    access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
    open("/etc/ld.so.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/tls/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/lib/tls/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/lib/libspe.so.1", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0A\214"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=67943, ...}) = 0
    mmap(0x17d3000, 117920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x17d3000
    mprotect(0x17df000, 68768, PROT_NONE) = 0
    mmap(0x17ef000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x17ef000
    close(3) = 0
    open("/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libc.so.6", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\273"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=1603088, ...}) = 0
    mmap(0x1667000, 1422900, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1667000
    mprotect(0x17ac000, 91700, PROT_NONE) = 0
    mmap(0x17bb000, 20480, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x144000) = 0x17bb000
    mmap(0x17c0000, 9780, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x17c0000
    close(3) = 0
    open("/lib/tls/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libpthread.so.0", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0K\320"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=113304, ...}) = 0
    mmap(0x1633000, 144808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1633000
    mprotect(0x1644000, 75176, PROT_NONE) = 0
    mmap(0x1653000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x1653000
    mmap(0x1655000, 5544, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1655000
    close(3) = 0
    open("/lib/tls/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/librt.so.1", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\37"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=54704, ...}) = 0
    mmap(0x1633000, 144808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1633000
    mprotect(0x1644000, 75176, PROT_NONE) = 0
    mmap(0x1653000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x1653000
    mmap(0x1655000, 5544, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1655000
    close(3) = 0
    open("/lib/tls/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/librt.so.1", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\37"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=54704, ...}) = 0
    mmap(0x15fe000, 148120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x15fe000
    mprotect(0x1607000, 111256, PROT_NONE) = 0
    mmap(0x1616000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x1616000
    mmap(0x1618000, 41624, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1618000
    close(3) = 0
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fe0000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fdf000
    mprotect(0x1616000, 4096, PROT_READ) = 0
    mprotect(0x1653000, 4096, PROT_READ) = 0
    mprotect(0x17bb000, 8192, PROT_READ) = 0
    mprotect(0xf800e000, 4096, PROT_READ) = 0
    set_tid_address(0xf7fdf068) = 322
    rt_sigaction(SIGRTMIN, {0x16376c0, [], SA_SIGINFO}, NULL, 8) = 0
    rt_sigaction(SIGRT_1, {0x1637790, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
    rt_sigprocmask(SIG_UNBLOCK, RTMIN RT_1, NULL, 8) = 0
    ugetrlimit(0x3, 0xffee3900) = 0
    _sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xffee3994, 35, (nil), 0}) = 0
    brk(0) = 0x1815000
    brk(0x1836000) = 0x1836000
    SYS_279(0xffee36b0, 0, 0x1c0, 0, 0x8000) = 3
    open("/spu/spethread-322-25251872/mem", O_RDWR|O_CREAT, 0600) = 4
    mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0) = 0xf7f9f000
    write(2, "Failed spu_create_thread(rc=0, e"..., 41Failed spu_create_thread(rc=0, errno=22)
    ) = 41
    exit_group(1)

    [2]:
    spe_create_thread((nil), 0x1814a98, (nil), (nil), 0xffffffff, 0x0)
    create /spu/spethread-342-25251872
    load_spe_elf(0x1814a98, 0xf7f9f000)
    load_spe_elf(0x17c9848, 0xf7f9f000)
    invalid ELF header.
    expected 0x7F454C4601020100 != 0xFBAD2887017C988F
    Load SPE ELF failed..
    spe_setup failed
    Failed spu_create_thread(rc=0, errno=22)
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-09T17:56:34Z  
    hi,

    I didn't have a look at this for a while...
    first I strace'd the call to simple [1]. This didn't seem to be so helpful. Next I built libspe with -DDEBUG, when I now call simple, I get "invalid ELF header" as the initial problem [2]. Is this helpful?

    [1]:

    execve("opt/IBM/cell-sdk-1.0/bin/samples/simple", , [/* 12 vars */]) = 0
    brk(0) = 0x1815000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fe1000
    access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
    open("/etc/ld.so.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/tls/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/lib/tls/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/lib/libspe.so.1", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0A\214"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=67943, ...}) = 0
    mmap(0x17d3000, 117920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x17d3000
    mprotect(0x17df000, 68768, PROT_NONE) = 0
    mmap(0x17ef000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x17ef000
    close(3) = 0
    open("/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libc.so.6", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\273"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=1603088, ...}) = 0
    mmap(0x1667000, 1422900, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1667000
    mprotect(0x17ac000, 91700, PROT_NONE) = 0
    mmap(0x17bb000, 20480, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x144000) = 0x17bb000
    mmap(0x17c0000, 9780, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x17c0000
    close(3) = 0
    open("/lib/tls/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libpthread.so.0", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0K\320"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=113304, ...}) = 0
    mmap(0x1633000, 144808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1633000
    mprotect(0x1644000, 75176, PROT_NONE) = 0
    mmap(0x1653000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x1653000
    mmap(0x1655000, 5544, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1655000
    close(3) = 0
    open("/lib/tls/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/librt.so.1", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\37"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=54704, ...}) = 0
    mmap(0x1633000, 144808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1633000
    mprotect(0x1644000, 75176, PROT_NONE) = 0
    mmap(0x1653000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x1653000
    mmap(0x1655000, 5544, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1655000
    close(3) = 0
    open("/lib/tls/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/librt.so.1", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\37"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=54704, ...}) = 0
    mmap(0x15fe000, 148120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x15fe000
    mprotect(0x1607000, 111256, PROT_NONE) = 0
    mmap(0x1616000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x1616000
    mmap(0x1618000, 41624, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1618000
    close(3) = 0
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fe0000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fdf000
    mprotect(0x1616000, 4096, PROT_READ) = 0
    mprotect(0x1653000, 4096, PROT_READ) = 0
    mprotect(0x17bb000, 8192, PROT_READ) = 0
    mprotect(0xf800e000, 4096, PROT_READ) = 0
    set_tid_address(0xf7fdf068) = 322
    rt_sigaction(SIGRTMIN, {0x16376c0, [], SA_SIGINFO}, NULL, 8) = 0
    rt_sigaction(SIGRT_1, {0x1637790, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
    rt_sigprocmask(SIG_UNBLOCK, RTMIN RT_1, NULL, 8) = 0
    ugetrlimit(0x3, 0xffee3900) = 0
    _sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xffee3994, 35, (nil), 0}) = 0
    brk(0) = 0x1815000
    brk(0x1836000) = 0x1836000
    SYS_279(0xffee36b0, 0, 0x1c0, 0, 0x8000) = 3
    open("/spu/spethread-322-25251872/mem", O_RDWR|O_CREAT, 0600) = 4
    mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0) = 0xf7f9f000
    write(2, "Failed spu_create_thread(rc=0, e"..., 41Failed spu_create_thread(rc=0, errno=22)
    ) = 41
    exit_group(1)

    [2]:
    spe_create_thread((nil), 0x1814a98, (nil), (nil), 0xffffffff, 0x0)
    create /spu/spethread-342-25251872
    load_spe_elf(0x1814a98, 0xf7f9f000)
    load_spe_elf(0x17c9848, 0xf7f9f000)
    invalid ELF header.
    expected 0x7F454C4601020100 != 0xFBAD2887017C988F
    Load SPE ELF failed..
    spe_setup failed
    Failed spu_create_thread(rc=0, errno=22)
    hm, now I'm getting really confused. euler_spe and euler_multi_spe seem to have proper embedded spe programs, nevertheless they segfault...

    output of euler_spe:

    spe_create_thread((nil), 0x181491c, 0xffc83970, (nil), 0xffffffff, 0x0)
    create /spu/spethread-306-28852256
    load_spe_elf(0x181491c, 0xf7f9f000)
    load_spe_elf(0x3d6b0181, 0xf7f9f000)
    Segmentation fault

    strace euler_spe:

    execve("opt/IBM/cell-sdk-1.0/bin/samples/euler_spe", , [/* 12 vars */]) = 0
    brk(0) = 0x1b84000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fe1000
    access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
    open("/etc/ld.so.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/tls/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/lib/tls/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/lib/libspe.so.1", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0Ht"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=86484, ...}) = 0
    mmap(0x17df000, 69356, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x17df000
    mmap(0x17ef000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x17ef000
    close(3) = 0
    open("/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libc.so.6", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\273"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=1603088, ...}) = 0
    mmap(0x1673000, 1422900, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1673000
    mprotect(0x17b8000, 91700, PROT_NONE) = 0
    mmap(0x17c7000, 20480, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x144000) = 0x17c7000
    mmap(0x17cc000, 9780, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x17cc000
    close(3) = 0
    open("/lib/tls/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libpthread.so.0", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0K\320"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=113304, ...}) = 0
    mmap(0x163f000, 144808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x163f000
    mprotect(0x1650000, 75176, PROT_NONE) = 0
    mmap(0x165f000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x165f000
    mmap(0x1661000, 5544, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1661000
    close(3) = 0
    open("/lib/tls/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/librt.so.1", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\37"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=54704, ...}) = 0
    mmap(0x160a000, 148120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x160a000
    mprotect(0x1613000, 111256, PROT_NONE) = 0
    mmap(0x1622000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x1622000
    mmap(0x1624000, 41624, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1624000
    close(3) = 0
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fe0000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fdf000
    mprotect(0x1622000, 4096, PROT_READ) = 0
    mprotect(0x165f000, 4096, PROT_READ) = 0
    mprotect(0x17c7000, 8192, PROT_READ) = 0
    mprotect(0xf800e000, 4096, PROT_READ) = 0
    set_tid_address(0xf7fdf068) = 329
    rt_sigaction(SIGRTMIN, {0x16436c0, [], SA_SIGINFO}, NULL, 8) = 0
    rt_sigaction(SIGRT_1, {0x1643790, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
    rt_sigprocmask(SIG_UNBLOCK, RTMIN RT_1, NULL, 8) = 0
    ugetrlimit(0x3, 0xffcb4900) = 0
    _sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xffcb4994, 35, (nil), 0}) = 0
    write(2, "spe_create_thread((nil), 0x18149"..., 72spe_create_thread((nil), 0x181491c, 0xffcb4990, (nil), 0xffffffff, 0x0)
    ) = 72
    brk(0) = 0x1b84000
    brk(0x1ba5000) = 0x1ba5000
    write(2, "create /spu/spethread-329-288522"..., 35create /spu/spethread-329-28852256
    ) = 35
    SYS_279(0xffcb46b0, 0, 0x1c0, 0x18, 0x8000) = 3
    open("/spu/spethread-329-28852256/mem", O_RDWR|O_CREAT, 0600) = 4
    mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0) = 0xf7f9f000
    write(2, "load_spe_elf(0x181491c, 0xf7f9f0"..., 36load_spe_elf(0x181491c, 0xf7f9f000)
    ) = 36
    write(2, "load_spe_elf(0x3d6b0181, 0xf7f9f"..., 37load_spe_elf(0x3d6b0181, 0xf7f9f000)
    ) = 37
    • SIGSEGV (Segmentation fault) @ 0 (0) ---
    + killed by SIGSEGV +
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-10T22:04:36Z  
    hm, now I'm getting really confused. euler_spe and euler_multi_spe seem to have proper embedded spe programs, nevertheless they segfault...

    output of euler_spe:

    spe_create_thread((nil), 0x181491c, 0xffc83970, (nil), 0xffffffff, 0x0)
    create /spu/spethread-306-28852256
    load_spe_elf(0x181491c, 0xf7f9f000)
    load_spe_elf(0x3d6b0181, 0xf7f9f000)
    Segmentation fault

    strace euler_spe:

    execve("opt/IBM/cell-sdk-1.0/bin/samples/euler_spe", , [/* 12 vars */]) = 0
    brk(0) = 0x1b84000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fe1000
    access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
    open("/etc/ld.so.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/tls/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/lib/tls/libspe.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/lib/libspe.so.1", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0Ht"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=86484, ...}) = 0
    mmap(0x17df000, 69356, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x17df000
    mmap(0x17ef000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x17ef000
    close(3) = 0
    open("/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libc.so.6", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\273"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=1603088, ...}) = 0
    mmap(0x1673000, 1422900, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1673000
    mprotect(0x17b8000, 91700, PROT_NONE) = 0
    mmap(0x17c7000, 20480, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x144000) = 0x17c7000
    mmap(0x17cc000, 9780, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x17cc000
    close(3) = 0
    open("/lib/tls/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libpthread.so.0", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0K\320"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=113304, ...}) = 0
    mmap(0x163f000, 144808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x163f000
    mprotect(0x1650000, 75176, PROT_NONE) = 0
    mmap(0x165f000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x165f000
    mmap(0x1661000, 5544, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1661000
    close(3) = 0
    open("/lib/tls/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/librt.so.1", O_RDONLY) = 3
    read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\37"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=54704, ...}) = 0
    mmap(0x160a000, 148120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x160a000
    mprotect(0x1613000, 111256, PROT_NONE) = 0
    mmap(0x1622000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x1622000
    mmap(0x1624000, 41624, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1624000
    close(3) = 0
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fe0000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fdf000
    mprotect(0x1622000, 4096, PROT_READ) = 0
    mprotect(0x165f000, 4096, PROT_READ) = 0
    mprotect(0x17c7000, 8192, PROT_READ) = 0
    mprotect(0xf800e000, 4096, PROT_READ) = 0
    set_tid_address(0xf7fdf068) = 329
    rt_sigaction(SIGRTMIN, {0x16436c0, [], SA_SIGINFO}, NULL, 8) = 0
    rt_sigaction(SIGRT_1, {0x1643790, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
    rt_sigprocmask(SIG_UNBLOCK, RTMIN RT_1, NULL, 8) = 0
    ugetrlimit(0x3, 0xffcb4900) = 0
    _sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xffcb4994, 35, (nil), 0}) = 0
    write(2, "spe_create_thread((nil), 0x18149"..., 72spe_create_thread((nil), 0x181491c, 0xffcb4990, (nil), 0xffffffff, 0x0)
    ) = 72
    brk(0) = 0x1b84000
    brk(0x1ba5000) = 0x1ba5000
    write(2, "create /spu/spethread-329-288522"..., 35create /spu/spethread-329-28852256
    ) = 35
    SYS_279(0xffcb46b0, 0, 0x1c0, 0x18, 0x8000) = 3
    open("/spu/spethread-329-28852256/mem", O_RDWR|O_CREAT, 0600) = 4
    mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0) = 0xf7f9f000
    write(2, "load_spe_elf(0x181491c, 0xf7f9f0"..., 36load_spe_elf(0x181491c, 0xf7f9f000)
    ) = 36
    write(2, "load_spe_elf(0x3d6b0181, 0xf7f9f"..., 37load_spe_elf(0x3d6b0181, 0xf7f9f000)
    ) = 37
    • SIGSEGV (Segmentation fault) @ 0 (0) ---
    + killed by SIGSEGV +
    I think I found the (one?) problem: all boils down to a non-working ppu-embedspu. I am not yet sure whether everything works, but I was at leat able to run a program comparable to simple.
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-11T10:28:25Z  
    I know this is untested, I tried it nevertheless
    I try to run the cell full system simulator on a ia32e gentoo distribution, probably one of the worst possible combinations (no native fedora libs, no rpm, no/very few 32bit x86 libs/tools).
    I built the toolchain from scratch. I had to change some makefiles of the other parts (sdk, kernel, libspe) due to different paths. I built the sysroot_image by hand and run the simulator against the binary fedora libstdc++ (my multilib one didn't work).
    I can know boot linux in the simulator, but not everything seems to work as expected, my observations (everything in fast mode):

    I can run 32 bit binaries compiled in the simulator or on the host. I can neither run nor compile 64 bit binaries on the simulated system (due to a incomplete toolchain on the simulated system).

    run properly (second paragraph is from spu/bin):
    euler_scalar, euler_simd_aos, euler_simd_soa, audio, curve, fft_2d, gmath, image, intrinsics_si, intrinsics_vmx, math1, matrix, misc, noise, predicates_vmx, surface, vector
    hello, spe-cp, spe-sum, spu_interrupt, abi, audio, c, c_malloc, curve, fft_1d, fft_2d, gmath, image, intrinsics_si, intrinsics_spu, large_matrix, math1, math2, matrix, misc, mpm1, mpm2, mpm3, noise, surface, test_spu_ext, vector

    segfault:
    euler_multi_spe, euler_spe

    can't create thread (errno=22):
    atomic_op_sample, dma_sample, driver, mutex_sample, simple, simpleDMA, simple_cesof, cpex

    hang:
    cond_sample

    atomic_op_sample:
    fails the first 2 tests, passes the next 2 ones, fails the last one (cannot create thread errno=22)

    cannot locate SPU executable:
    ppu_add, ppu_sync_add

    So, all in all, for me it looks like if libspe doesn't work.
    Ideas?

    Oh, and I find it really impractical that the size of the virtual terminal changes when I start vi in the simulation.
    After using the binary version of ppu-embedspu, most programs run without errors.

    • euler_spe and euler_multi_spe don't segfault any longer
    • also run poperly now (couldn't create thread befor): atomic_op_sample, dma_sample, mutex_sample, simple, simpleDMA
    • report "Bus error": driver, simple_cesof, cpex
    • cond_sample doesn't hang any longer
    • ppu_add and ppu_sync_add behave as before
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-12T15:39:35Z  
    After using the binary version of ppu-embedspu, most programs run without errors.

    • euler_spe and euler_multi_spe don't segfault any longer
    • also run poperly now (couldn't create thread befor): atomic_op_sample, dma_sample, mutex_sample, simple, simpleDMA
    • report "Bus error": driver, simple_cesof, cpex
    • cond_sample doesn't hang any longer
    • ppu_add and ppu_sync_add behave as before
    You shouldn't use the "binary" version of the ppu-embedspu, if there is one.
    The CESOF object generated by the older embedspu should not work properly.
    The latest embedspu, which supports the latest CESOF, is done by invoking gas thru gcc.

    I don't know if you have given embedspu a right flag.
    Since the new script version supports both 32-bit and 64-bit binaries, for 32-environment, you need to specify -m32 (passed to gcc) to
    generate 32-bit CESOF object. Else, it will by default generate 64-bit object.

    You can also use the simple wrapping script for 32-bit object: /opt/sce/toolchain-2.3/ppu/bin/ppu32-embedspu.

    You can later use readelf to check the generated CESOF object to see if it is 64-bit or 32-bit.

    I suspect this is the problem. If not, please let me know. Thanks.
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-12T15:53:10Z  
    You shouldn't use the "binary" version of the ppu-embedspu, if there is one.
    The CESOF object generated by the older embedspu should not work properly.
    The latest embedspu, which supports the latest CESOF, is done by invoking gas thru gcc.

    I don't know if you have given embedspu a right flag.
    Since the new script version supports both 32-bit and 64-bit binaries, for 32-environment, you need to specify -m32 (passed to gcc) to
    generate 32-bit CESOF object. Else, it will by default generate 64-bit object.

    You can also use the simple wrapping script for 32-bit object: /opt/sce/toolchain-2.3/ppu/bin/ppu32-embedspu.

    You can later use readelf to check the generated CESOF object to see if it is 64-bit or 32-bit.

    I suspect this is the problem. If not, please let me know. Thanks.
    I just noticed that your previous posts per running in gentoo environment.

    Since it links properly before, the flag might be ok, unless you are generating
    64-bit PPE binaries.

    Have you tried a ppu-readelf comparison between the CESOF file from a fedora version to a gentoo version?

    The different, if any, probably can tell if that is a runtime(libspe), a embedspu problem, or a build problem.

    Also, I believe that libspe runtime currently supports only 32-bit program.
    If you start a 64-bit binary, I don't know if it will work properly?

    Good luck!
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-12T18:58:40Z  
    I just noticed that your previous posts per running in gentoo environment.

    Since it links properly before, the flag might be ok, unless you are generating
    64-bit PPE binaries.

    Have you tried a ppu-readelf comparison between the CESOF file from a fedora version to a gentoo version?

    The different, if any, probably can tell if that is a runtime(libspe), a embedspu problem, or a build problem.

    Also, I believe that libspe runtime currently supports only 32-bit program.
    If you start a 64-bit binary, I don't know if it will work properly?

    Good luck!
    OK, finally even I got that embedspu is a script. But the script doesn't seem to work with my native toolchain. I currently run 32 bit programs on the cell. If I create the cesof with the embedspu using my native toolchain (with -m32 switch), the pointers seem to be crazy (causing my programs either segfaulting or aborting due to improper elf headers). And of course, there are difference between the libelf -a outputs:

    > diff non-working working
    13c13
    < Start of section headers: 12052 (bytes into file)
    ---
    > Start of section headers: 12176 (bytes into file)
    26,35c26,35
    < 2 .spuelf.simple_sp PROGBITS 00000000 000080 002e00 00 A 0 0 128
    < 3 .data PROGBITS 00000000 002e80 000000 00 WA 0 0 1
    < 4 .sdata PROGBITS 00000000 002e80 000004 00 WA 0 0 4
    < 5 .rela.sdata RELA 00000000 0030f4 00000c 0c 10 4 4
    < 6 .bss NOBITS 00000000 002e84 000000 00 WA 0 0 1
    < 7 .comment PROGBITS 00000000 002e84 00002a 00 0 0 1
    < 8 .note.GNU-stack NOTE 00000000 002eae 000000 00 X 0 0 1
    < 9 .shstrtab STRTAB 00000000 002eae 000064 00 0 0 1
    < 10 .symtab SYMTAB 00000000 003100 0000e0 10 11 13 4
    < 11 .strtab STRTAB 00000000 0031e0 000018 00 0 0 1
    ---
    > 2 .rodata.speelf PROGBITS 00000000 000080 002e00 00 A 0 0 128
    > 3 .data PROGBITS 00000000 002e80 00000c 00 WA 0 0 4
    > 4 .rela.data RELA 00000000 003170 000018 0c 10 3 4
    > 5 .data.spetoe PROGBITS 00000000 002f00 000000 00 WA 0 0 128
    > 6 .bss NOBITS 00000000 002f00 000000 00 WA 0 0 1
    > 7 .comment PROGBITS 00000000 002f00 00002a 00 0 0 1
    > 8 .note.GNU-stack NOTE 00000000 002f2a 000000 00 X 0 0 1
    > 9 .shstrtab STRTAB 00000000 002f2a 000066 00 0 0 1
    > 10 .symtab SYMTAB 00000000 003188 0000f0 10 11 14 4
    > 11 .strtab STRTAB 00000000 003278 000022 00 0 0 1
    45c45
    < Relocation section '.rela.sdata' at offset 0x30f4 contains 1 entries:
    ---
    > Relocation section '.rela.data' at offset 0x3170 contains 2 entries:
    47c47,48
    < 00000000 00000c01 R_PPC_ADDR32 00000000 __section__ + 0
    ---
    > 00000004 00000c01 R_PPC_ADDR32 00000000 __speelf__ + 0
    > 00000008 00000d01 R_PPC_ADDR32 00000000 __spetoe__ + 0
    51c52
    < Symbol table '.symtab' contains 14 entries:
    ---
    > Symbol table '.symtab' contains 15 entries:
    65,66c66,68
    < 12: 00000000 0 OBJECT LOCAL DEFAULT 2 __section__
    < 13: 00000000 4 OBJECT GLOBAL DEFAULT 4 simple_spu
    ---
    > 12: 00000000 0 OBJECT LOCAL DEFAULT 2 __speelf__
    > 13: 00000000 0 OBJECT LOCAL DEFAULT 5 __spetoe__
    > 14: 00000000 12 OBJECT GLOBAL DEFAULT 3 simple_spu
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-13T03:11:14Z  
    OK, finally even I got that embedspu is a script. But the script doesn't seem to work with my native toolchain. I currently run 32 bit programs on the cell. If I create the cesof with the embedspu using my native toolchain (with -m32 switch), the pointers seem to be crazy (causing my programs either segfaulting or aborting due to improper elf headers). And of course, there are difference between the libelf -a outputs:

    > diff non-working working
    13c13
    < Start of section headers: 12052 (bytes into file)
    ---
    > Start of section headers: 12176 (bytes into file)
    26,35c26,35
    < 2 .spuelf.simple_sp PROGBITS 00000000 000080 002e00 00 A 0 0 128
    < 3 .data PROGBITS 00000000 002e80 000000 00 WA 0 0 1
    < 4 .sdata PROGBITS 00000000 002e80 000004 00 WA 0 0 4
    < 5 .rela.sdata RELA 00000000 0030f4 00000c 0c 10 4 4
    < 6 .bss NOBITS 00000000 002e84 000000 00 WA 0 0 1
    < 7 .comment PROGBITS 00000000 002e84 00002a 00 0 0 1
    < 8 .note.GNU-stack NOTE 00000000 002eae 000000 00 X 0 0 1
    < 9 .shstrtab STRTAB 00000000 002eae 000064 00 0 0 1
    < 10 .symtab SYMTAB 00000000 003100 0000e0 10 11 13 4
    < 11 .strtab STRTAB 00000000 0031e0 000018 00 0 0 1
    ---
    > 2 .rodata.speelf PROGBITS 00000000 000080 002e00 00 A 0 0 128
    > 3 .data PROGBITS 00000000 002e80 00000c 00 WA 0 0 4
    > 4 .rela.data RELA 00000000 003170 000018 0c 10 3 4
    > 5 .data.spetoe PROGBITS 00000000 002f00 000000 00 WA 0 0 128
    > 6 .bss NOBITS 00000000 002f00 000000 00 WA 0 0 1
    > 7 .comment PROGBITS 00000000 002f00 00002a 00 0 0 1
    > 8 .note.GNU-stack NOTE 00000000 002f2a 000000 00 X 0 0 1
    > 9 .shstrtab STRTAB 00000000 002f2a 000066 00 0 0 1
    > 10 .symtab SYMTAB 00000000 003188 0000f0 10 11 14 4
    > 11 .strtab STRTAB 00000000 003278 000022 00 0 0 1
    45c45
    < Relocation section '.rela.sdata' at offset 0x30f4 contains 1 entries:
    ---
    > Relocation section '.rela.data' at offset 0x3170 contains 2 entries:
    47c47,48
    < 00000000 00000c01 R_PPC_ADDR32 00000000 __section__ + 0
    ---
    > 00000004 00000c01 R_PPC_ADDR32 00000000 __speelf__ + 0
    > 00000008 00000d01 R_PPC_ADDR32 00000000 __spetoe__ + 0
    51c52
    < Symbol table '.symtab' contains 14 entries:
    ---
    > Symbol table '.symtab' contains 15 entries:
    65,66c66,68
    < 12: 00000000 0 OBJECT LOCAL DEFAULT 2 __section__
    < 13: 00000000 4 OBJECT GLOBAL DEFAULT 4 simple_spu
    ---
    > 12: 00000000 0 OBJECT LOCAL DEFAULT 2 __speelf__
    > 13: 00000000 0 OBJECT LOCAL DEFAULT 5 __spetoe__
    > 14: 00000000 12 OBJECT GLOBAL DEFAULT 3 simple_spu
    Can you try to post the whole ppu-readelf -a listing of the non-working version directly?

    Thx.
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-13T12:43:45Z  
    Can you try to post the whole ppu-readelf -a listing of the non-working version directly?

    Thx.
    ELF Header:
    Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
    Class: ELF32
    Data: 2's complement, big endian
    Version: 1 (current)
    OS/ABI: UNIX - System V
    ABI Version: 0
    Type: REL (Relocatable file)
    Machine: PowerPC
    Version: 0x1
    Entry point address: 0x0
    Start of program headers: 0 (bytes into file)
    Start of section headers: 12052 (bytes into file)
    Flags: 0x0
    Size of this header: 52 (bytes)
    Size of program headers: 0 (bytes)
    Number of program headers: 0
    Size of section headers: 40 (bytes)
    Number of section headers: 12
    Section header string table index: 9

    Section Headers:
    Nr Name Type Addr Off Size ES Flg Lk Inf Al
    0 NULL 00000000 000000 000000 00 0 0 0
    1 .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
    2 .spuelf.simple_sp PROGBITS 00000000 000080 002e00 00 A 0 0 128
    3 .data PROGBITS 00000000 002e80 000000 00 WA 0 0 1
    4 .sdata PROGBITS 00000000 002e80 000004 00 WA 0 0 4
    5 .rela.sdata RELA 00000000 0030f4 00000c 0c 10 4 4
    6 .bss NOBITS 00000000 002e84 000000 00 WA 0 0 1
    7 .comment PROGBITS 00000000 002e84 00002a 00 0 0 1
    8 .note.GNU-stack NOTE 00000000 002eae 000000 00 X 0 0 1
    9 .shstrtab STRTAB 00000000 002eae 000064 00 0 0 1
    10 .symtab SYMTAB 00000000 003100 0000e0 10 11 d 4
    11 .strtab STRTAB 00000000 0031e0 000018 00 0 0 1
    Key to Flags:
    W (write), A (alloc), X (execute), M (merge), S (strings)
    I (info), L (link order), G (group), x (unknown)
    O (extra OS processing required) o (OS specific), p (processor specific)

    There are no program headers in this file.

    Relocation section '.rela.sdata' at offset 0x30f4 contains 1 entries:
    Offset Info Type Sym.Value Sym. Name + Addend
    00000000 00000c01 R_PPC_ADDR32 00000000 __section__ + 0

    There are no unwind sections in this file.

    Symbol table '.symtab' contains 14 entries:
    Num: Value Size Type Bind Vis Ndx Name
    0: 00000000 0 NOTYPE LOCAL DEFAULT UND
    1: 00000000 0 SECTION LOCAL DEFAULT 1
    2: 00000000 0 SECTION LOCAL DEFAULT 2
    3: 00000000 0 SECTION LOCAL DEFAULT 3
    4: 00000000 0 SECTION LOCAL DEFAULT 4
    5: 00000000 0 SECTION LOCAL DEFAULT 5
    6: 00000000 0 SECTION LOCAL DEFAULT 6
    7: 00000000 0 SECTION LOCAL DEFAULT 7
    8: 00000000 0 SECTION LOCAL DEFAULT 8
    9: 00000000 0 SECTION LOCAL DEFAULT 9
    10: 00000000 0 SECTION LOCAL DEFAULT 10
    11: 00000000 0 SECTION LOCAL DEFAULT 11
    12: 00000000 0 OBJECT LOCAL DEFAULT 2 __section__
    13: 00000000 4 OBJECT GLOBAL DEFAULT 4 simple_spu

    No version information found in this file.
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-13T14:21:17Z  
    ELF Header:
    Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
    Class: ELF32
    Data: 2's complement, big endian
    Version: 1 (current)
    OS/ABI: UNIX - System V
    ABI Version: 0
    Type: REL (Relocatable file)
    Machine: PowerPC
    Version: 0x1
    Entry point address: 0x0
    Start of program headers: 0 (bytes into file)
    Start of section headers: 12052 (bytes into file)
    Flags: 0x0
    Size of this header: 52 (bytes)
    Size of program headers: 0 (bytes)
    Number of program headers: 0
    Size of section headers: 40 (bytes)
    Number of section headers: 12
    Section header string table index: 9

    Section Headers:
    Nr Name Type Addr Off Size ES Flg Lk Inf Al
    0 NULL 00000000 000000 000000 00 0 0 0
    1 .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
    2 .spuelf.simple_sp PROGBITS 00000000 000080 002e00 00 A 0 0 128
    3 .data PROGBITS 00000000 002e80 000000 00 WA 0 0 1
    4 .sdata PROGBITS 00000000 002e80 000004 00 WA 0 0 4
    5 .rela.sdata RELA 00000000 0030f4 00000c 0c 10 4 4
    6 .bss NOBITS 00000000 002e84 000000 00 WA 0 0 1
    7 .comment PROGBITS 00000000 002e84 00002a 00 0 0 1
    8 .note.GNU-stack NOTE 00000000 002eae 000000 00 X 0 0 1
    9 .shstrtab STRTAB 00000000 002eae 000064 00 0 0 1
    10 .symtab SYMTAB 00000000 003100 0000e0 10 11 d 4
    11 .strtab STRTAB 00000000 0031e0 000018 00 0 0 1
    Key to Flags:
    W (write), A (alloc), X (execute), M (merge), S (strings)
    I (info), L (link order), G (group), x (unknown)
    O (extra OS processing required) o (OS specific), p (processor specific)

    There are no program headers in this file.

    Relocation section '.rela.sdata' at offset 0x30f4 contains 1 entries:
    Offset Info Type Sym.Value Sym. Name + Addend
    00000000 00000c01 R_PPC_ADDR32 00000000 __section__ + 0

    There are no unwind sections in this file.

    Symbol table '.symtab' contains 14 entries:
    Num: Value Size Type Bind Vis Ndx Name
    0: 00000000 0 NOTYPE LOCAL DEFAULT UND
    1: 00000000 0 SECTION LOCAL DEFAULT 1
    2: 00000000 0 SECTION LOCAL DEFAULT 2
    3: 00000000 0 SECTION LOCAL DEFAULT 3
    4: 00000000 0 SECTION LOCAL DEFAULT 4
    5: 00000000 0 SECTION LOCAL DEFAULT 5
    6: 00000000 0 SECTION LOCAL DEFAULT 6
    7: 00000000 0 SECTION LOCAL DEFAULT 7
    8: 00000000 0 SECTION LOCAL DEFAULT 8
    9: 00000000 0 SECTION LOCAL DEFAULT 9
    10: 00000000 0 SECTION LOCAL DEFAULT 10
    11: 00000000 0 SECTION LOCAL DEFAULT 11
    12: 00000000 0 OBJECT LOCAL DEFAULT 2 __section__
    13: 00000000 4 OBJECT GLOBAL DEFAULT 4 simple_spu

    No version information found in this file.
    This output is not from the latest embedspu script that put the spu elf image inside of the .rodata.speelf section. There should also be an empty .data.spetoe section.

    Could you double check your environment to see if there is another embedspu hangin around? e.g. the "binary" version or an older version of the embedspu script?

    In addition, you should also find two local symbol __speelf__ and __spetoe__ in the symbol table.

    Though, in the future, a "binary" version should be the proper implementation, in the meantime, the dependencies on ppu-gcc, ppu-gas, and spu-readelf must be met.

    Good luck!
    Thx
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-13T15:45:22Z  
    This output is not from the latest embedspu script that put the spu elf image inside of the .rodata.speelf section. There should also be an empty .data.spetoe section.

    Could you double check your environment to see if there is another embedspu hangin around? e.g. the "binary" version or an older version of the embedspu script?

    In addition, you should also find two local symbol __speelf__ and __spetoe__ in the symbol table.

    Though, in the future, a "binary" version should be the proper implementation, in the meantime, the dependencies on ppu-gcc, ppu-gas, and spu-readelf must be met.

    Good luck!
    Thx
    I downloaded the toolchain sources from http://www.bsc.es/projects/deepcomputing/linuxoncell/.

    To remove all confusion: the script from the binary toolchain is [1], the one from the source distrivution [2], readelf -a of the working embedded is [3], the broken one is [4].
    [1]
    #!/bin/sh

    1. (C)Copyright
    2. Sony Computer Entertainment, Inc.,
    3. Toshiba Corporation,
    4. International Business Machines Corporation,
    5. 2005. All rights reserved.

    #
    1. Embed SPE ELF executable into PPE object file, and define a
    2. global pointer variable refering to the embedded file.
    #
    1. Usage: embedspu flags symbol_name input_filename output_filename
    #
    1. input_filename: SPE ELF executable to be embedded
    2. output_filename: Resulting PPE object file
    3. symbol_name: Name of global pointer variable to be defined
    4. flags: GCC flags defining PPE object file format
    5. (e.g. -m32 or -m64)
    #

    1. Determine location of dependent utilities
    file=`basename "$0"`
    dir=`dirname "$0"`
    && PREFIX=ppu-

    PPU_GCC=${PREFIX}gcc
    SPU_READELF=spu-readelf

    which $PPU_GCC > /dev/null 2>&1
    if $? -eq 0
    then
    :
    elif -a ${dir}/$PPU_GCC
    then
    PPU_GCC=${dir}/$PPU_GCC
    elif -a /opt/sce/ppu/bin/$PPU_GCC
    then
    PPU_GCC=/opt/sce/ppu/bin/$PPU_GCC
    else
    echo Cannot find $PPU_GCC.
    exit 1
    fi

    which $SPU_READELF > /dev/null 2>&1
    if $? -eq 0
    then
    :
    elif http:// -a ${dir}/../../spu/bin/$SPU_READELF
    then
    SPU_READELF=${dir}/../../spu/bin/$SPU_READELF
    elif -a /opt/sce/spu/bin/$SPU_READELF
    then
    SPU_READELF=/opt/sce/spu/bin/$SPU_READELF
    else
    echo Cannot find $SPU_READELF.
    exit 1
    fi

    1. Argument parsing
    SYMBOL=
    INFILE=
    OUTFILE=
    FLAGS=

    while ; do
    case $1 in
    -*) FLAGS="${FLAGS} $1"
    shift ;;
    *) if -z $SYMBOL ; then
    SYMBOL=$1
    elif -z $INFILE ; then
    INFILE=$1
    elif -z $OUTFILE ; then
    OUTFILE=$1
    fi
    shift ;;
    esac
    done

    if ; then
    echo "Usage: $0 symbol_name input_filename output_filename"
    exit 1
    fi

    if ; then
    echo "${INFILE}: File not found"
    exit 1
    fi

    1. Temp file names
    TMPOBJ1=`mktemp emXXXXXX` || exit 1
    TMPOBJ2=`mktemp emXXXXXX` || { rm -f $TMPOBJ1; exit 1; }

    1. Build object file holding pointer to embedded section
    ${PPU_GCC} ${FLAGS} -x c -c -o ${TMPOBJ1} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
    static const unsigned char __speelf__[]
    __attribute__((section(".rodata.speelf"), aligned(128))) = { };

    static unsigned char __spetoe__[]
    __attribute__((section(".data.spetoe"), aligned(128))) = { };

    typedef struct spe_program_handle {
    unsigned int handle_size;
    const void *elf_image;
    void *toe_shadow;
    } spe_program_handle_t;

    spe_program_handle_t ${SYMBOL} = { sizeof (spe_program_handle_t),
    __speelf__, __spetoe__ };
    EOF

    1. Build object file holding embedded section itself
    ${PPU_GCC} ${FLAGS} -x assembler-with-cpp -c -o ${TMPOBJ2} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
    .section .rodata.speelf,"a",@progbits
    .p2align 7
    .incbin "${INFILE}"

    .section .data.spetoe,"aw",@progbits
    .p2align 7
    `${SPU_READELF} -s ${INFILE} | egrep ' _EAR_' | sort -k 2 | awk \
    '{ \
    print "#ifdef _LP64"; \
    print ".quad " substr($8, 6); \
    print ".quad 0"; \
    print "#else"; \
    print ".int 0"; \
    print ".int " substr($8, 6); \
    print ".int 0"; \
    print ".int 0"; \
    print "#endif"; \
    }'`
    EOF

    1. Link both object files together
    ${PPU_GCC} ${FLAGS} -nostartfiles -nostdlib -Wl,-r -Wl,-x \
    -o ${OUTFILE} ${TMPOBJ1} ${TMPOBJ2}

    1. Clean up
    rm -f ${TMPOBJ1} ${TMPOBJ2}
    [2]
    #!/bin/sh

    1. (C)Copyright
    2. Sony Computer Entertainment, Inc.,
    3. Toshiba Corporation,
    4. International Business Machines Corporation,
    5. 2005. All rights reserved.

    #
    1. Embed SPE ELF executable into PPE object file, and define a
    2. global pointer variable refering to the embedded file.
    #
    1. Usage: embedspu flags symbol_name input_filename output_filename
    #
    1. input_filename: SPE ELF executable to be embedded
    2. output_filename: Resulting PPE object file
    3. symbol_name: Name of global pointer variable to be defined
    4. flags: GCC flags defining PPE object file format
    5. (e.g. -m32 or -m64)
    #

    1. Argument parsing
    SYMBOL=
    INFILE=
    OUTFILE=
    FLAGS=

    while ; do
    case $1 in
    -*) FLAGS="${FLAGS} $1"
    shift ;;
    *) if -z $SYMBOL ; then
    SYMBOL=$1
    elif -z $INFILE ; then
    INFILE=$1
    elif -z $OUTFILE ; then
    OUTFILE=$1
    fi
    shift ;;
    esac
    done

    file=`basename "$0"`
    dir=`dirname "$0"`
    && PREFIX=ppu-
    && PREFIX="$dir/$PREFIX"

    if ; then
    echo "Usage: $0 symbol_name input_filename output_filename"
    exit 1
    fi

    1. The section name as defined by the SPU ABI
    SECTION=.spuelf.${INFILE}

    1. Temp file names
    TMPOBJ1=`mktemp emXXXXXX` || exit 1
    TMPOBJ2=`mktemp emXXXXXX` || { rm -f $TMPOBJ1; exit 1; }

    1. Build object file holding pointer to embedded section
    ${PREFIX}gcc ${FLAGS} -x c -c -o ${TMPOBJ1} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
    static const unsigned char __section__[]
    __attribute__((section("${SECTION}"), aligned(128))) = { };
    const void *${SYMBOL} = __section__;
    EOF

    1. Build object file holding embedded section itself
    ${PREFIX}gcc ${FLAGS} -x assembler -c -o ${TMPOBJ2} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
    .section ${SECTION},"a",@progbits
    .p2align 7
    .incbin "${INFILE}"
    EOF

    1. Link both object files together
    ${PREFIX}gcc ${FLAGS} -nostartfiles -nostdlib -Wl,-r -Wl,-x \
    -o ${OUTFILE} ${TMPOBJ1} ${TMPOBJ2}

    1. Clean up
    rm -f ${TMPOBJ1} ${TMPOBJ2}
    [3]
    ELF Header:
    Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
    Class: ELF32
    Data: 2's complement, big endian
    Version: 1 (current)
    OS/ABI: UNIX - System V
    ABI Version: 0
    Type: REL (Relocatable file)
    Machine: PowerPC
    Version: 0x1
    Entry point address: 0x0
    Start of program headers: 0 (bytes into file)
    Start of section headers: 226320 (bytes into file)
    Flags: 0x0
    Size of this header: 52 (bytes)
    Size of program headers: 0 (bytes)
    Number of program headers: 0
    Size of section headers: 40 (bytes)
    Number of section headers: 12
    Section header string table index: 9

    Section Headers:
    Nr Name Type Addr Off Size ES Flg Lk Inf Al
    0 NULL 00000000 000000 000000 00 0 0 0
    1 .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
    2 .rodata.speelf PROGBITS 00000000 000080 037280 00 A 0 0 128
    3 .data PROGBITS 00000000 037300 00000c 00 WA 0 0 4
    4 .rela.data RELA 00000000 0375f0 000018 0c 10 3 4
    5 .data.spetoe PROGBITS 00000000 037380 000000 00 WA 0 0 128
    6 .bss NOBITS 00000000 037380 000000 00 WA 0 0 1
    7 .comment PROGBITS 00000000 037380 00002a 00 0 0 1
    8 .note.GNU-stack NOTE 00000000 0373aa 000000 00 X 0 0 1
    9 .shstrtab STRTAB 00000000 0373aa 000066 00 0 0 1
    10 .symtab SYMTAB 00000000 037608 0000f0 10 11 14 4
    11 .strtab STRTAB 00000000 0376f8 000022 00 0 0 1
    Key to Flags:
    W (write), A (alloc), X (execute), M (merge), S (strings)
    I (info), L (link order), G (group), x (unknown)
    O (extra OS processing required) o (OS specific), p (processor specific)

    There are no section groups in this file.

    There are no program headers in this file.

    Relocation section '.rela.data' at offset 0x375f0 contains 2 entries:
    Offset Info Type Sym.Value Sym. Name + Addend
    00000004 00000c01 R_PPC_ADDR32 00000000 __speelf__ + 0
    00000008 00000d01 R_PPC_ADDR32 00000000 __spetoe__ + 0

    There are no unwind sections in this file.

    Symbol table '.symtab' contains 15 entries:
    Num: Value Size Type Bind Vis Ndx Name
    0: 00000000 0 NOTYPE LOCAL DEFAULT UND
    1: 00000000 0 SECTION LOCAL DEFAULT 1
    2: 00000000 0 SECTION LOCAL DEFAULT 2
    3: 00000000 0 SECTION LOCAL DEFAULT 3
    4: 00000000 0 SECTION LOCAL DEFAULT 4
    5: 00000000 0 SECTION LOCAL DEFAULT 5
    6: 00000000 0 SECTION LOCAL DEFAULT 6
    7: 00000000 0 SECTION LOCAL DEFAULT 7
    8: 00000000 0 SECTION LOCAL DEFAULT 8
    9: 00000000 0 SECTION LOCAL DEFAULT 9
    10: 00000000 0 SECTION LOCAL DEFAULT 10
    11: 00000000 0 SECTION LOCAL DEFAULT 11
    12: 00000000 0 OBJECT LOCAL DEFAULT 2 __speelf__
    13: 00000000 0 OBJECT LOCAL DEFAULT 5 __spetoe__
    14: 00000000 12 OBJECT GLOBAL DEFAULT 3 simple_spu

    No version information found in this file.

    [4]
    ELF Header:
    Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
    Class: ELF32
    Data: 2's complement, big endian
    Version: 1 (current)
    OS/ABI: UNIX - System V
    ABI Version: 0
    Type: REL (Relocatable file)
    Machine: PowerPC
    Version: 0x1
    Entry point address: 0x0
    Start of program headers: 0 (bytes into file)
    Start of section headers: 226196 (bytes into file)
    Flags: 0x0
    Size of this header: 52 (bytes)
    Size of program headers: 0 (bytes)
    Number of program headers: 0
    Size of section headers: 40 (bytes)
    Number of section headers: 12
    Section header string table index: 9

    Section Headers:
    Nr Name Type Addr Off Size ES Flg Lk Inf Al
    0 NULL 00000000 000000 000000 00 0 0 0
    1 .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
    2 .spuelf.simple_sp PROGBITS 00000000 000080 037280 00 A 0 0 128
    3 .data PROGBITS 00000000 037300 000000 00 WA 0 0 1
    4 .sdata PROGBITS 00000000 037300 000004 00 WA 0 0 4
    5 .rela.sdata RELA 00000000 037574 00000c 0c 10 4 4
    6 .bss NOBITS 00000000 037304 000000 00 WA 0 0 1
    7 .comment PROGBITS 00000000 037304 00002a 00 0 0 1
    8 .note.GNU-stack NOTE 00000000 03732e 000000 00 X 0 0 1
    9 .shstrtab STRTAB 00000000 03732e 000064 00 0 0 1
    10 .symtab SYMTAB 00000000 037580 0000e0 10 11 13 4
    11 .strtab STRTAB 00000000 037660 000018 00 0 0 1
    Key to Flags:
    W (write), A (alloc), X (execute), M (merge), S (strings)
    I (info), L (link order), G (group), x (unknown)
    O (extra OS processing required) o (OS specific), p (processor specific)

    There are no section groups in this file.

    There are no program headers in this file.

    Relocation section '.rela.sdata' at offset 0x37574 contains 1 entries:
    Offset Info Type Sym.Value Sym. Name + Addend
    00000000 00000c01 R_PPC_ADDR32 00000000 __section__ + 0

    There are no unwind sections in this file.

    Symbol table '.symtab' contains 14 entries:
    Num: Value Size Type Bind Vis Ndx Name
    0: 00000000 0 NOTYPE LOCAL DEFAULT UND
    1: 00000000 0 SECTION LOCAL DEFAULT 1
    2: 00000000 0 SECTION LOCAL DEFAULT 2
    3: 00000000 0 SECTION LOCAL DEFAULT 3
    4: 00000000 0 SECTION LOCAL DEFAULT 4
    5: 00000000 0 SECTION LOCAL DEFAULT 5
    6: 00000000 0 SECTION LOCAL DEFAULT 6
    7: 00000000 0 SECTION LOCAL DEFAULT 7
    8: 00000000 0 SECTION LOCAL DEFAULT 8
    9: 00000000 0 SECTION LOCAL DEFAULT 9
    10: 00000000 0 SECTION LOCAL DEFAULT 10
    11: 00000000 0 SECTION LOCAL DEFAULT 11
    12: 00000000 0 OBJECT LOCAL DEFAULT 2 __section__
    13: 00000000 4 OBJECT GLOBAL DEFAULT 4 simple_spu

    No version information found in this file.
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-13T16:19:30Z  
    I downloaded the toolchain sources from http://www.bsc.es/projects/deepcomputing/linuxoncell/.

    To remove all confusion: the script from the binary toolchain is [1], the one from the source distrivution [2], readelf -a of the working embedded is [3], the broken one is [4].
    [1]
    #!/bin/sh

    1. (C)Copyright
    2. Sony Computer Entertainment, Inc.,
    3. Toshiba Corporation,
    4. International Business Machines Corporation,
    5. 2005. All rights reserved.

    #
    1. Embed SPE ELF executable into PPE object file, and define a
    2. global pointer variable refering to the embedded file.
    #
    1. Usage: embedspu flags symbol_name input_filename output_filename
    #
    1. input_filename: SPE ELF executable to be embedded
    2. output_filename: Resulting PPE object file
    3. symbol_name: Name of global pointer variable to be defined
    4. flags: GCC flags defining PPE object file format
    5. (e.g. -m32 or -m64)
    #

    1. Determine location of dependent utilities
    file=`basename "$0"`
    dir=`dirname "$0"`
    && PREFIX=ppu-

    PPU_GCC=${PREFIX}gcc
    SPU_READELF=spu-readelf

    which $PPU_GCC > /dev/null 2>&1
    if $? -eq 0
    then
    :
    elif -a ${dir}/$PPU_GCC
    then
    PPU_GCC=${dir}/$PPU_GCC
    elif -a /opt/sce/ppu/bin/$PPU_GCC
    then
    PPU_GCC=/opt/sce/ppu/bin/$PPU_GCC
    else
    echo Cannot find $PPU_GCC.
    exit 1
    fi

    which $SPU_READELF > /dev/null 2>&1
    if $? -eq 0
    then
    :
    elif http:// -a ${dir}/../../spu/bin/$SPU_READELF
    then
    SPU_READELF=${dir}/../../spu/bin/$SPU_READELF
    elif -a /opt/sce/spu/bin/$SPU_READELF
    then
    SPU_READELF=/opt/sce/spu/bin/$SPU_READELF
    else
    echo Cannot find $SPU_READELF.
    exit 1
    fi

    1. Argument parsing
    SYMBOL=
    INFILE=
    OUTFILE=
    FLAGS=

    while ; do
    case $1 in
    -*) FLAGS="${FLAGS} $1"
    shift ;;
    *) if -z $SYMBOL ; then
    SYMBOL=$1
    elif -z $INFILE ; then
    INFILE=$1
    elif -z $OUTFILE ; then
    OUTFILE=$1
    fi
    shift ;;
    esac
    done

    if ; then
    echo "Usage: $0 symbol_name input_filename output_filename"
    exit 1
    fi

    if ; then
    echo "${INFILE}: File not found"
    exit 1
    fi

    1. Temp file names
    TMPOBJ1=`mktemp emXXXXXX` || exit 1
    TMPOBJ2=`mktemp emXXXXXX` || { rm -f $TMPOBJ1; exit 1; }

    1. Build object file holding pointer to embedded section
    ${PPU_GCC} ${FLAGS} -x c -c -o ${TMPOBJ1} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
    static const unsigned char __speelf__[]
    __attribute__((section(".rodata.speelf"), aligned(128))) = { };

    static unsigned char __spetoe__[]
    __attribute__((section(".data.spetoe"), aligned(128))) = { };

    typedef struct spe_program_handle {
    unsigned int handle_size;
    const void *elf_image;
    void *toe_shadow;
    } spe_program_handle_t;

    spe_program_handle_t ${SYMBOL} = { sizeof (spe_program_handle_t),
    __speelf__, __spetoe__ };
    EOF

    1. Build object file holding embedded section itself
    ${PPU_GCC} ${FLAGS} -x assembler-with-cpp -c -o ${TMPOBJ2} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
    .section .rodata.speelf,"a",@progbits
    .p2align 7
    .incbin "${INFILE}"

    .section .data.spetoe,"aw",@progbits
    .p2align 7
    `${SPU_READELF} -s ${INFILE} | egrep ' _EAR_' | sort -k 2 | awk \
    '{ \
    print "#ifdef _LP64"; \
    print ".quad " substr($8, 6); \
    print ".quad 0"; \
    print "#else"; \
    print ".int 0"; \
    print ".int " substr($8, 6); \
    print ".int 0"; \
    print ".int 0"; \
    print "#endif"; \
    }'`
    EOF

    1. Link both object files together
    ${PPU_GCC} ${FLAGS} -nostartfiles -nostdlib -Wl,-r -Wl,-x \
    -o ${OUTFILE} ${TMPOBJ1} ${TMPOBJ2}

    1. Clean up
    rm -f ${TMPOBJ1} ${TMPOBJ2}
    [2]
    #!/bin/sh

    1. (C)Copyright
    2. Sony Computer Entertainment, Inc.,
    3. Toshiba Corporation,
    4. International Business Machines Corporation,
    5. 2005. All rights reserved.

    #
    1. Embed SPE ELF executable into PPE object file, and define a
    2. global pointer variable refering to the embedded file.
    #
    1. Usage: embedspu flags symbol_name input_filename output_filename
    #
    1. input_filename: SPE ELF executable to be embedded
    2. output_filename: Resulting PPE object file
    3. symbol_name: Name of global pointer variable to be defined
    4. flags: GCC flags defining PPE object file format
    5. (e.g. -m32 or -m64)
    #

    1. Argument parsing
    SYMBOL=
    INFILE=
    OUTFILE=
    FLAGS=

    while ; do
    case $1 in
    -*) FLAGS="${FLAGS} $1"
    shift ;;
    *) if -z $SYMBOL ; then
    SYMBOL=$1
    elif -z $INFILE ; then
    INFILE=$1
    elif -z $OUTFILE ; then
    OUTFILE=$1
    fi
    shift ;;
    esac
    done

    file=`basename "$0"`
    dir=`dirname "$0"`
    && PREFIX=ppu-
    && PREFIX="$dir/$PREFIX"

    if ; then
    echo "Usage: $0 symbol_name input_filename output_filename"
    exit 1
    fi

    1. The section name as defined by the SPU ABI
    SECTION=.spuelf.${INFILE}

    1. Temp file names
    TMPOBJ1=`mktemp emXXXXXX` || exit 1
    TMPOBJ2=`mktemp emXXXXXX` || { rm -f $TMPOBJ1; exit 1; }

    1. Build object file holding pointer to embedded section
    ${PREFIX}gcc ${FLAGS} -x c -c -o ${TMPOBJ1} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
    static const unsigned char __section__[]
    __attribute__((section("${SECTION}"), aligned(128))) = { };
    const void *${SYMBOL} = __section__;
    EOF

    1. Build object file holding embedded section itself
    ${PREFIX}gcc ${FLAGS} -x assembler -c -o ${TMPOBJ2} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
    .section ${SECTION},"a",@progbits
    .p2align 7
    .incbin "${INFILE}"
    EOF

    1. Link both object files together
    ${PREFIX}gcc ${FLAGS} -nostartfiles -nostdlib -Wl,-r -Wl,-x \
    -o ${OUTFILE} ${TMPOBJ1} ${TMPOBJ2}

    1. Clean up
    rm -f ${TMPOBJ1} ${TMPOBJ2}
    [3]
    ELF Header:
    Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
    Class: ELF32
    Data: 2's complement, big endian
    Version: 1 (current)
    OS/ABI: UNIX - System V
    ABI Version: 0
    Type: REL (Relocatable file)
    Machine: PowerPC
    Version: 0x1
    Entry point address: 0x0
    Start of program headers: 0 (bytes into file)
    Start of section headers: 226320 (bytes into file)
    Flags: 0x0
    Size of this header: 52 (bytes)
    Size of program headers: 0 (bytes)
    Number of program headers: 0
    Size of section headers: 40 (bytes)
    Number of section headers: 12
    Section header string table index: 9

    Section Headers:
    Nr Name Type Addr Off Size ES Flg Lk Inf Al
    0 NULL 00000000 000000 000000 00 0 0 0
    1 .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
    2 .rodata.speelf PROGBITS 00000000 000080 037280 00 A 0 0 128
    3 .data PROGBITS 00000000 037300 00000c 00 WA 0 0 4
    4 .rela.data RELA 00000000 0375f0 000018 0c 10 3 4
    5 .data.spetoe PROGBITS 00000000 037380 000000 00 WA 0 0 128
    6 .bss NOBITS 00000000 037380 000000 00 WA 0 0 1
    7 .comment PROGBITS 00000000 037380 00002a 00 0 0 1
    8 .note.GNU-stack NOTE 00000000 0373aa 000000 00 X 0 0 1
    9 .shstrtab STRTAB 00000000 0373aa 000066 00 0 0 1
    10 .symtab SYMTAB 00000000 037608 0000f0 10 11 14 4
    11 .strtab STRTAB 00000000 0376f8 000022 00 0 0 1
    Key to Flags:
    W (write), A (alloc), X (execute), M (merge), S (strings)
    I (info), L (link order), G (group), x (unknown)
    O (extra OS processing required) o (OS specific), p (processor specific)

    There are no section groups in this file.

    There are no program headers in this file.

    Relocation section '.rela.data' at offset 0x375f0 contains 2 entries:
    Offset Info Type Sym.Value Sym. Name + Addend
    00000004 00000c01 R_PPC_ADDR32 00000000 __speelf__ + 0
    00000008 00000d01 R_PPC_ADDR32 00000000 __spetoe__ + 0

    There are no unwind sections in this file.

    Symbol table '.symtab' contains 15 entries:
    Num: Value Size Type Bind Vis Ndx Name
    0: 00000000 0 NOTYPE LOCAL DEFAULT UND
    1: 00000000 0 SECTION LOCAL DEFAULT 1
    2: 00000000 0 SECTION LOCAL DEFAULT 2
    3: 00000000 0 SECTION LOCAL DEFAULT 3
    4: 00000000 0 SECTION LOCAL DEFAULT 4
    5: 00000000 0 SECTION LOCAL DEFAULT 5
    6: 00000000 0 SECTION LOCAL DEFAULT 6
    7: 00000000 0 SECTION LOCAL DEFAULT 7
    8: 00000000 0 SECTION LOCAL DEFAULT 8
    9: 00000000 0 SECTION LOCAL DEFAULT 9
    10: 00000000 0 SECTION LOCAL DEFAULT 10
    11: 00000000 0 SECTION LOCAL DEFAULT 11
    12: 00000000 0 OBJECT LOCAL DEFAULT 2 __speelf__
    13: 00000000 0 OBJECT LOCAL DEFAULT 5 __spetoe__
    14: 00000000 12 OBJECT GLOBAL DEFAULT 3 simple_spu

    No version information found in this file.

    [4]
    ELF Header:
    Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
    Class: ELF32
    Data: 2's complement, big endian
    Version: 1 (current)
    OS/ABI: UNIX - System V
    ABI Version: 0
    Type: REL (Relocatable file)
    Machine: PowerPC
    Version: 0x1
    Entry point address: 0x0
    Start of program headers: 0 (bytes into file)
    Start of section headers: 226196 (bytes into file)
    Flags: 0x0
    Size of this header: 52 (bytes)
    Size of program headers: 0 (bytes)
    Number of program headers: 0
    Size of section headers: 40 (bytes)
    Number of section headers: 12
    Section header string table index: 9

    Section Headers:
    Nr Name Type Addr Off Size ES Flg Lk Inf Al
    0 NULL 00000000 000000 000000 00 0 0 0
    1 .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
    2 .spuelf.simple_sp PROGBITS 00000000 000080 037280 00 A 0 0 128
    3 .data PROGBITS 00000000 037300 000000 00 WA 0 0 1
    4 .sdata PROGBITS 00000000 037300 000004 00 WA 0 0 4
    5 .rela.sdata RELA 00000000 037574 00000c 0c 10 4 4
    6 .bss NOBITS 00000000 037304 000000 00 WA 0 0 1
    7 .comment PROGBITS 00000000 037304 00002a 00 0 0 1
    8 .note.GNU-stack NOTE 00000000 03732e 000000 00 X 0 0 1
    9 .shstrtab STRTAB 00000000 03732e 000064 00 0 0 1
    10 .symtab SYMTAB 00000000 037580 0000e0 10 11 13 4
    11 .strtab STRTAB 00000000 037660 000018 00 0 0 1
    Key to Flags:
    W (write), A (alloc), X (execute), M (merge), S (strings)
    I (info), L (link order), G (group), x (unknown)
    O (extra OS processing required) o (OS specific), p (processor specific)

    There are no section groups in this file.

    There are no program headers in this file.

    Relocation section '.rela.sdata' at offset 0x37574 contains 1 entries:
    Offset Info Type Sym.Value Sym. Name + Addend
    00000000 00000c01 R_PPC_ADDR32 00000000 __section__ + 0

    There are no unwind sections in this file.

    Symbol table '.symtab' contains 14 entries:
    Num: Value Size Type Bind Vis Ndx Name
    0: 00000000 0 NOTYPE LOCAL DEFAULT UND
    1: 00000000 0 SECTION LOCAL DEFAULT 1
    2: 00000000 0 SECTION LOCAL DEFAULT 2
    3: 00000000 0 SECTION LOCAL DEFAULT 3
    4: 00000000 0 SECTION LOCAL DEFAULT 4
    5: 00000000 0 SECTION LOCAL DEFAULT 5
    6: 00000000 0 SECTION LOCAL DEFAULT 6
    7: 00000000 0 SECTION LOCAL DEFAULT 7
    8: 00000000 0 SECTION LOCAL DEFAULT 8
    9: 00000000 0 SECTION LOCAL DEFAULT 9
    10: 00000000 0 SECTION LOCAL DEFAULT 10
    11: 00000000 0 SECTION LOCAL DEFAULT 11
    12: 00000000 0 OBJECT LOCAL DEFAULT 2 __section__
    13: 00000000 4 OBJECT GLOBAL DEFAULT 4 simple_spu

    No version information found in this file.
    [1] is the correct version.
    [2] is from an older release. I doubt that you got the source distribution from an older version. For your cross-dev environment, please stay with the CBE SDK for x86 . I'll forward your post to our team...
    [3] has the correct output.
    [4] does not have correct structure and will not work.

    Thx.
  • SystemAdmin
    SystemAdmin
    10114 Posts

    Re: Discussion about the IBM Full-System Simulator for the CBE

    ‏2005-12-14T19:50:51Z  
    I downloaded the toolchain sources from http://www.bsc.es/projects/deepcomputing/linuxoncell/.

    To remove all confusion: the script from the binary toolchain is [1], the one from the source distrivution [2], readelf -a of the working embedded is [3], the broken one is [4].
    [1]
    #!/bin/sh

    1. (C)Copyright
    2. Sony Computer Entertainment, Inc.,
    3. Toshiba Corporation,
    4. International Business Machines Corporation,
    5. 2005. All rights reserved.

    #
    1. Embed SPE ELF executable into PPE object file, and define a
    2. global pointer variable refering to the embedded file.
    #
    1. Usage: embedspu flags symbol_name input_filename output_filename
    #
    1. input_filename: SPE ELF executable to be embedded
    2. output_filename: Resulting PPE object file
    3. symbol_name: Name of global pointer variable to be defined
    4. flags: GCC flags defining PPE object file format
    5. (e.g. -m32 or -m64)
    #

    1. Determine location of dependent utilities
    file=`basename "$0"`
    dir=`dirname "$0"`
    && PREFIX=ppu-

    PPU_GCC=${PREFIX}gcc
    SPU_READELF=spu-readelf

    which $PPU_GCC > /dev/null 2>&1
    if $? -eq 0
    then
    :
    elif -a ${dir}/$PPU_GCC
    then
    PPU_GCC=${dir}/$PPU_GCC
    elif -a /opt/sce/ppu/bin/$PPU_GCC
    then
    PPU_GCC=/opt/sce/ppu/bin/$PPU_GCC
    else
    echo Cannot find $PPU_GCC.
    exit 1
    fi

    which $SPU_READELF > /dev/null 2>&1
    if $? -eq 0
    then
    :
    elif http:// -a ${dir}/../../spu/bin/$SPU_READELF
    then
    SPU_READELF=${dir}/../../spu/bin/$SPU_READELF
    elif -a /opt/sce/spu/bin/$SPU_READELF
    then
    SPU_READELF=/opt/sce/spu/bin/$SPU_READELF
    else
    echo Cannot find $SPU_READELF.
    exit 1
    fi

    1. Argument parsing
    SYMBOL=
    INFILE=
    OUTFILE=
    FLAGS=

    while ; do
    case $1 in
    -*) FLAGS="${FLAGS} $1"
    shift ;;
    *) if -z $SYMBOL ; then
    SYMBOL=$1
    elif -z $INFILE ; then
    INFILE=$1
    elif -z $OUTFILE ; then
    OUTFILE=$1
    fi
    shift ;;
    esac
    done

    if ; then
    echo "Usage: $0 symbol_name input_filename output_filename"
    exit 1
    fi

    if ; then
    echo "${INFILE}: File not found"
    exit 1
    fi

    1. Temp file names
    TMPOBJ1=`mktemp emXXXXXX` || exit 1
    TMPOBJ2=`mktemp emXXXXXX` || { rm -f $TMPOBJ1; exit 1; }

    1. Build object file holding pointer to embedded section
    ${PPU_GCC} ${FLAGS} -x c -c -o ${TMPOBJ1} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
    static const unsigned char __speelf__[]
    __attribute__((section(".rodata.speelf"), aligned(128))) = { };

    static unsigned char __spetoe__[]
    __attribute__((section(".data.spetoe"), aligned(128))) = { };

    typedef struct spe_program_handle {
    unsigned int handle_size;
    const void *elf_image;
    void *toe_shadow;
    } spe_program_handle_t;

    spe_program_handle_t ${SYMBOL} = { sizeof (spe_program_handle_t),
    __speelf__, __spetoe__ };
    EOF

    1. Build object file holding embedded section itself
    ${PPU_GCC} ${FLAGS} -x assembler-with-cpp -c -o ${TMPOBJ2} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
    .section .rodata.speelf,"a",@progbits
    .p2align 7
    .incbin "${INFILE}"

    .section .data.spetoe,"aw",@progbits
    .p2align 7
    `${SPU_READELF} -s ${INFILE} | egrep ' _EAR_' | sort -k 2 | awk \
    '{ \
    print "#ifdef _LP64"; \
    print ".quad " substr($8, 6); \
    print ".quad 0"; \
    print "#else"; \
    print ".int 0"; \
    print ".int " substr($8, 6); \
    print ".int 0"; \
    print ".int 0"; \
    print "#endif"; \
    }'`
    EOF

    1. Link both object files together
    ${PPU_GCC} ${FLAGS} -nostartfiles -nostdlib -Wl,-r -Wl,-x \
    -o ${OUTFILE} ${TMPOBJ1} ${TMPOBJ2}

    1. Clean up
    rm -f ${TMPOBJ1} ${TMPOBJ2}
    [2]
    #!/bin/sh

    1. (C)Copyright
    2. Sony Computer Entertainment, Inc.,
    3. Toshiba Corporation,
    4. International Business Machines Corporation,
    5. 2005. All rights reserved.

    #
    1. Embed SPE ELF executable into PPE object file, and define a
    2. global pointer variable refering to the embedded file.
    #
    1. Usage: embedspu flags symbol_name input_filename output_filename
    #
    1. input_filename: SPE ELF executable to be embedded
    2. output_filename: Resulting PPE object file
    3. symbol_name: Name of global pointer variable to be defined
    4. flags: GCC flags defining PPE object file format
    5. (e.g. -m32 or -m64)
    #

    1. Argument parsing
    SYMBOL=
    INFILE=
    OUTFILE=
    FLAGS=

    while ; do
    case $1 in
    -*) FLAGS="${FLAGS} $1"
    shift ;;
    *) if -z $SYMBOL ; then
    SYMBOL=$1
    elif -z $INFILE ; then
    INFILE=$1
    elif -z $OUTFILE ; then
    OUTFILE=$1
    fi
    shift ;;
    esac
    done

    file=`basename "$0"`
    dir=`dirname "$0"`
    && PREFIX=ppu-
    && PREFIX="$dir/$PREFIX"

    if ; then
    echo "Usage: $0 symbol_name input_filename output_filename"
    exit 1
    fi

    1. The section name as defined by the SPU ABI
    SECTION=.spuelf.${INFILE}

    1. Temp file names
    TMPOBJ1=`mktemp emXXXXXX` || exit 1
    TMPOBJ2=`mktemp emXXXXXX` || { rm -f $TMPOBJ1; exit 1; }

    1. Build object file holding pointer to embedded section
    ${PREFIX}gcc ${FLAGS} -x c -c -o ${TMPOBJ1} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
    static const unsigned char __section__[]
    __attribute__((section("${SECTION}"), aligned(128))) = { };
    const void *${SYMBOL} = __section__;
    EOF

    1. Build object file holding embedded section itself
    ${PREFIX}gcc ${FLAGS} -x assembler -c -o ${TMPOBJ2} - <<EOF || { rm -f $TMPOBJ1 $TMPOBJ2; exit 1; }
    .section ${SECTION},"a",@progbits
    .p2align 7
    .incbin "${INFILE}"
    EOF

    1. Link both object files together
    ${PREFIX}gcc ${FLAGS} -nostartfiles -nostdlib -Wl,-r -Wl,-x \
    -o ${OUTFILE} ${TMPOBJ1} ${TMPOBJ2}

    1. Clean up
    rm -f ${TMPOBJ1} ${TMPOBJ2}
    [3]
    ELF Header:
    Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
    Class: ELF32
    Data: 2's complement, big endian
    Version: 1 (current)
    OS/ABI: UNIX - System V
    ABI Version: 0
    Type: REL (Relocatable file)
    Machine: PowerPC
    Version: 0x1
    Entry point address: 0x0
    Start of program headers: 0 (bytes into file)
    Start of section headers: 226320 (bytes into file)
    Flags: 0x0
    Size of this header: 52 (bytes)
    Size of program headers: 0 (bytes)
    Number of program headers: 0
    Size of section headers: 40 (bytes)
    Number of section headers: 12
    Section header string table index: 9

    Section Headers:
    Nr Name Type Addr Off Size ES Flg Lk Inf Al
    0 NULL 00000000 000000 000000 00 0 0 0
    1 .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
    2 .rodata.speelf PROGBITS 00000000 000080 037280 00 A 0 0 128
    3 .data PROGBITS 00000000 037300 00000c 00 WA 0 0 4
    4 .rela.data RELA 00000000 0375f0 000018 0c 10 3 4
    5 .data.spetoe PROGBITS 00000000 037380 000000 00 WA 0 0 128
    6 .bss NOBITS 00000000 037380 000000 00 WA 0 0 1
    7 .comment PROGBITS 00000000 037380 00002a 00 0 0 1
    8 .note.GNU-stack NOTE 00000000 0373aa 000000 00 X 0 0 1
    9 .shstrtab STRTAB 00000000 0373aa 000066 00 0 0 1
    10 .symtab SYMTAB 00000000 037608 0000f0 10 11 14 4
    11 .strtab STRTAB 00000000 0376f8 000022 00 0 0 1
    Key to Flags:
    W (write), A (alloc), X (execute), M (merge), S (strings)
    I (info), L (link order), G (group), x (unknown)
    O (extra OS processing required) o (OS specific), p (processor specific)

    There are no section groups in this file.

    There are no program headers in this file.

    Relocation section '.rela.data' at offset 0x375f0 contains 2 entries:
    Offset Info Type Sym.Value Sym. Name + Addend
    00000004 00000c01 R_PPC_ADDR32 00000000 __speelf__ + 0
    00000008 00000d01 R_PPC_ADDR32 00000000 __spetoe__ + 0

    There are no unwind sections in this file.

    Symbol table '.symtab' contains 15 entries:
    Num: Value Size Type Bind Vis Ndx Name
    0: 00000000 0 NOTYPE LOCAL DEFAULT UND
    1: 00000000 0 SECTION LOCAL DEFAULT 1
    2: 00000000 0 SECTION LOCAL DEFAULT 2
    3: 00000000 0 SECTION LOCAL DEFAULT 3
    4: 00000000 0 SECTION LOCAL DEFAULT 4
    5: 00000000 0 SECTION LOCAL DEFAULT 5
    6: 00000000 0 SECTION LOCAL DEFAULT 6
    7: 00000000 0 SECTION LOCAL DEFAULT 7
    8: 00000000 0 SECTION LOCAL DEFAULT 8
    9: 00000000 0 SECTION LOCAL DEFAULT 9
    10: 00000000 0 SECTION LOCAL DEFAULT 10
    11: 00000000 0 SECTION LOCAL DEFAULT 11
    12: 00000000 0 OBJECT LOCAL DEFAULT 2 __speelf__
    13: 00000000 0 OBJECT LOCAL DEFAULT 5 __spetoe__
    14: 00000000 12 OBJECT GLOBAL DEFAULT 3 simple_spu

    No version information found in this file.

    [4]
    ELF Header:
    Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
    Class: ELF32
    Data: 2's complement, big endian
    Version: 1 (current)
    OS/ABI: UNIX - System V
    ABI Version: 0
    Type: REL (Relocatable file)
    Machine: PowerPC
    Version: 0x1
    Entry point address: 0x0
    Start of program headers: 0 (bytes into file)
    Start of section headers: 226196 (bytes into file)
    Flags: 0x0
    Size of this header: 52 (bytes)
    Size of program headers: 0 (bytes)
    Number of program headers: 0
    Size of section headers: 40 (bytes)
    Number of section headers: 12
    Section header string table index: 9

    Section Headers:
    Nr Name Type Addr Off Size ES Flg Lk Inf Al
    0 NULL 00000000 000000 000000 00 0 0 0
    1 .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
    2 .spuelf.simple_sp PROGBITS 00000000 000080 037280 00 A 0 0 128
    3 .data PROGBITS 00000000 037300 000000 00 WA 0 0 1
    4 .sdata PROGBITS 00000000 037300 000004 00 WA 0 0 4
    5 .rela.sdata RELA 00000000 037574 00000c 0c 10 4 4
    6 .bss NOBITS 00000000 037304 000000 00 WA 0 0 1
    7 .comment PROGBITS 00000000 037304 00002a 00 0 0 1
    8 .note.GNU-stack NOTE 00000000 03732e 000000 00 X 0 0 1
    9 .shstrtab STRTAB 00000000 03732e 000064 00 0 0 1
    10 .symtab SYMTAB 00000000 037580 0000e0 10 11 13 4
    11 .strtab STRTAB 00000000 037660 000018 00 0 0 1
    Key to Flags:
    W (write), A (alloc), X (execute), M (merge), S (strings)
    I (info), L (link order), G (group), x (unknown)
    O (extra OS processing required) o (OS specific), p (processor specific)

    There are no section groups in this file.

    There are no program headers in this file.

    Relocation section '.rela.sdata' at offset 0x37574 contains 1 entries:
    Offset Info Type Sym.Value Sym. Name + Addend
    00000000 00000c01 R_PPC_ADDR32 00000000 __section__ + 0

    There are no unwind sections in this file.

    Symbol table '.symtab' contains 14 entries:
    Num: Value Size Type Bind Vis Ndx Name
    0: 00000000 0 NOTYPE LOCAL DEFAULT UND
    1: 00000000 0 SECTION LOCAL DEFAULT 1
    2: 00000000 0 SECTION LOCAL DEFAULT 2
    3: 00000000 0 SECTION LOCAL DEFAULT 3
    4: 00000000 0 SECTION LOCAL DEFAULT 4
    5: 00000000 0 SECTION LOCAL DEFAULT 5
    6: 00000000 0 SECTION LOCAL DEFAULT 6
    7: 00000000 0 SECTION LOCAL DEFAULT 7
    8: 00000000 0 SECTION LOCAL DEFAULT 8
    9: 00000000 0 SECTION LOCAL DEFAULT 9
    10: 00000000 0 SECTION LOCAL DEFAULT 10
    11: 00000000 0 SECTION LOCAL DEFAULT 11
    12: 00000000 0 OBJECT LOCAL DEFAULT 2 __section__
    13: 00000000 4 OBJECT GLOBAL DEFAULT 4 simple_spu

    No version information found in this file.
    Thank you!

    The difference that you pointed out has been confirmed by our team.
    The toolchain source RPM containing the right patches is already available for the "native" environment.
    The same patches are used to create the toolchain for the "cross" environment.

    To make it easier, we are in the process of recreating the patch RPM for "cross" fedora 4/x86 environmen as well.
    Once that is available, we will give a post on the forum.

    Please read the detail response from our development team:
    ==========================================================
    there are four different packages to consider:
    On the "x86 Hosted Environment for the Cell Broadband Engine" page:
    - toolchain-2.3-i686.tar.bz2 the binary package
    - toolchain-2.3+-src.tar.bz2 the (Sony) compiler source tarball

    On the "Development Release" "GNU Toolchain" native page:
    - spu-binutils-2.3-bsc2.1.ppc.rpm (the embedspu script is in the binutils binary RPM)
    - spu-toolchain-2.3-bsc2.1.src.rpm (the source RPM package)
    Now, the good news is that the two "binary" packages, both toolchain-2.3-i686.tar.bz2 (cross) and spu-binutils-2.3-bsc2.1.ppc.rpm (native) contain the exact same embedspu script, and this is the correct one supporting CESOF.

    Unfortunately, this is not the case for the source packages: on the "native" page, we have a source RPM package that contains both the unmodified Sony tarball plus a set of patches that are to be applied on top of them. One of those patches transforms the old embedspu script provided as part of the Sony tarball into the new script with CESOF. So if you rebuild the binary RPM from the source RPM, everything is fine.

    On the other side, on the "cross" SDK web page, the only source provided is the original Sony tarball itself, with the old embedspu script. People attempting to rebuild from that tarball will thus get the wrong script. Now, apparently when preparing the binary tarball you have applied the embedspu patch, as the binary tarball does contain the latest version. However, the patch isn't to be found on the web site, so people cannot rebuild the binary from source ...

    == end of cut/paste section ==