[PATCH v2 6/8] RISC-V: Rewrite the IFUNC testcases.

Nelson Chu nelson.chu@sifive.com
Tue Aug 11 07:45:26 GMT 2020


On Tue, Aug 11, 2020 at 1:36 PM Fangrui Song <i@maskray.me> wrote:
> I do always see such over generic tests in binutils, which do not test the exact
> addresses ([0-9a-f]*). So, if somewhere made an offset error, the tests could
> not detect such errors at all. I wonder whether the tests can be made more
> specific.
>
> My own experience dealing with LLD testsuite is that exact offsets/addresses are
> really useful.  I know that binutils supports so many configure-time options and
> some may affect section addresses (e.g. --enable-separate-code changes the
> default -z (no)separate-code), so this may not be really addressable.

I think it is a good suggestion.  Maybe using some specific linker
scripts can make them addressable.  I will try it later, thanks.

> >diff --git a/ld/testsuite/ld-riscv-elf/ifunc-nonplt.s b/ld/testsuite/ld-riscv-elf/ifunc-nonplt.s
> >new file mode 100644
> >index 0000000..ce6ca69
> >--- /dev/null
> >+++ b/ld/testsuite/ld-riscv-elf/ifunc-nonplt.s
> >...
> >+.ifdef __64_bit__
> >+      .quad   foo
> >+.else
> >+      .long   foo
> >+.endif
>
> (The undocumented) .dc.a can replace .long/.quad

Cool, I will try this, thanks.

Thanks
Nelson


More information about the Binutils mailing list