X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=binutils%2Fembedspu.sh;h=82eb6e92d882a700c1e75879dd0aa465260406dc;hb=bd30b2c856c9ae1fc3559d80fc8c8ccdf65e5fce;hp=b7b6620321c520cdc15bc095627c178a6c31f2eb;hpb=dbdca70b82b81c3262b697fcf5c8d8378b2f905a;p=platform%2Fupstream%2Fbinutils.git diff --git a/binutils/embedspu.sh b/binutils/embedspu.sh index b7b6620..82eb6e9 100644 --- a/binutils/embedspu.sh +++ b/binutils/embedspu.sh @@ -1,13 +1,13 @@ #! /bin/sh # Embed an SPU ELF executable into a PowerPC object file. # -# Copyright 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is part of GNU Binutils. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, @@ -119,12 +119,13 @@ main () toe=`${READELF} -S ${INFILE} | sed -n -e 's, *\[ *\([0-9]*\)\] *\.toe *[PROGN]*BITS *\([0-9a-f]*\).*,\1 \2,p'` toe_addr=`echo $toe | sed -n -e 's,.* ,,p'` toe=`echo $toe | sed -n -e 's, .*,,p'` + has_ea=`${READELF} -S ${INFILE} | sed -n -e 's, *\[ *\([0-9]*\)\] *\._ea *PROGBITS.*,\1,p'` # For loaded sections, pick off section number, address, and file offset sections=`${READELF} -S ${INFILE} | sed -n -e 's, *\[ *\([0-9]*\)\] *[^ ]* *PROGBITS *\([0-9a-f]*\) *\([0-9a-f]*\).*,\1 \2 \3,p'` sections=`echo ${sections}` # For relocation sections, pick off file offset and info (points to # section where relocs apply) - relas=`${READELF} -S ${INFILE} | sed -n -e 's, *\[ *[0-9]*\] *[^ ]* *RELA *[0-9a-f]* *0*\([0-9a-f][0-9a-f]*\) .*\([0-9a-f][0-9a-f]*\) *[0-9a-f][0-9a-f]*$,\1 \2,p'` + relas=`${READELF} -S ${INFILE} | sed -n -e 's, *\[ *[0-9]*\] *[^ ]* *RELA *[0-9a-f]* *0*\([0-9a-f][0-9a-f]*\).* \([0-9a-f][0-9a-f]*\) *[0-9a-f][0-9a-f]*$,\1 \2,p'` relas=`echo ${relas}` # Build embedded SPU image. @@ -138,20 +139,20 @@ 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. # 4. Write a struct spe_program_handle to .data. # 5. Write a table of _SPUEAR_ symbols. ${CC} ${FLAGS} -x assembler-with-cpp -nostartfiles -nostdlib \ - -Wa,-mbig -Wl,-r -Wl,-x -o ${OUTFILE} - <