This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] RISC-V: Resurrect GP-relative disassembly hints
- From: Nick Clifton <nickc at redhat dot com>
- To: Palmer Dabbelt <palmer at dabbelt dot com>, binutils at sourceware dot org
- Date: Mon, 3 Apr 2017 10:37:58 +0100
- Subject: Re: [PATCH] RISC-V: Resurrect GP-relative disassembly hints
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=nickc at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0DD247E9C3
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0DD247E9C3
- References: <20170331231722.20886-1-palmer@dabbelt.com>
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