From patchwork Thu Feb 18 11:43:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Commit: Fix merging empty ppc64le notes X-Patchwork-Submitter: Andreas Krebbel via Binutils X-Patchwork-Id: 49289 Message-Id: <87v9apsist.fsf@redhat.com> To: binutils@sourceware.org Date: Thu, 18 Feb 2021 11:43:14 +0000 From: Nick Clifton via Binutils List-Id: Binutils mailing list Hi Guys, I am applying the patch below to fix a problem merging empty PowerPC annobin notes, which can have a start address higher than the end address. Cheers Nick binutils/ChangeLog 2021-02-18 Nick Clifton * objcopy.c (merge_gnu_build_notes): Handle notes with a start address that is higher than the end address. diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 0e1047e748..54a59430f1 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -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)