Binutils/gas/ld port for RISC-V

Palmer Dabbelt
Sat Oct 15 19:30:00 GMT 2016

On Fri, 14 Oct 2016 07:50:07 PDT (-0700), wrote:
> Hi Andrew,
>> We'd like to submit for inclusion in Binutils a port for the RISC-V
>> architecture.
> One other thing that I forgot to mention.  It would be helpful if you
> could add a patch to binutils/readelf.c to add code for this target.
> Specifically I am thinking of updates to these functions:
>   guess_is_rela
>   get_machine_name
>   is_32bit_abs_reloc
>   is_32bit_pcrel_reloc
>   is_none_reloc
> Hmm, also I see that you are using an EM_RISCV ELF machine number, but
> there does not appear to be a patch to include/elf/common.h to add this
> value.  Did I miss something ?

I think I screwed something up when splitting the patches for email, because
it's on my "riscv-master" branch (which contains all our commits merged into
binutils-gdb's master branch), but not on my "riscv-for-upstream" branch (which
has all the patches for a directory merged together).

I see EM_RISCV in all the implementations of those functions:

Good catch!  We're missing a sizeable chunk of the port :).  I'm going to
submit a v2 with your suggestions (and everyone else who has commented).  I'll
try and screw it up less next time!

More information about the Binutils mailing list