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