Mention PR ld/4701.
[deliverable/binutils-gdb.git] / binutils / embedspu.sh
index 49776b00d7698249f943d2aaf8e9fb1278f2d5bf..6611172814e62a9d58692c7d705a3579eeab006c 100644 (file)
@@ -124,7 +124,7 @@ main ()
   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.
@@ -198,17 +198,17 @@ $7 != "'${toe}'" && ! $7 in sec_off { \
 } \
 $3 ~ /R_SPU_PPU/ { \
        print "#ifdef _LP64"; \
-       print " .reloc __speelf__+" strtonum ("0x" $1) + sec_off[rela[sec]] ", R_PPC64_ADDR" substr($3, 10) ", " $5 "+0x" $7; \
+       print " .reloc __speelf__+" strtonum ("0x" $1) + sec_off[rela[sec]] ", R_PPC64_ADDR" substr($3, 10) ", " ($5 != "" ? $5 "+0x" $7 : "__speelf__ + 0x" $4); \
        print "#else"; \
-       print " .reloc __speelf__+" strtonum ("0x" $1) + sec_off[rela[sec]] + (substr($3, 10) == "64" ? 4 : 0)", R_PPC_ADDR32, " $5 "+0x" $7; \
+       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 (!donedef) { print "#define HAS_RELOCS 1"; donedef = 1; }; \
 } \
 $3 ~ /unrecognized:/ { \
        print "#ifdef _LP64"; \
-       print " .reloc __speelf__+" strtonum ("0x" $1) + sec_off[rela[sec]] ", R_PPC64_ADDR" ($4 == "f" ? "64" : "32") ", " $6 "+0x" $8; \
+       print " .reloc __speelf__+" strtonum ("0x" $1) + sec_off[rela[sec]] ", R_PPC64_ADDR" ($4 == "f" ? "64" : "32") ", " ($6 != "" ? $6 "+0x" $8 : "__speelf__ + 0x" $5); \
        print "#else"; \
-       print " .reloc __speelf__+" strtonum ("0x" $1) + sec_off[rela[sec]] + ($4 == "f" ? 4 : 0)", R_PPC_ADDR32, " $6 "+0x" $8; \
+       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 (!donedef) { print "#define HAS_RELOCS 1"; donedef = 1; }; \
 } \
@@ -248,7 +248,7 @@ ${SYMBOL}:
        print " .type '${SYMBOL}'_" substr($8, 9) ", @object"; \
        print " .size '${SYMBOL}'_" substr($8, 9) ", 4"; \
        print "'${SYMBOL}'_" substr($8, 9) ":"; \
-       print " .int " $2; \
+       print " .int 0x" $2; \
 } \
 '`
 EOF
This page took 0.057865 seconds and 4 git commands to generate.