[PATCH] backends: add abi_cfi and register_info callbacks for RISC-V

Mark Wielaard mark@klomp.org
Wed Jun 20 11:16:00 GMT 2018


Hi Andreas,

On Mon, 2018-06-18 at 09:59 +0200, Andreas Schwab wrote:
> On Jun 15 2018, Mark Wielaard <mark@klomp.org> wrote:
> 
> > How does the result of make check look now on a native riscv
> > system?
> 
> FAIL: run-native-test.sh
> 
> return_value_location is missing

Sadly DWARF doesn't describe how return values are passed back. So
you'll have to write that by hand for the abi. It normally isn't that
hard for scalar types, sometimes there is some trickery for floats or
small structs.

> FAIL: run-low_high_pc.sh
> 
> lowpc: 220, highpc: 220lx
> ../../elfutils/src/size.c: [c84] 'handle_elf' highpc <= lowpc
> 
> lowpc: 41c, highpc: 41clx
> ../../elfutils/src/strip.c: [1c00] 'update_section_size' highpc <=
> lowpc

That is odd. For which testfile is this? Is it for a native (self test)
file? If it is for an ET_REL object file it might be that we don't
handle all relocations correctly. If you could post the file somewhere,
that might be helpful to track down the issue.

> FAIL: run-backtrace-native.sh
> FAIL: run-backtrace-dwarf.sh
> FAIL: run-deleted.sh
> 
> set_initial_registers_tid is missing

If the target has ptrace support this probably wouldn't be too hard to
get going.

> FAIL: run-backtrace-native-core.sh
> 
> no corefile support

That would need a corenote backend implementation.

> SKIP: run-backtrace-data.sh
> 
> no unwinding support

That is expected. It really is an architecture specific (x86_64) test.

> > Could you provide a testcase for tests/run-allregs.sn and/or
> > tests/run-addrcfi.sh if possible so people can check things work on
> > other arches?
> > 
> > If this is enough to actually unwind could you look at providing an
> > tests/run-backtrace-core-riscv.sh testcase (the existing ones
> > should
> > explain how to generate the (static) executable and core file for
> > the
> > test, but if it is unclear please ask.
> 
> I will work on these.

Thanks. Without tests it is hard to know if an arch is really fully
functional and it risks bit-rotting.

I have added a ChangeLog entry for your patch and pushed it to master.

Cheers,

Mark



More information about the Elfutils-devel mailing list