I have built a custom version of glibc. It introduces some new symbols that I use with a custom shared library. For this I add a new version: SHIM
I use gcc -g -o my_test my_test.c -l my_so.so -Wl,-dynamic-linker=/local/home/me/glibc-build/ld-linux-x86-64.so.2 to build a test executable. It needs to use the runtime linker of my custom glibc build so it can link the custom glibc symbols used in my_so.so. This actually works.
But when I use gdb to debug the executable, I find that the default runtime linker is used. I get the following error:
/bin/bash: /lib64/ld-linux-x86-64.so.2: version `SHIM' not found (required by /local/home/me/glibc-build/libc.so.6)
How can I have gdb use my custom runtime linker? I tried to use gdb --args /local/home/me/glibc-build/ld-linux-x86-64.so.2 ./my_test, but I end up with the same error