summaryrefslogtreecommitdiff
path: root/binutils/embedspu.sh
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2008-05-07 14:46:44 +0000
committerAlan Modra <amodra@bigpond.net.au>2008-05-07 14:46:44 +0000
commit8f3885009bb6b58f147f04c8507b175f870a5426 (patch)
tree416c2cf8f194877e2028560cc79cb863d21c811a /binutils/embedspu.sh
parent647f9771e2d1a179888f51c166eb0e7e8d933861 (diff)
downloadbinutils-redhat-8f3885009bb6b58f147f04c8507b175f870a5426.tar.gz
bfd/
* elf32-spu.c (spu_elf_special_sections): Add "._ea". (spu_elf_relocate_section): Handle relocations against symbols defined in ._ea specially. binutils/ * 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". ld/emulparams/ * elf32_spu.sh (OTHER_SECTIONS): Add "._ea". * elf32ppc.sh: If building with spu support, put ".data.spehandle" sections at the start of ".data" and provide a symbol to locate the directory of embedded spe programs. ld/testsuite/ * ld-spu/ear.s: Align various sections. * ld-spu/embed.rd: Update.
Diffstat (limited to 'binutils/embedspu.sh')
-rw-r--r--binutils/embedspu.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/binutils/embedspu.sh b/binutils/embedspu.sh
index d438ed9929..f44d665d3c 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