Hello community,

here is the log from the commit of package binutils for openSUSE:Factory 
checked in at 2018-03-12 12:02:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/binutils (Old)
 and      /work/SRC/openSUSE:Factory/.binutils.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "binutils"

Mon Mar 12 12:02:40 2018 rev:125 rq:585020 version:2.30

Changes:
--------
--- /work/SRC/openSUSE:Factory/binutils/binutils.changes        2018-03-08 
10:40:55.737131484 +0100
+++ /work/SRC/openSUSE:Factory/.binutils.new/binutils.changes   2018-03-12 
12:02:46.454695142 +0100
@@ -1,0 +2,5 @@
+Thu Mar  8 11:33:31 UTC 2018 - [email protected]
+
+- riscv-relax-size.patch: Fix symbol size bug when relaxation deletes bytes
+
+-------------------------------------------------------------------
cross-aarch64-binutils.changes: same change
cross-arm-binutils.changes: same change
cross-avr-binutils.changes: same change
cross-epiphany-binutils.changes: same change
cross-hppa-binutils.changes: same change
cross-hppa64-binutils.changes: same change
cross-i386-binutils.changes: same change
cross-ia64-binutils.changes: same change
cross-m68k-binutils.changes: same change
cross-mips-binutils.changes: same change
cross-ppc-binutils.changes: same change
cross-ppc64-binutils.changes: same change
cross-ppc64le-binutils.changes: same change
cross-riscv64-binutils.changes: same change
cross-rx-binutils.changes: same change
cross-s390-binutils.changes: same change
cross-s390x-binutils.changes: same change
cross-sparc-binutils.changes: same change
cross-sparc64-binutils.changes: same change
cross-spu-binutils.changes: same change
cross-x86_64-binutils.changes: same change

New:
----
  riscv-relax-size.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ binutils.spec ++++++
--- /var/tmp/diff_new_pack.9kf4Xg/_old  2018-03-12 12:02:56.718327324 +0100
+++ /var/tmp/diff_new_pack.9kf4Xg/_new  2018-03-12 12:02:56.722327181 +0100
@@ -94,6 +94,7 @@
 Patch34:        aarch64-common-pagesize.patch
 Patch35:        riscv-wrap-relax.patch
 Patch36:        binutils-pr22868.diff
+Patch37:        riscv-relax-size.patch
 Patch90:        cross-avr-nesc-as.patch
 Patch92:        cross-avr-omit_section_dynsym.patch
 Patch93:        cross-avr-size.patch
@@ -165,6 +166,7 @@
 %patch34 -p1
 %patch35 -p1
 %patch36 -p1
+%patch37 -p1
 %if "%{TARGET}" == "avr"
 cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
 %patch90

++++++ cross-aarch64-binutils.spec ++++++
--- /var/tmp/diff_new_pack.9kf4Xg/_old  2018-03-12 12:02:56.742326464 +0100
+++ /var/tmp/diff_new_pack.9kf4Xg/_new  2018-03-12 12:02:56.746326321 +0100
@@ -97,6 +97,7 @@
 Patch34:        aarch64-common-pagesize.patch
 Patch35:        riscv-wrap-relax.patch
 Patch36:        binutils-pr22868.diff
+Patch37:        riscv-relax-size.patch
 Patch90:        cross-avr-nesc-as.patch
 Patch92:        cross-avr-omit_section_dynsym.patch
 Patch93:        cross-avr-size.patch
@@ -168,6 +169,7 @@
 %patch34 -p1
 %patch35 -p1
 %patch36 -p1
+%patch37 -p1
 %if "%{TARGET}" == "avr"
 cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
 %patch90

cross-arm-binutils.spec: same change
cross-avr-binutils.spec: same change
cross-epiphany-binutils.spec: same change
cross-hppa-binutils.spec: same change
cross-hppa64-binutils.spec: same change
cross-i386-binutils.spec: same change
cross-ia64-binutils.spec: same change
cross-m68k-binutils.spec: same change
cross-mips-binutils.spec: same change
cross-ppc-binutils.spec: same change
cross-ppc64-binutils.spec: same change
cross-ppc64le-binutils.spec: same change
cross-riscv64-binutils.spec: same change
cross-rx-binutils.spec: same change
cross-s390-binutils.spec: same change
cross-s390x-binutils.spec: same change
cross-sparc-binutils.spec: same change
cross-sparc64-binutils.spec: same change
cross-spu-binutils.spec: same change
cross-x86_64-binutils.spec: same change
++++++ riscv-relax-size.patch ++++++
2018-03-01  Jim Wilson  <[email protected]>

        PR 22756
        * elfnn-riscv.c (riscv_relax_delete_bytes): When adjust st_size, use
        else if instead of if.

Index: binutils-2.30/bfd/elfnn-riscv.c
===================================================================
--- binutils-2.30.orig/bfd/elfnn-riscv.c
+++ binutils-2.30/bfd/elfnn-riscv.c
@@ -2639,10 +2639,16 @@ riscv_relax_delete_bytes (bfd *abfd, ase
 
          /* If the symbol *spans* the bytes we just deleted (i.e. its
             *end* is in the moved bytes but its *start* isn't), then we
-            must adjust its size.  */
-         if (sym->st_value <= addr
-             && sym->st_value + sym->st_size > addr
-             && sym->st_value + sym->st_size <= toaddr)
+            must adjust its size.
+
+            This test needs to use the original value of st_value, otherwise
+            we might accidentally decrease size when deleting bytes right
+            before the symbol.  But since deleted relocs can't span across
+            symbols, we can't have both a st_value and a st_size decrease,
+            so it is simpler to just use an else.  */
+         else if (sym->st_value <= addr
+                  && sym->st_value + sym->st_size > addr
+                  && sym->st_value + sym->st_size <= toaddr)
            sym->st_size -= count;
        }
     }
@@ -2690,9 +2696,9 @@ riscv_relax_delete_bytes (bfd *abfd, ase
            sym_hash->root.u.def.value -= count;
 
          /* As above, adjust the size if needed.  */
-         if (sym_hash->root.u.def.value <= addr
-             && sym_hash->root.u.def.value + sym_hash->size > addr
-             && sym_hash->root.u.def.value + sym_hash->size <= toaddr)
+         else if (sym_hash->root.u.def.value <= addr
+                  && sym_hash->root.u.def.value + sym_hash->size > addr
+                  && sym_hash->root.u.def.value + sym_hash->size <= toaddr)
            sym_hash->size -= count;
        }
     }

Reply via email to