Blame SOURCES/binutils-ppc64le-note-merge.patch
|
|
5be97c |
--- binutils.orig/binutils/objcopy.c 2021-02-18 11:35:48.062479490 +0000
|
|
|
5be97c |
+++ binutils-2.30/binutils/objcopy.c 2021-02-18 11:36:52.207071148 +0000
|
|
|
5be97c |
@@ -2224,6 +2224,11 @@ merge_gnu_build_notes (bfd * ab
|
|
|
5be97c |
goto done;
|
|
|
5be97c |
}
|
|
|
5be97c |
|
|
|
5be97c |
+ if (start > end)
|
|
|
5be97c |
+ /* This can happen with PPC64LE binaries where empty notes are
|
|
|
5be97c |
+ encoded as start = end + 4. */
|
|
|
5be97c |
+ start = end;
|
|
|
5be97c |
+
|
|
|
5be97c |
if (is_open_note (pnote))
|
|
|
5be97c |
{
|
|
|
5be97c |
if (start)
|
|
|
5be97c |
--- binutils.orig/binutils/objcopy.c 2021-02-22 10:36:15.710374328 +0000
|
|
|
5be97c |
+++ binutils-2.36.1/binutils/objcopy.c 2021-02-22 16:47:11.702344502 +0000
|
|
|
5be97c |
@@ -2246,23 +2246,8 @@ merge_gnu_build_notes (bfd * ab
|
|
|
5be97c |
break;
|
|
|
5be97c |
|
|
|
5be97c |
case 8:
|
|
|
5be97c |
- if (! is_64bit (abfd))
|
|
|
5be97c |
- {
|
|
|
5be97c |
- start = bfd_get_32 (abfd, pnote->note.descdata);
|
|
|
5be97c |
- end = bfd_get_32 (abfd, pnote->note.descdata + 4);
|
|
|
5be97c |
- }
|
|
|
5be97c |
- else
|
|
|
5be97c |
- {
|
|
|
5be97c |
- start = bfd_get_64 (abfd, pnote->note.descdata);
|
|
|
5be97c |
- /* FIXME: For version 1 and 2 notes we should try to
|
|
|
5be97c |
- calculate the end address by finding a symbol whose
|
|
|
5be97c |
- value is START, and then adding in its size.
|
|
|
5be97c |
-
|
|
|
5be97c |
- For now though, since v1 and v2 was not intended to
|
|
|
5be97c |
- handle gaps, we chose an artificially large end
|
|
|
5be97c |
- address. */
|
|
|
5be97c |
- end = (bfd_vma) -1;
|
|
|
5be97c |
- }
|
|
|
5be97c |
+ start = bfd_get_32 (abfd, pnote->note.descdata);
|
|
|
5be97c |
+ end = bfd_get_32 (abfd, pnote->note.descdata + 4);
|
|
|
5be97c |
break;
|
|
|
5be97c |
|
|
|
5be97c |
case 16:
|