[2/16][binutils][AARCH64]Add relocation support for large memory model. [LD]Add BFD_RELOC_AARCH64_LD64_GOTOFF_LO15 Support.

Marcus Shawcroft marcus.shawcroft@gmail.com
Tue Sep 8 18:03:00 GMT 2015


On 8 September 2015 at 17:32, Nick Clifton <nickc@redhat.com> wrote:
> Hi Renlin,
>
> +             int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START;
> +             (*_bfd_error_handler)
> +               (_("%B: Local symbol descriptor table be NULL when applying
> "
> +                  "relocation %s against local symbol"),
> +                input_bfd, elfNN_aarch64_howto_table[howto_index].name);
> +             abort ();
>
> I don't like having calls to abort() inside library functions.  You have
> already emitted an error message, so I think that it would be better to set
> the error code and return FALSE.

The text of that error message doesn't read properly, can we fix that to please?

>
>
> +                 /* For local symbol, we have done absolute relocation in
> static
> +                    linking stage.  While for share library, we need to
> update
> +                    the content of GOT entry according to the share objects
> +                    loading base address.  So we need to generate a
> +                    R_AARCH64_RELATIVE reloc for dynamic linker.  */
> +                 s = globals->root.srelgot;
> +                 if (s == NULL)
> +                   abort ();


This is checking internal consistency, the existing practice both here
and in _bfd_final_link_relocate which it wraps is to handle internal
inconsistency with an abort(), so this part of the proposed patch
seems to me to be consistent with existing practice.

If we  move away from the use of abort() for such internal consistency
issues I wonder which bfd_error_* code should be used, none of them
look like a good fit?

Cheers
/Marcus



More information about the Binutils mailing list