From 8374f9d4b51c7bb4464875756b1a4b4e9ce742f0 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 7 May 2008 14:46:44 +0000 Subject: 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. --- binutils/embedspu.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'binutils/embedspu.sh') diff --git a/binutils/embedspu.sh b/binutils/embedspu.sh index d438ed99298..f44d665d3c2 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 -- cgit v1.2.1