[PATCH] MIPS: support PCREL GOT access
Nick Clifton
nickc@redhat.com
Mon Feb 5 11:48:02 GMT 2024
Hi YunQiang,
> Any idea how to write ld testcases?
> Normal readelf/objdump can only be sure that it is linked.
> I think that we need to execute the out objects to be sure that it has no
> problems, such as segfault etc.
You can use the [isnative] test to check to see if the test
is being run natively and then try executing the linked code.
For example in ld/testsuite/ld-elf/shared.exp there is the
following code to run a linked executable as part of the
mix_pic_and_non_pic procedure:
if ![isnative] {
unsupported "Run $exe fun undefined"
return
}
set exec_output [run_host_cmd "tmpdir/$exe" ""]
if {![string match "PASS" $exec_output]} {
fail "Run $exe fun undefined"
} else {
pass "Run $exe fun undefined"
}
Cheers
Nick
More information about the Binutils
mailing list