Make asection->id and asection->index unsigned

Andreas Schwab schwab@suse.de
Mon Aug 31 10:12:00 GMT 2015


Alan Modra <amodra@gmail.com> writes:

> diff --git a/bfd/elflink.c b/bfd/elflink.c
> index 192ce15..4f86700 100644
> --- a/bfd/elflink.c
> +++ b/bfd/elflink.c
> @@ -3247,7 +3247,7 @@ elf_sort_symbol (const void *arg1, const void *arg2)
>      return vdiff > 0 ? 1 : -1;
>    else
>      {
> -      long sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id;
> +      int sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id;

Can this overflow?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



More information about the Binutils mailing list