[PATCH] ARM: Fix elf32_arm_count_additional_relocs

Renlin Li renlin.li@foss.arm.com
Thu Sep 22 08:36:00 GMT 2016


Hi there,

get_arm_section_data () could return NULL in some cases. It would be 
great if you give some explanations or provide a test case which this 
can be triggered.

BTW you need to have a ChangeLog for the patch as well. You can find 
examples from other patch emails.

CCed ARM target maintainer: Nick and Richard.

Regards,
Renlin

On 22/09/16 02:52, Akihiko Odaki wrote:
> ---
>   bfd/elf32-arm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
> index 3d4a458..5041dab 100644
> --- a/bfd/elf32-arm.c
> +++ b/bfd/elf32-arm.c
> @@ -18172,7 +18172,7 @@ elf32_arm_count_additional_relocs (asection *sec)
>   {
>     struct _arm_elf_section_data *arm_data;
>     arm_data = get_arm_elf_section_data (sec);
> -  return arm_data->additional_reloc_count;
> +  return arm_data ? arm_data->additional_reloc_count : 0;
>   }
>
>   /* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which
>



More information about the Binutils mailing list