]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blob - gdb/patches/gdb-6.5-sharedlibrary-path.patch
gdb: Update to 7.3.50.20110722.
[people/stevee/ipfire-3.x.git] / gdb / patches / gdb-6.5-sharedlibrary-path.patch
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.
4
5
6 Dropped the workaround/fix for gdb-6.8.50.20081128 - is it still needed?
7
8
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'.
11
12
13 2006-09-01 Jan Kratochvil <jan.kratochvil@redhat.com>
14
15 * solib-svr4.c (svr4_fetch_objfile_link_map): Match even absolute
16 requested pathnames to the internal loaded relative pathnames.
17
18 2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
19
20 Port to GDB-6.7.
21
22 2008-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
23
24 Port to gdb-6.7.50.20080227.
25
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
30 @@ -0,0 +1,25 @@
31 +/* This testcase is part of GDB, the GNU debugger.
32 +
33 + Copyright 2006 Free Software Foundation, Inc.
34 +
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.
39 +
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.
44 +
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.
48 +
49 + Please email any bugs, comments, and/or additions to this file to:
50 + bug-gdb@prep.ai.mit.edu */
51 +
52 +int main()
53 +{
54 + return 0;
55 +}
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
60 @@ -0,0 +1,22 @@
61 +/* This testcase is part of GDB, the GNU debugger.
62 +
63 + Copyright 2006 Free Software Foundation, Inc.
64 +
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.
69 +
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.
74 +
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.
78 +
79 + Please email any bugs, comments, and/or additions to this file to:
80 + bug-gdb@prep.ai.mit.edu */
81 +
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
85 @@ -0,0 +1,86 @@
86 +# Copyright 2006 Free Software Foundation, Inc.
87 +
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.
92 +#
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.
97 +#
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.
101 +
102 +if $tracelevel then {
103 + strace $tracelevel
104 +}
105 +
106 +set testfile tls-sepdebug
107 +set srcmainfile ${testfile}-main.c
108 +set srcsharedfile ${testfile}-shared.c
109 +
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
114 +
115 +# Use explicit -soname as otherwise the full path to the library would get
116 +# encoded into ${binmainfile} making LD_LIBRARY_PATH tests useless.
117 +
118 +# FIXME: gcc dependency (-Wl,-soname).
119 +
120 +if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcsharedfile}" "${binsharedfile}" [list debug additional_flags=-Wl,-soname=${binsharedbase}]] != "" } {
121 + untested "Couldn't compile test library"
122 + return -1
123 +}
124 +
125 +# eu-strip(1) works fine but it is a part of `elfutils', not `binutils'.
126 +if 0 then {
127 + remote_exec build "eu-strip -f ${binshareddebugfile} ${binsharedfile}"
128 +} else {
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}"
132 +}
133 +
134 +# Do not use `shlib=' as it will automatically add also -rpath for gcc.
135 +
136 +if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcmainfile} ${binsharedfile}" "${binmainfile}" executable {debug}] != "" } {
137 + untested "Couldn't compile test program"
138 + return -1
139 +}
140 +
141 +# Get things started.
142 +
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"
146 +
147 +foreach ld_library_path [list [pwd]/${subdir} ./${subdir}] name { absolute relative } {
148 +
149 + gdb_exit
150 + gdb_start
151 + ###gdb_reinitialize_dir $srcdir/$subdir
152 +
153 + gdb_test "set env LD_LIBRARY_PATH=$ld_library_path" \
154 + "" \
155 + "set env LD_LIBRARY_PATH is $name"
156 +
157 + gdb_load ${binmainfile}
158 +
159 + # For C programs, "start" should stop in main().
160 +
161 + gdb_test "start" \
162 + "main \\(\\) at .*${srcmainfile}.*" \
163 + "start"
164 +
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'.
167 +
168 + gdb_test "print var" \
169 + "\\\$1 = \[0-9\].*" \
170 + "print TLS variable from a shared library with $name-directory separate debug info file"
171 +}