Test stepping within a runtime loader / dynamic linker
See the remarks in rtld-step.exp for a description of what this
test is about.
This test case has been tested using gcc on the following x86-64 Linux
distributions/releases:
Fedora 28
Fedora 32
Fedora 33
Fedora 34
Fedora 35
Fedora 36
Fedora 37
rawhide (f38)
RHEL 9.1
Ubuntu 22.04.1 LTS
It's also been tested (and found to be working) with
RUNTESTFLAGS="CC_FOR_TARGET=clang" on all of the above expect for
Fedora 28. The (old) version of clang available on F28 did not
accept the -static-pie option.
I also tried to make this test work on FreeBSD 13.1. While I think I
made significant progress, I was ultimately stymied by this message
which occurs when attempting to run the main program which has been
set to use the fake/pretend RTLD as the ELF interpreter:
ELF interpreter /path/to/rtld-step-rtld not found, error 22
I have left one of the flags (-static) in place which I believe
to be needed for FreeBSD (though since I never got it to work, I
don't know for sure.) I've also left some declarations needed
for FreeBSD in rtld-step-rtld.c. They're currently disabled via
a #if 0; you'll need to enable them if you want to try to make
it work on FreeBSD.