gdb/testsuite: handle dynamic linker path with symlink in dlmopen tests

On my Arch Linux system*, the dynamic linker path specified in ELF
binaries contains a symlink:

    $ readelf --program-headers /bin/ls | grep "Requesting program interpreter"
          [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
    $ ls -l /lib64
    lrwxrwxrwx 1 root root 7 May  3 15:26 /lib64 -> usr/lib
    $ realpath /lib64/ld-linux-x86-64.so.2
    /usr/lib/ld-linux-x86-64.so.2

Because of this, some dlmopen tests think that the dynamic linker
doesn't appear multiple times, when it in fact does (under two different
names), and some parts of the test are disabled:

    UNSUPPORTED: gdb.base/dlmopen.exp: test_solib_unmap_events: multiple copies of the dynamic linker not found

Make the tests compute the real path of the dynamic linker and accept
that as valid path for the dynamic linker.

With this patch, I go from

    # of expected passes            92

to

    # of expected passes            98

* On my Ubuntu 24.04 system, the dynamic linker appears to be a symlink
  too, but the glibc is too old to show the dynamic linker in the
  non-default namespace.

Change-Id: I03867f40e5313816bd8a8401b65713ddef5d620e
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
2 files changed