Fix a problem merging empty annobin notes on ppc64le targets.
authorNick Clifton <nickc@redhat.com>
Thu, 18 Feb 2021 11:43:26 +0000 (11:43 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 18 Feb 2021 11:43:26 +0000 (11:43 +0000)
* objcopy.c (merge_gnu_build_notes): Handle notes with a start
address that is higher than the end address.

binutils/ChangeLog
binutils/objcopy.c

index 70ecb0a4263e3a11848cc69ed0d56a3e6a3013bb..fd46001007f8e64868125ae148a330a2c8d39096 100644 (file)
@@ -1,3 +1,8 @@
+2021-02-18  Nick Clifton  <nickc@redhat.com>
+
+       * objcopy.c (merge_gnu_build_notes): Handle notes with a start
+       address that is higher than the end address.
+
 2021-02-17  Alan Modra  <amodra@gmail.com>
 
        * dwarf.c: Include limits.h.
index 0e1047e7482dfe89eaff915cb7d719c4be33233a..54a59430f1b4f2c7c4ac8c2c32ed91b5fc621ff3 100644 (file)
@@ -2275,6 +2275,11 @@ merge_gnu_build_notes (bfd *          abfd,
          goto done;
        }
 
+      if (start > end)
+       /* This can happen with PPC64LE binaries where empty notes are
+          encoded as start = end + 4.  */
+       start = end;
+
       if (is_open_note (pnote))
        {
          if (start)