gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 28 May 2010 18:50:35 +0000 (18:50 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 28 May 2010 18:50:35 +0000 (18:50 +0000)
* 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.

25 files changed:
gdb/ChangeLog
gdb/Makefile.in
gdb/config/alpha/alpha-linux.mh
gdb/config/arm/linux.mh
gdb/config/i386/linux.mh
gdb/config/i386/linux64.mh
gdb/config/ia64/linux.mh
gdb/config/m32r/linux.mh
gdb/config/m68k/linux.mh
gdb/config/mips/linux.mh
gdb/config/pa/linux.mh
gdb/config/powerpc/linux.mh
gdb/config/powerpc/ppc64-linux.mh
gdb/config/s390/s390.mh
gdb/config/sparc/linux.mh
gdb/config/sparc/linux64.mh
gdb/config/xtensa/linux.mh
gdb/configure
gdb/configure.ac
gdb/gdbserver/ChangeLog
gdb/gdbserver/Makefile.in
gdb/gdbserver/configure
gdb/gdbserver/configure.ac
gdb/gdbserver/proc-service.list [new file with mode: 0644]
gdb/proc-service.list [new file with mode: 0644]

index 83da1f4d5ef2cd8cb08f0a4c8f8e134269b06d2f..41406dadab16b0cc08bdf41931e60990a953df18 100644 (file)
@@ -1,3 +1,28 @@
+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
index 754671ffb806bf0f972d7cff082df98f58b81751..b01a3c4dc6287b545115419fd36f6eb04745b0da 100644 (file)
@@ -157,6 +157,8 @@ GDB_WERROR_CFLAGS = $(WERROR_CFLAGS)
 
 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@
@@ -683,7 +685,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
        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 \
index 7fd0d8dfdd438f40a0c0d7c3367f17d3fc7c6f27..5074f1e0fb9b586dcd4cfbe64eec14e50e59b67e 100644 (file)
@@ -3,10 +3,11 @@ NAT_FILE= config/nm-linux.h
 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.
index 6020d33de756a33feb521ce1dd984e0c8b6a6d13..aa6d08ab22e7391cd4c7f770736cfcfa6cb641a4 100644 (file)
@@ -3,5 +3,6 @@
 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)
index 3970e32e95fb30cdce57e3c96feacffbcb3a2b2f..302f6d51612341b524902f75e4eb12de1cbc28ac 100644 (file)
@@ -5,7 +5,8 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
        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)
index 19f3be0f127f023430cae4d63f23e3cbadeeba3d..3e593009946625b9a79f36ad74f09db8dbaa92ac 100644 (file)
@@ -3,7 +3,8 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
        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)
index 8a3dc30a6600600ff9941ac901decf1126e54b9e..a069b5b0a21eb89b79398bd39a304fb296e0cbc5 100644 (file)
@@ -4,5 +4,6 @@ NAT_FILE= config/nm-linux.h
 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)
index a92456ac8e271211d4d05a9c503aafaeb4312a07..b3f1c5f447d057cd625b09698cdbbb3d56f203b9 100644 (file)
@@ -4,5 +4,6 @@ NAT_FILE= config/nm-linux.h
 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)
index 9759bc58b19c0d66383b4cd1deb453af0b7cb044..4a95208301cce0c9bb911bef032c07fbb13742a5 100644 (file)
@@ -4,7 +4,8 @@ NAT_FILE= config/nm-linux.h
 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)
index 309ee89c29f713350e998b8326da9f05fbe3310a..5e9dbb66858488bea9c6254c599120b117a7320f 100644 (file)
@@ -3,5 +3,6 @@ NAT_FILE= config/nm-linux.h
 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)
index cd709e3b225e2c572355af51928901c97f04f3bc..293964fba268a3624046da9bba99ff8daf5fe763 100644 (file)
@@ -3,5 +3,6 @@ NAT_FILE= config/nm-linux.h
 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)
index f31386c8d424bb5c1fd5246cc33302c7831aeb35..501f2d670a8dcada6985f8378a01bb414a8f8c75 100644 (file)
@@ -6,5 +6,6 @@ NAT_FILE= config/nm-linux.h
 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)
index 562baa48ade2936e4c59e86c2b9005c698bdcbb8..5675fdca378146eed226a1305e8f4170cbb6e866 100644 (file)
@@ -6,6 +6,7 @@ NAT_FILE= config/nm-linux.h
 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
@@ -15,4 +16,4 @@ MH_CFLAGS= -mminimal-toc
 
 # The dynamically loaded libthread_db needs access to symbols in the
 # gdb executable.
-LOADLIBES= -ldl -rdynamic
+LOADLIBES= -ldl $(RDYNAMIC)
index 765df6bdcb7a173c1984defecbbcab314b7a0dcd..9e62904efff51d55455bcf9545f28239376f5c99 100644 (file)
@@ -2,4 +2,5 @@
 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)
index f3873e6f07751e634b994c363ae7e50b7dcefbfd..32d1b6abb5459448acb2c86f96987b9954e8f05c 100644 (file)
@@ -4,7 +4,8 @@ NATDEPFILES= sparc-nat.o sparc-linux-nat.o \
        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)
index 5b1497a62d011a7a4ff278ea1f3126cd85fa8a87..b54c3b76cba1c25ddae1ce0d25a929e63385750e 100644 (file)
@@ -5,7 +5,8 @@ NATDEPFILES= sparc-nat.o sparc64-nat.o sparc64-linux-nat.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)
index 174b7ac490d56c4c4a01111f44a2e61e2adb4456..c83eac0e16222abad3c50433ef3810b23fa3e815 100644 (file)
@@ -4,5 +4,6 @@ NAT_FILE= config/nm-linux.h
 
 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)
index 1ac7d4b7afc345b4c7e0f155151cd83175c99495..5380293df5ef2aeeffc561d6f69901595b46da4f 100755 (executable)
@@ -657,6 +657,7 @@ SYSTEM_GDBINIT
 TARGET_SYSTEM_ROOT_DEFINE
 TARGET_SYSTEM_ROOT
 CONFIG_LDFLAGS
+RDYNAMIC
 ALLOCA
 PYTHON_CFLAGS
 python_prog_path
@@ -14171,6 +14172,62 @@ esac
 
 
 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
@@ -14253,38 +14310,7 @@ _ACEOF
 
 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
index 70608afedbed4c11da6b6d5267554df792df95c3..16789b9aefaa8ef6712d3be729c63c5cd49f8457 100644 (file)
@@ -1450,6 +1450,30 @@ dnl Note that we only want this if we are both native (host == target),
 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)
@@ -1480,19 +1504,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
          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)
index 16c5149210e1db2d38bdd1d6c644d4b7e106dfb9..b7d0c0cfc3ff9418d804fba7413b88aeb0265aab 100644 (file)
@@ -1,3 +1,12 @@
+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.
index 5e6c4c91ee2ea1abfa05011968716eb91a50a829..6a75af7d14d1258b2368e0ac6b4015bf819a4b03 100644 (file)
@@ -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
index 8db886155a8039e72da59e6661aa594f6e378c08..d264c23998c442072783f9aaedb0add50d5e1be6 100755 (executable)
@@ -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
index a2dfa372546dfa25dffedd20162d863781108689..bc550b679df2674c3ed339be7223904876c20fa3 100644 (file)
@@ -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 (file)
index 0000000..03b0560
--- /dev/null
@@ -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;
+};
diff --git a/gdb/proc-service.list b/gdb/proc-service.list
new file mode 100644 (file)
index 0000000..9b3eb43
--- /dev/null
@@ -0,0 +1,40 @@
+/* -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;
+};