Start mass upgrade
[dragora.git] / patches / binutils / 2.35 / binutils-ppc64le-note-merge.patch
blob95f64015268b525bd7a10217a096dc199e68b668
1 --- binutils.orig/binutils/objcopy.c 2021-02-18 11:35:48.062479490 +0000
2 +++ binutils-2.30/binutils/objcopy.c 2021-02-18 11:36:52.207071148 +0000
3 @@ -2224,6 +2224,11 @@ merge_gnu_build_notes (bfd * ab
4 goto done;
7 + if (start > end)
8 + /* This can happen with PPC64LE binaries where empty notes are
9 + encoded as start = end + 4. */
10 + start = end;
12 if (is_open_note (pnote))
14 if (start)
15 --- binutils.orig/binutils/objcopy.c 2021-02-22 10:44:20.107263089 +0000
16 +++ binutils-2.35.1/binutils/objcopy.c 2021-02-22 16:07:12.134344229 +0000
17 @@ -2243,23 +2243,8 @@ merge_gnu_build_notes (bfd * ab
18 break;
20 case 8:
21 - if (! is_64bit (abfd))
22 - {
23 - start = bfd_get_32 (abfd, pnote->note.descdata);
24 - end = bfd_get_32 (abfd, pnote->note.descdata + 4);
25 - }
26 - else
27 - {
28 - start = bfd_get_64 (abfd, pnote->note.descdata);
29 - /* FIXME: For version 1 and 2 notes we should try to
30 - calculate the end address by finding a symbol whose
31 - value is START, and then adding in its size.
33 - For now though, since v1 and v2 was not intended to
34 - handle gaps, we chose an artificially large end
35 - address. */
36 - end = (bfd_vma) -1;
37 - }
38 + start = bfd_get_32 (abfd, pnote->note.descdata);
39 + end = bfd_get_32 (abfd, pnote->note.descdata + 4);
40 break;
42 case 16: