[PATCH 1/5 v1] LoongArch: bfd: Add new reloc types.

Xi Ruoyao xry111@xry111.site
Tue Jul 19 04:29:26 GMT 2022


On Mon, 2022-07-18 at 16:43 +0800, liuzhensong wrote:
> @@ -2427,7 +2453,7 @@ loongarch_elf_relocate_section (bfd *output_bfd,
> struct bfd_link_info *info,
>  
>           if (h != NULL)
>             {
> -             off = h->got.offset;
> +             off = h->got.offset & (~1);
>  
>               if (off == MINUS_ONE
>                   && h->type != STT_GNU_IFUNC)
> @@ -2455,79 +2481,76 @@ loongarch_elf_relocate_section (bfd
> *output_bfd, struct bfd_link_info *info,

This cannot be correct: after "off = h->got.offset & (~1)", how could
"off == MINUS_ONE" be true?

Either you calculated "off" wrong, or you should remove the dead code.

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University


More information about the Binutils mailing list