[binutils-gdb] Revert "ARM STM32L4XX erratum test failure"

Alan Modra amodra@sourceware.org
Thu May 16 13:08:00 GMT 2019


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a2699ef206aedf8e8d49d8519ae8a535e4b4afe5

commit a2699ef206aedf8e8d49d8519ae8a535e4b4afe5
Author: Alan Modra <amodra@gmail.com>
Date:   Thu May 16 22:35:25 2019 +0930

    Revert "ARM STM32L4XX erratum test failure"
    
    This reverts commit 3a1bb98c3c4f983b950fbaf2797ddcd21fcb5211.

Diff:
---
 bfd/ChangeLog   | 4 ++++
 bfd/elf32-arm.c | 9 +++------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 22a69fb..e3729bb 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2019-05-16  Alan Modra  <amodra@gmail.com>
+
+	* elf32-arm.c (elf32_arm_write_section): Revert last change.
+
 2019-05-15  Alan Modra  <amodra@gmail.com>
 
 	* elf32-arm.c (elf32_arm_write_section): Don't leave
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index a8d5701..337961d 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -19693,9 +19693,6 @@ elf32_arm_write_section (bfd *output_bfd,
 		bfd_vma branch_to_veneer =
 		  stm32l4xx_errnode->u.b.veneer->vma - stm32l4xx_errnode->vma;
 
-		/* The instruction is before the label.  */
-		target -= 4;
-
 		if ((signed) branch_to_veneer < -(1 << 24)
 		    || (signed) branch_to_veneer >= (1 << 24))
 		  {
@@ -19713,15 +19710,15 @@ elf32_arm_write_section (bfd *output_bfd,
 		       output_bfd,
 		       (uint64_t) (stm32l4xx_errnode->vma - 4),
 		       (int64_t) out_of_range);
-
-		    /* Don't leave contents uninitialised.  */
-		    bfd_put_16 (output_bfd, 0, contents + target);
 		    continue;
 		  }
 
 		insn = create_instruction_branch_absolute
 		  (stm32l4xx_errnode->u.b.veneer->vma - stm32l4xx_errnode->vma);
 
+		/* The instruction is before the label.  */
+		target -= 4;
+
 		put_thumb2_insn (globals, output_bfd,
 				 (bfd_vma) insn, contents + target);
 	      }



More information about the Binutils-cvs mailing list