* 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.
+2010-05-28 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * 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.
+
2010-05-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-nat.c (linux_nat_core_of_thread_1): Fix crash on invalid
GDB_WARN_CFLAGS_NO_FORMAT = `echo " $(GDB_WARN_CFLAGS) " | sed "s/ -Wformat-nonliteral / /g"`
+RDYNAMIC = @RDYNAMIC@
+
# Where is the INTL library? Typically in ../intl.
INTL = @LIBINTL@
INTL_DEPS = @LIBINTL_DEP@
objc-exp.y objc-lang.c \
objfiles.c osabi.c observer.c osdata.c \
p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c printcmd.c \
- progspace.c \
+ proc-service.list progspace.c \
prologue-value.c psymtab.c \
regcache.c reggroups.c remote.c remote-fileio.c reverse.c \
scm-exp.c scm-lang.c scm-valprint.c \
NATDEPFILES= inf-ptrace.o corelow.o alpha-linux-nat.o \
fork-child.o proc-service.o linux-thread-db.o \
linux-nat.o linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
# gdb executable.
-LOADLIBES = -ldl -rdynamic
+LOADLIBES = -ldl $(RDYNAMIC)
# doublest.c currently assumes some properties of FP arithmetic
# on the host which require this.
NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o arm-linux-nat.o \
proc-service.o linux-thread-db.o linux-nat.o linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
-LOADLIBES= -ldl -rdynamic
+LOADLIBES= -ldl $(RDYNAMIC)
i386-nat.o i386-linux-nat.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
# gdb executable.
-LOADLIBES = -ldl -rdynamic
+LOADLIBES = -ldl $(RDYNAMIC)
i386-nat.o amd64-nat.o amd64-linux-nat.o linux-nat.o \
proc-service.o linux-thread-db.o linux-fork.o
NAT_FILE= config/nm-linux.h
+NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
# gdb executable.
-LOADLIBES = -ldl -rdynamic
+LOADLIBES = -ldl $(RDYNAMIC)
NATDEPFILES= inf-ptrace.o fork-child.o corelow.o \
core-regset.o ia64-linux-nat.o \
proc-service.o linux-thread-db.o linux-nat.o linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
-LOADLIBES = -ldl -rdynamic
+LOADLIBES = -ldl $(RDYNAMIC)
NATDEPFILES= inf-ptrace.o fork-child.o corelow.o \
m32r-linux-nat.o proc-service.o linux-thread-db.o \
linux-nat.o linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
-LOADLIBES= -ldl -rdynamic
+LOADLIBES= -ldl $(RDYNAMIC)
NATDEPFILES= inf-ptrace.o fork-child.o \
corelow.o m68klinux-nat.o \
proc-service.o linux-thread-db.o linux-nat.o linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
# gdb executable.
-LOADLIBES = -ldl -rdynamic
+LOADLIBES = -ldl $(RDYNAMIC)
NATDEPFILES= inf-ptrace.o fork-child.o mips-linux-nat.o \
linux-thread-db.o proc-service.o \
linux-nat.o linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
-LOADLIBES = -ldl -rdynamic
+LOADLIBES = -ldl $(RDYNAMIC)
NATDEPFILES= inf-ptrace.o fork-child.o corelow.o \
hppa-linux-nat.o proc-service.o linux-thread-db.o linux-nat.o \
linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
-LOADLIBES = -ldl -rdynamic
+LOADLIBES = -ldl $(RDYNAMIC)
NATDEPFILES= inf-ptrace.o fork-child.o \
ppc-linux-nat.o proc-service.o linux-thread-db.o \
linux-nat.o linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
-LOADLIBES = -ldl -rdynamic
+LOADLIBES = -ldl $(RDYNAMIC)
NATDEPFILES= inf-ptrace.o fork-child.o \
ppc-linux-nat.o proc-service.o linux-thread-db.o \
linux-nat.o linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
# The PowerPC has severe limitations on TOC size, and uses them even
# for non-PIC code. GDB overflows those tables when compiling with
# The dynamically loaded libthread_db needs access to symbols in the
# gdb executable.
-LOADLIBES= -ldl -rdynamic
+LOADLIBES= -ldl $(RDYNAMIC)
NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o corelow.o s390-nat.o \
linux-thread-db.o proc-service.o linux-nat.o linux-fork.o
-LOADLIBES = -ldl -rdynamic
+NAT_CDEPS = $(srcdir)/proc-service.list
+LOADLIBES = -ldl $(RDYNAMIC)
corelow.o core-regset.o fork-child.o inf-ptrace.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
# gdb executable.
-LOADLIBES = -ldl -rdynamic
+LOADLIBES = -ldl $(RDYNAMIC)
fork-child.o inf-ptrace.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
# gdb executable.
-LOADLIBES = -ldl -rdynamic
+LOADLIBES = -ldl $(RDYNAMIC)
NATDEPFILES= inf-ptrace.o fork-child.o xtensa-linux-nat.o \
linux-thread-db.o proc-service.o linux-nat.o linux-fork.o
+NAT_CDEPS = $(srcdir)/proc-service.list
-LOADLIBES = -ldl -rdynamic
+LOADLIBES = -ldl $(RDYNAMIC)
TARGET_SYSTEM_ROOT_DEFINE
TARGET_SYSTEM_ROOT
CONFIG_LDFLAGS
+RDYNAMIC
ALLOCA
PYTHON_CFLAGS
python_prog_path
if test ${build} = ${host} -a ${host} = ${target} ; then
+ if test "$GCC" = "yes" ; then
+ # The dynamically loaded libthread_db needs access to symbols in the gdb
+ # executable. Older GNU ld supports --export-dynamic but --dynamic-list
+ # may not be supported there.
+ { $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"
+ # Older GNU ld supports --export-dynamic but --dynamic-list it does not.
+ RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list"
+ LDFLAGS="$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="-Wl,--dynamic-list"
+ RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'
+else
+ 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"
+ # Error on its usage by .mh file.
+ RDYNAMIC="no-rdynamic-available"
+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; }
+ fi
+
case ${host_os} in
hpux*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for HPUX/OSF thread support" >&5
fi
- if test "$GCC" = "yes" ; then
- # The GNU linker requires the -export-dynamic option to make
- # all symbols visible in the dynamic symbol table.
- hold_ldflags=$LDFLAGS
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the ld -export-dynamic flag" >&5
-$as_echo_n "checking for the ld -export-dynamic flag... " >&6; }
- LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-int i;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- found=yes
-else
- found=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$hold_ldflags
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5
-$as_echo "$found" >&6; }
- if test $found = yes; then
- CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
- fi
- fi
+ CONFIG_LDFLAGS="${CONFIG_LDFLAGS} $RDYNAMIC"
# Sun randomly tweaked the prototypes in <proc_service.h>
# at one point.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if <proc_service.h> is old" >&5
dnl and not doing a canadian cross build (build == host).
if test ${build} = ${host} -a ${host} = ${target} ; then
+ if test "$GCC" = "yes" ; then
+ # The dynamically loaded libthread_db needs access to symbols in the gdb
+ # executable. Older GNU ld supports --export-dynamic but --dynamic-list
+ # may not be supported there.
+ AC_MSG_CHECKING(for the dynamic export flag)
+ old_LDFLAGS="$LDFLAGS"
+ # Older GNU ld supports --export-dynamic but --dynamic-list it does not.
+ 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"
+ # Error on its usage by .mh file.
+ RDYNAMIC="no-rdynamic-available"])])
+ AC_SUBST(RDYNAMIC)
+ LDFLAGS="$old_LDFLAGS"
+ AC_MSG_RESULT($found)
+ fi
+
case ${host_os} in
hpux*)
AC_MSG_CHECKING(for HPUX/OSF thread support)
CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
AC_CHECK_LIB(dl, dlopen)
- if test "$GCC" = "yes" ; then
- # The GNU linker requires the -export-dynamic option to make
- # all symbols visible in the dynamic symbol table.
- hold_ldflags=$LDFLAGS
- AC_MSG_CHECKING(for the ld -export-dynamic flag)
- LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
- AC_TRY_LINK(, [int i;], found=yes, found=no)
- LDFLAGS=$hold_ldflags
- AC_MSG_RESULT($found)
- if test $found = yes; then
- CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
- fi
- fi
+ CONFIG_LDFLAGS="${CONFIG_LDFLAGS} $RDYNAMIC"
# Sun randomly tweaked the prototypes in <proc_service.h>
# at one point.
AC_MSG_CHECKING(if <proc_service.h> is old)
+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.
# 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 \
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
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. */
}
_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
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
--- /dev/null
+/* -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;
+};
--- /dev/null
+/* -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_lcontinue;
+ ps_lgetfpregs;
+ ps_lgetregs;
+ ps_lgetxregs;
+ ps_lgetxregsize;
+ ps_lsetfpregs;
+ ps_lsetregs;
+ ps_lsetxregs;
+ ps_lstop;
+ ps_pcontinue;
+ ps_pdread;
+ ps_pdwrite;
+ ps_pglobal_lookup;
+ ps_plog;
+ ps_pstop;
+ ps_ptread;
+ ps_ptwrite;
+};