1 If you provided some relative path to the shared library, such as with
2 export LD_LIBRARY_PATH=.
3 then gdb would fail to match the shared library name during the TLS lookup.
6 Dropped the workaround/fix for gdb-6.8.50.20081128 - is it still needed?
9 The testsuite needs `gdb-6.3-bz146810-solib_absolute_prefix_is_empty.patch'.
10 The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'.
13 2006-09-01 Jan Kratochvil <jan.kratochvil@redhat.com>
15 * solib-svr4.c (svr4_fetch_objfile_link_map): Match even absolute
16 requested pathnames to the internal loaded relative pathnames.
18 2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
22 2008-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
24 Port to gdb-6.7.50.20080227.
26 Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
27 ===================================================================
28 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
29 +++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-main.c 2008-02-27 09:00:15.000000000 +0100
31 +/* This testcase is part of GDB, the GNU debugger.
33 + Copyright 2006 Free Software Foundation, Inc.
35 + This program is free software; you can redistribute it and/or modify
36 + it under the terms of the GNU General Public License as published by
37 + the Free Software Foundation; either version 2 of the License, or
38 + (at your option) any later version.
40 + This program is distributed in the hope that it will be useful,
41 + but WITHOUT ANY WARRANTY; without even the implied warranty of
42 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43 + GNU General Public License for more details.
45 + You should have received a copy of the GNU General Public License
46 + along with this program; if not, write to the Free Software
47 + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
49 + Please email any bugs, comments, and/or additions to this file to:
50 + bug-gdb@prep.ai.mit.edu */
56 Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
57 ===================================================================
58 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
59 +++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c 2008-02-27 09:00:15.000000000 +0100
61 +/* This testcase is part of GDB, the GNU debugger.
63 + Copyright 2006 Free Software Foundation, Inc.
65 + This program is free software; you can redistribute it and/or modify
66 + it under the terms of the GNU General Public License as published by
67 + the Free Software Foundation; either version 2 of the License, or
68 + (at your option) any later version.
70 + This program is distributed in the hope that it will be useful,
71 + but WITHOUT ANY WARRANTY; without even the implied warranty of
72 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
73 + GNU General Public License for more details.
75 + You should have received a copy of the GNU General Public License
76 + along with this program; if not, write to the Free Software
77 + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
79 + Please email any bugs, comments, and/or additions to this file to:
80 + bug-gdb@prep.ai.mit.edu */
82 +__thread int var = 42;
83 --- /dev/null 2009-02-10 00:19:00.494289687 +0100
84 +++ gdb-6.8.50.20090209-x/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2009-02-10 00:49:38.000000000 +0100
86 +# Copyright 2006 Free Software Foundation, Inc.
88 +# This program is free software; you can redistribute it and/or modify
89 +# it under the terms of the GNU General Public License as published by
90 +# the Free Software Foundation; either version 2 of the License, or
91 +# (at your option) any later version.
93 +# This program is distributed in the hope that it will be useful,
94 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
95 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96 +# GNU General Public License for more details.
98 +# You should have received a copy of the GNU General Public License
99 +# along with this program; if not, write to the Free Software
100 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
102 +if $tracelevel then {
106 +set testfile tls-sepdebug
107 +set srcmainfile ${testfile}-main.c
108 +set srcsharedfile ${testfile}-shared.c
110 +set binmainfile ${objdir}/${subdir}/${testfile}-main
111 +set binsharedbase ${testfile}-shared.so
112 +set binsharedfile ${objdir}/${subdir}/${binsharedbase}
113 +set binshareddebugfile ${objdir}/${subdir}/${binsharedbase}.debug
115 +# Use explicit -soname as otherwise the full path to the library would get
116 +# encoded into ${binmainfile} making LD_LIBRARY_PATH tests useless.
118 +# FIXME: gcc dependency (-Wl,-soname).
120 +if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcsharedfile}" "${binsharedfile}" [list debug additional_flags=-Wl,-soname=${binsharedbase}]] != "" } {
121 + untested "Couldn't compile test library"
125 +# eu-strip(1) works fine but it is a part of `elfutils', not `binutils'.
127 + remote_exec build "eu-strip -f ${binshareddebugfile} ${binsharedfile}"
129 + remote_exec build "objcopy --only-keep-debug ${binsharedfile} ${binshareddebugfile}"
130 + remote_exec build "objcopy --strip-debug ${binsharedfile}"
131 + remote_exec build "objcopy --add-gnu-debuglink=${binshareddebugfile} ${binsharedfile}"
134 +# Do not use `shlib=' as it will automatically add also -rpath for gcc.
136 +if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcmainfile} ${binsharedfile}" "${binmainfile}" executable {debug}] != "" } {
137 + untested "Couldn't compile test program"
141 +# Get things started.
143 +# Test also the proper resolving of relative library names to absolute ones.
144 +# \$PWD is easy - it is the absolute way
145 +# ${subdir} would fail on "print var"
147 +foreach ld_library_path [list [pwd]/${subdir} ./${subdir}] name { absolute relative } {
151 + ###gdb_reinitialize_dir $srcdir/$subdir
153 + gdb_test "set env LD_LIBRARY_PATH=$ld_library_path" \
155 + "set env LD_LIBRARY_PATH is $name"
157 + gdb_load ${binmainfile}
159 + # For C programs, "start" should stop in main().
162 + "main \\(\\) at .*${srcmainfile}.*" \
165 + # Check for: Cannot find shared library `/usr/lib/debug/lib/libc-2.4.90.so.debug' in dynamic linker's load module list
166 + # as happens with TLS variables and `separate_debug_objfile_backlink'.
168 + gdb_test "print var" \
169 + "\\\$1 = \[0-9\].*" \
170 + "print TLS variable from a shared library with $name-directory separate debug info file"