diff options
author | Kevin Buettner <kevinb@redhat.com> | 2023-09-21 17:58:05 -0700 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2023-09-28 18:46:04 -0700 |
commit | 3ec033fab4ac2e6289b5928f949e054ff89e8ae8 (patch) | |
tree | 90636fe5cccaf5d54fc38970c5cd0bcbfb81369e /gdb/bt-utils.c | |
parent | fb908c299d5497a28d7e319c21d366989cfa7743 (diff) | |
download | gdb-3ec033fab4ac2e6289b5928f949e054ff89e8ae8.zip gdb-3ec033fab4ac2e6289b5928f949e054ff89e8ae8.tar.gz gdb-3ec033fab4ac2e6289b5928f949e054ff89e8ae8.tar.bz2 |
gdb/testsuite: Add relative versus absolute LD_LIBRARY_PATH test
At one time, circa 2006, there was a bug, which was presumably fixed
without adding a test case:
If you provided some relative path to the shared library, such as
with
export LD_LIBRARY_PATH=.
then gdb would fail to match the shared library name during the
TLS lookup.
I think there may have been a bit more to it than is provided by that
explanation, since the test also takes care to split the debug info
into a separate file.
In any case, this commit is based on one of Red Hat's really old
local patches. I've attempted to update it and remove a fair amount
of cruft, hopefully without losing any critical elements from the
test.
Testing on Fedora 38 (correctly) shows 1 unsupported test for
native-gdbserver and 5 PASSes for the native target as well as
native-extended-gdbserver.
In his review of v1 of this patch, Lancelot SIX observed that
'thread_local' could be used in place of '__thread' in the C source
files. But it only became available via the standard in C11, so I
used additional_flags=-std=c11 for compiling both the shared object
and the main program.
Also, while testing with CC_FOR_TARGET=clang, I found that
'additional_flags=-Wl,-soname=${binsharedbase}' caused clang
to complain that this linker flag was unused when compiling
the source file, so I moved this linker option to 'ldflags='.
My testing for this v2 patch shows the same results as with v1,
but I've done additional testing with CC_FOR_TARGET=clang as
well. The results are the same as when gcc is used.
Co-Authored-by: Jan Kratochvil <jan@jankratochvil.net>
Reviewed-By: Lancelot Six <lancelot.six@amd.com>
Diffstat (limited to 'gdb/bt-utils.c')
0 files changed, 0 insertions, 0 deletions