aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-05-28 18:50:35 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-05-28 18:50:35 +0000
commitf6528abd6444820594f6d2147b9aa7f312539411 (patch)
tree890cfc2dc2f2c27bc2db842ded441f000c7aed42 /gdb/gdbserver
parent096554ab8e066968273156f38761b44b57cea151 (diff)
downloadgdb-f6528abd6444820594f6d2147b9aa7f312539411.zip
gdb-f6528abd6444820594f6d2147b9aa7f312539411.tar.gz
gdb-f6528abd6444820594f6d2147b9aa7f312539411.tar.bz2
gdb/
* Makefile.in (RDYNAMIC): New. (SFILES): Add proc-service.list. * config/alpha/alpha-linux.mh (NAT_CDEPS): New. (LOADLIBES): Replace -rdynamic by $(RDYNAMIC). * config/arm/linux.mh: Likewise. * config/i386/linux.mh: Likewise. * config/i386/linux64.mh: Likewise. * config/ia64/linux.mh: Likewise. * config/m32r/linux.mh: Likewise. * config/m68k/linux.mh: Likewise. * config/mips/linux.mh: Likewise. * config/pa/linux.mh: Likewise. * config/powerpc/linux.mh: Likewise. * config/powerpc/ppc64-linux.mh: Likewise. * config/s390/s390.mh: Likewise. * config/sparc/linux.mh: Likewise. * config/sparc/linux64.mh: Likewise. * config/xtensa/linux.mh: Likewise. * configure.ac: New RDYNAMIC on native host and GCC. (solaris*): Replace -Wl,-export-dynamic by $RDYNAMIC. * configure: Regenerate. * proc-service.list: New. gdb/gdbserver/ * Makefile.in (SFILES): Add $(srcdir)/proc-service.list. (CDEPS): New. * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping. Test also -Wl,--dynamic-list. * configure: Regenerate. * proc-service.list: New.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog9
-rw-r--r--gdb/gdbserver/Makefile.in4
-rwxr-xr-xgdb/gdbserver/configure34
-rw-r--r--gdb/gdbserver/configure.ac17
-rw-r--r--gdb/gdbserver/proc-service.list30
5 files changed, 88 insertions, 6 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 16c5149..b7d0c0c 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,14 @@
2010-05-28 Jan Kratochvil <jan.kratochvil@redhat.com>
+ * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
+ (CDEPS): New.
+ * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping. Test also
+ -Wl,--dynamic-list.
+ * configure: Regenerate.
+ * proc-service.list: New.
+
+2010-05-28 Jan Kratochvil <jan.kratochvil@redhat.com>
+
* linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
New comment.
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 5e6c4c9..6a75af7 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -100,7 +100,8 @@ INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@
# All source files that go into linking GDB remote server.
SFILES= $(srcdir)/gdbreplay.c $(srcdir)/inferiors.c \
- $(srcdir)/mem-break.c $(srcdir)/proc-service.c $(srcdir)/regcache.c \
+ $(srcdir)/mem-break.c $(srcdir)/proc-service.c \
+ $(srcdir)/proc-service.list $(srcdir)/regcache.c \
$(srcdir)/remote-utils.c $(srcdir)/server.c $(srcdir)/target.c \
$(srcdir)/thread-db.c $(srcdir)/utils.c \
$(srcdir)/linux-arm-low.c $(srcdir)/linux-cris-low.c \
@@ -133,6 +134,7 @@ OBS = inferiors.o regcache.o remote-utils.o server.o signals.o target.o \
GDBREPLAY_OBS = gdbreplay.o version.o
GDBSERVER_LIBS = @GDBSERVER_LIBS@
XM_CLIBS = @LIBS@
+CDEPS = $(srcdir)/proc-service.list
# XML files to compile in to gdbserver, if any.
XML_DIR = $(srcdir)/../features
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 8db8861..d264c23 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -4349,8 +4349,13 @@ USE_THREAD_DB=
if test "$srv_linux_thread_db" = "yes"; then
if test "$ac_cv_lib_dl_dlopen" = "yes"; then
srv_libs="-ldl"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the dynamic export flag" >&5
+$as_echo_n "checking for the dynamic export flag... " >&6; }
old_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -rdynamic"
+ # Older GNU ld supports --export-dynamic but --dynamic-list may not be
+ # supported there.
+ RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list"
+ LDFLAGS="$LDFLAGS $RDYNAMIC"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -4363,14 +4368,37 @@ main ()
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- RDYNAMIC=-rdynamic
+ found="-Wl,--dynamic-list"
+ RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'
else
- RDYNAMIC=
+ RDYNAMIC="-rdynamic"
+ LDFLAGS="$old_LDFLAGS $RDYNAMIC"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ found="-rdynamic"
+else
+ found="no"
+ RDYNAMIC=""
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS="$old_LDFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5
+$as_echo "$found" >&6; }
else
srv_libs="-lthread_db"
fi
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index a2dfa37..bc550b6 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -188,11 +188,24 @@ USE_THREAD_DB=
if test "$srv_linux_thread_db" = "yes"; then
if test "$ac_cv_lib_dl_dlopen" = "yes"; then
srv_libs="-ldl"
+ AC_MSG_CHECKING(for the dynamic export flag)
old_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -rdynamic"
- AC_TRY_LINK([], [], [RDYNAMIC=-rdynamic], [RDYNAMIC=])
+ # Older GNU ld supports --export-dynamic but --dynamic-list may not be
+ # supported there.
+ RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list"
+ LDFLAGS="$LDFLAGS $RDYNAMIC"
+ AC_TRY_LINK([], [],
+ [found="-Wl,--dynamic-list"
+ RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'],
+ [RDYNAMIC="-rdynamic"
+ LDFLAGS="$old_LDFLAGS $RDYNAMIC"
+ AC_TRY_LINK([], [],
+ [found="-rdynamic"],
+ [found="no"
+ RDYNAMIC=""])])
AC_SUBST(RDYNAMIC)
LDFLAGS="$old_LDFLAGS"
+ AC_MSG_RESULT($found)
else
srv_libs="-lthread_db"
fi
diff --git a/gdb/gdbserver/proc-service.list b/gdb/gdbserver/proc-service.list
new file mode 100644
index 0000000..03b0560
--- /dev/null
+++ b/gdb/gdbserver/proc-service.list
@@ -0,0 +1,30 @@
+/* -Wl,--dynamic-list symbols exported for libthread_db.
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+{
+ ps_get_thread_area;
+ ps_getpid;
+ ps_lgetfpregs;
+ ps_lgetregs;
+ ps_lsetfpregs;
+ ps_lsetregs;
+ ps_pdread;
+ ps_pdwrite;
+ ps_pglobal_lookup;
+};