This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Fix BZ 19147 -- readelf -n does not print all file mappings in NT_FILE note (off by one)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Sun, 18 Oct 2015 06:07:46 -0700
- Subject: Re: [patch] Fix BZ 19147 -- readelf -n does not print all file mappings in NT_FILE note (off by one)
- Authentication-results: sourceware.org; auth=none
- References: <CALoOobOqj8jBCbZ=-uedPv2BLc_U5C=i-t=tQcQ-Br9GbWkL4A at mail dot gmail dot com>
On Sat, Oct 17, 2015 at 11:14 PM, Paul Pluzhnikov
<ppluzhnikov@google.com> wrote:
> Greetings,
>
> The following trivial patch fixes BZ 19147. Ok to commit?
>
> Thanks,
>
> 2015-10-17 Paul Pluzhnikov <ppluzhnikov@google.com>
>
> PR binutils/19147
> * binutils/readelf.c (print_core_note): Fix off-by-one bug.
>
>
>
>
> diff --git a/binutils/readelf.c b/binutils/readelf.c
> index e8c215d..22cec2c 100644
> --- a/binutils/readelf.c
> +++ b/binutils/readelf.c
> @@ -15151,7 +15151,7 @@ print_core_note (Elf_Internal_Note *pnote)
> (int) (4 + 2 * addr_size), _("End"),
> (int) (4 + 2 * addr_size), _("Page Offset"));
> filenames = descdata + count * 3 * addr_size;
> - while (--count > 0)
> + while (count-- > 0)
> {
> bfd_vma start, end, file_ofs;
>
>
> --
> Paul Pluzhnikov
I think this counts as an obvious fix.
Thanks.
--
H.J.