This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] RISC-V: Resurrect GP-relative disassembly hints


Hi Palmer,

> --- a/opcodes/riscv-dis.c
> +++ b/opcodes/riscv-dis.c
> @@ -384,7 +384,7 @@ riscv_disassemble_insn (bfd_vma memaddr, insn_t word, disassemble_info *info)
>  	pd->hi_addr[i] = -1;
>  
>        for (i = 0; i < info->symtab_size; i++)
> -	if (strcmp (bfd_asymbol_name (info->symtab[i]), "_gp") == 0)
> +	if (strcmp (bfd_asymbol_name (info->symtab[i]), "__global_pointer$") == 0)
>  	  pd->gp = bfd_asymbol_value (info->symtab[i]);
>      }
>    else

Wouldn't it be better to use the GP_NAME define value ?  (Currently in bfd/elfnn-risc.c,
but it ought to be moved into a header file, eg include/elf/riscv.h).

Cheers
  Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]