diff options
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 6 | ||||
-rw-r--r-- | binutils/embedspu.sh | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index a45b6e0..9ee4875 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2008-05-08 Alan Modra <amodra@bigpond.net.au> + + * embedspu.sh: Take note of R_SPU_PPU32/64 relocs without a symbol, + and if present, put image in ".data.speelf". Put program handle + in ".data.spehandle". + 2008-05-01 Nick Clifton <nickc@redhat.com> * readelf.c (print_symbol): Add code to display non-printing diff --git a/binutils/embedspu.sh b/binutils/embedspu.sh index d438ed9..f44d665 100644 --- a/binutils/embedspu.sh +++ b/binutils/embedspu.sh @@ -1,7 +1,7 @@ #! /bin/sh # Embed an SPU ELF executable into a PowerPC object file. # -# Copyright 2006, 2007 Free Software Foundation, Inc. +# Copyright 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is part of GNU Binutils. # @@ -138,7 +138,7 @@ main () # sections. # Find all _EAR_ symbols in .toe using readelf, sort by address, and # write the address of the corresponding PowerPC symbol in a table - # built in .data.spetoe. For _EAE_ symbols not in .toe, create + # built in .data.spetoe. For _EAR_ symbols not in .toe, create # .reloc commands to relocate their location directly. # 3. Look for R_SPU_PPU32 and R_SPU_PPU64 relocations in the SPU ELF image # and create .reloc commands for them. @@ -202,6 +202,7 @@ $3 ~ /R_SPU_PPU/ { \ print "#else"; \ print " .reloc __speelf__+" strtonum ("0x" $1) + sec_off[rela[sec]] + (substr($3, 10) == "64" ? 4 : 0)", R_PPC_ADDR32, " ($5 != "" ? $5 "+0x" $7 : "__speelf__ + 0x" $4); \ print "#endif"; \ + if (!has_ea && $5 == "") { print "#define HAS_EA 1"; has_ea = 1; }; \ if (!donedef) { print "#define HAS_RELOCS 1"; donedef = 1; }; \ } \ $3 ~ /unrecognized:/ { \ @@ -210,10 +211,13 @@ $3 ~ /unrecognized:/ { \ print "#else"; \ print " .reloc __speelf__+" strtonum ("0x" $1) + sec_off[rela[sec]] + ($4 == "f" ? 4 : 0)", R_PPC_ADDR32, " ($6 != "" ? $6 "+0x" $8 : "__speelf__ + 0x" $5); \ print "#endif"; \ + if (!has_ea && $5 == "") { print "#define HAS_EA 1"; has_ea = 1; }; \ if (!donedef) { print "#define HAS_RELOCS 1"; donedef = 1; }; \ } \ '` -#if defined (HAS_RELOCS) && (defined (__PIC__) || defined (__PIE__)) +#ifdef HAS_EA + .section .data.speelf,"aw",@progbits +#elif defined (HAS_RELOCS) && (defined (__PIC__) || defined (__PIE__)) .section .data.rel.ro.speelf,"a",@progbits #else .section .rodata.speelf,"a",@progbits @@ -222,7 +226,7 @@ $3 ~ /unrecognized:/ { \ __speelf__: .incbin "${INFILE}" - .section .data,"aw",@progbits + .section .data.spehandle,"aw",@progbits .globl ${SYMBOL} .type ${SYMBOL}, @object # fill in a struct spe_program_handle |