mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 14:39:09 +08:00
Fix overflow handling of VLE_SDA21
bfd/ * elf32-ppc.c (ppc_elf_relocate_section): Correct overflow handling for VLE_SDA21 relocs. ld/testsuite/ * ld-powerpc/vle.ld: Place .PPC.EMB.sdata0 within 32k of 0. * ld-powerpc/vle-reloc-3.d: Update.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2014-03-14 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* elf32-ppc.c (ppc_elf_relocate_section): Correct overflow
|
||||||
|
handling for VLE_SDA21 relocs.
|
||||||
|
|
||||||
2014-03-13 Tristan Gingold <gingold@adacore.com>
|
2014-03-13 Tristan Gingold <gingold@adacore.com>
|
||||||
|
|
||||||
* peicode.h (pe_ILF_object_p): Adjust, as the version number
|
* peicode.h (pe_ILF_object_p): Adjust, as the version number
|
||||||
|
@ -8859,11 +8859,12 @@ ppc_elf_relocate_section (bfd *output_bfd,
|
|||||||
/* And the final 11 bits of the value to bits 21 to 31. */
|
/* And the final 11 bits of the value to bits 21 to 31. */
|
||||||
insn |= relocation & 0x7ff;
|
insn |= relocation & 0x7ff;
|
||||||
|
|
||||||
/* Use _bfd_final_link_relocate to report overflow,
|
bfd_put_32 (output_bfd, insn, contents + rel->r_offset);
|
||||||
but do so with a value that won't modify the insn. */
|
|
||||||
if (relocation + 0x80000 > 0x100000)
|
if (r_type == R_PPC_VLE_SDA21
|
||||||
addend = 0x100000;
|
&& ((relocation + 0x80000) & 0xffffffff) > 0x100000)
|
||||||
relocation = 0;
|
goto overflow;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else if (r_type == R_PPC_EMB_SDA21
|
else if (r_type == R_PPC_EMB_SDA21
|
||||||
|| r_type == R_PPC_VLE_SDA21
|
|| r_type == R_PPC_VLE_SDA21
|
||||||
@ -9160,6 +9161,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
|
|||||||
{
|
{
|
||||||
if (r == bfd_reloc_overflow)
|
if (r == bfd_reloc_overflow)
|
||||||
{
|
{
|
||||||
|
overflow:
|
||||||
if (warned)
|
if (warned)
|
||||||
continue;
|
continue;
|
||||||
if (h != NULL
|
if (h != NULL
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2014-03-14 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* ld-powerpc/vle.ld: Place .PPC.EMB.sdata0 within 32k of 0.
|
||||||
|
* ld-powerpc/vle-reloc-3.d: Update.
|
||||||
|
|
||||||
2014-03-06 Roland McGrath <mcgrathr@google.com>
|
2014-03-06 Roland McGrath <mcgrathr@google.com>
|
||||||
|
|
||||||
* ld-arm/gc-hidden-1.d: Remove target, add not-target to match
|
* ld-arm/gc-hidden-1.d: Remove target, add not-target to match
|
||||||
|
@ -5,4 +5,4 @@ Disassembly of section .text:
|
|||||||
01800094 <sda21_test>:
|
01800094 <sda21_test>:
|
||||||
1800094: 1c ad 80 08 e_add16i r5,r13,-32760
|
1800094: 1c ad 80 08 e_add16i r5,r13,-32760
|
||||||
1800098: 1c a2 80 04 e_add16i r5,r2,-32764
|
1800098: 1c a2 80 04 e_add16i r5,r2,-32764
|
||||||
180009c: 70 00 00 ac e_li r0,172
|
180009c: 70 b0 78 04 e_li r5,-32764
|
||||||
|
@ -2,10 +2,11 @@ SECTIONS
|
|||||||
{
|
{
|
||||||
. = 0x01800000 + SIZEOF_HEADERS;
|
. = 0x01800000 + SIZEOF_HEADERS;
|
||||||
.text : { *(.text) }
|
.text : { *(.text) }
|
||||||
.PPC.EMB.sdata0 : { *(.PPC.EMB.sdata0) }
|
|
||||||
.sdata2 : { PROVIDE (_SDA2_BASE_ = 32768); *(.sdata2) }
|
.sdata2 : { PROVIDE (_SDA2_BASE_ = 32768); *(.sdata2) }
|
||||||
. = ALIGN (0x10000) + (. & (0x10000 - 1));
|
. = ALIGN (0x10000) + (. & (0x10000 - 1));
|
||||||
.data : { *(.data) }
|
.data : { *(.data) }
|
||||||
.sdata : { PROVIDE (_SDA_BASE_ = 32768); *(.sdata) }
|
.sdata : { PROVIDE (_SDA_BASE_ = 32768); *(.sdata) }
|
||||||
|
. = 0xffff8000;
|
||||||
|
.PPC.EMB.sdata0 : { *(.PPC.EMB.sdata0) }
|
||||||
/DISCARD/ : { *(*) }
|
/DISCARD/ : { *(*) }
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user