]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
merge from gcc
authorDJ Delorie <dj@redhat.com>
Fri, 22 Jul 2011 14:37:58 +0000 (14:37 +0000)
committerDJ Delorie <dj@redhat.com>
Fri, 22 Jul 2011 14:37:58 +0000 (14:37 +0000)
include/ChangeLog
include/libiberty.h
libiberty/ChangeLog
libiberty/Makefile.in
libiberty/config.in
libiberty/configure
libiberty/configure.ac
libiberty/stack-limit.c [new file with mode: 0644]

index 2252587e5d223f2e25247a413bcaaf1baf94455a..c563678f641f835f4412db64b11f375ea2a0b5cb 100644 (file)
@@ -1,3 +1,31 @@
+2011-07-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/49756
+       * libiberty.h (stack_limit_increase): New prototype.
+
+2011-07-13  Sriraman Tallam  <tmsriram@google.com>
+
+       * plugin-api.h
+       (ld_plugin_section): New struct.
+       (ld_plugin_get_section_count): New typedef.
+       (ld_plugin_get_section_type): New typedef.
+       (ld_plugin_get_section_name): New typedef.
+       (ld_plugin_get_section_contents): New typedef.
+       (ld_plugin_update_section_order): New typedef.
+       (ld_plugin_allow_section_ordering): New typedef.
+       (LDPT_GET_SECTION_COUNT): New enum value.
+       (LDPT_GET_SECTION_TYPE): New enum value.
+       (LDPT_GET_SECTION_NAME): New enum value.
+       (LDPT_GET_SECTION_CONTENTS): New enum value.
+       (LDPT_UPDATE_SECTION_ORDER): New enum value.
+       (LDPT_ALLOW_SECTION_ORDERING): New enum value.
+       (tv_get_section_count): New struct members.
+       (tv_get_section_type): New struct members.
+       (tv_get_section_name): New struct members.
+       (tv_get_section_contents): New struct members.
+       (tv_update_section_order): New struct members.
+       (tv_allow_section_ordering): New struct members.
+
 2011-07-15  Alan Modra  <amodra@gmail.com>
 
        * bfdlink.h (struct bfd_link_info): Use ENUM_BITFIELD for strip,
index 1cc7250bf3c9b2e5aacedd990647aeafe33e653c..32eb83a049eefec2a29f9eef2ab3aaadf72379d7 100644 (file)
@@ -1,7 +1,7 @@
 /* Function declarations for libiberty.
 
    Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-   2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
    
    Note - certain prototypes declared in this header file are for
    functions whoes implementation copyright does not belong to the
@@ -637,6 +637,9 @@ extern int strverscmp (const char *, const char *);
 /* Set the title of a process */
 extern void setproctitle (const char *name, ...);
 
+/* Increase stack limit if possible.  */
+extern void stack_limit_increase (unsigned long);
+
 #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
 
 /* Drastically simplified alloca configurator.  If we're using GCC,
index cd71565e582b86905af065fdb1b310afa0fcfef1..689d507cdde8e46cc89577044d50cb69de7a2fd7 100644 (file)
@@ -1,3 +1,15 @@
+2011-07-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/49756
+       * stack-limit.c: New file.
+       * Makefile.in: Regenerate deps.
+       (CFILES): Add stack-limit.c.
+       (REQUIRED_OFILES): Add ./stack-limit.$(objext).
+       * configure.ac (checkfuncs): Add getrlimit and setrlimit.
+       (AC_CHECK_FUNCS): Likewise.
+       * configure: Regenerated.
+       * config.in: Regenerated.
+
 2011-07-04  Jason Merrill  <jason@redhat.com>
 
        * cp-demangle.c (d_expression): Handle 'this'.
index ef35453c031023e07c893fd8a3fee326817378da..bcd03fd016725b665e6de962b25bebb7e71db73f 100644 (file)
@@ -2,7 +2,7 @@
 # Originally written by K. Richard Pixley <rich@cygnus.com>.
 #
 # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 # Free Software Foundation
 #
 # This file is part of the libiberty library.
@@ -148,10 +148,10 @@ CFILES = alloca.c argv.c asprintf.c atexit.c                              \
         simple-object.c simple-object-coff.c simple-object-elf.c       \
         simple-object-mach-o.c                                         \
          snprintf.c sort.c                                             \
-        spaces.c splay-tree.c stpcpy.c stpncpy.c strcasecmp.c          \
-        strchr.c strdup.c strerror.c strncasecmp.c strncmp.c           \
-        strrchr.c strsignal.c strstr.c strtod.c strtol.c strtoul.c     \
-        strndup.c strverscmp.c                                         \
+        spaces.c splay-tree.c stack-limit.c stpcpy.c stpncpy.c         \
+        strcasecmp.c strchr.c strdup.c strerror.c strncasecmp.c        \
+        strncmp.c strrchr.c strsignal.c strstr.c strtod.c strtol.c     \
+        strtoul.c strndup.c strverscmp.c                               \
        tmpnam.c                                                        \
        unlink-if-ordinary.c                                            \
        vasprintf.c vfork.c vfprintf.c vprintf.c vsnprintf.c vsprintf.c \
@@ -183,7 +183,8 @@ REQUIRED_OFILES =                                                   \
        ./simple-object.$(objext) ./simple-object-coff.$(objext)        \
        ./simple-object-elf.$(objext) ./simple-object-mach-o.$(objext)  \
        ./sort.$(objext) ./spaces.$(objext)                             \
-       ./splay-tree.$(objext) ./strerror.$(objext)                     \
+       ./splay-tree.$(objext) ./stack-limit.$(objext)                  \
+       ./strerror.$(objext)                                            \
        ./strsignal.$(objext) ./unlink-if-ordinary.$(objext)            \
        ./xatexit.$(objext) ./xexit.$(objext) ./xmalloc.$(objext)       \
        ./xmemdup.$(objext) ./xstrdup.$(objext) ./xstrerror.$(objext)   \
@@ -1033,6 +1034,12 @@ $(CONFIGURED_OFILES): stamp-picdir
        else true; fi
        $(COMPILE.c) $(srcdir)/splay-tree.c $(OUTPUT_OPTION)
 
+./stack-limit.$(objext): $(srcdir)/stack-limit.c config.h
+       if [ x"$(PICFLAG)" != x ]; then \
+         $(COMPILE.c) $(PICFLAG) $(srcdir)/stack-limit.c -o pic/$@; \
+       else true; fi
+       $(COMPILE.c) $(srcdir)/stack-limit.c $(OUTPUT_OPTION)
+
 ./stpcpy.$(objext): $(srcdir)/stpcpy.c $(INCDIR)/ansidecl.h
        if [ x"$(PICFLAG)" != x ]; then \
          $(COMPILE.c) $(PICFLAG) $(srcdir)/stpcpy.c -o pic/$@; \
index e4f1f1620e19be55112d0cf1b765314b09867f4a..17c4c2e4414a2fa1f58f0644316632f8372a43f6 100644 (file)
 /* Define to 1 if you have the `getpagesize' function. */
 #undef HAVE_GETPAGESIZE
 
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
 /* Define to 1 if you have the `getrusage' function. */
 #undef HAVE_GETRUSAGE
 
 /* Define to 1 if you have the `setproctitle' function. */
 #undef HAVE_SETPROCTITLE
 
+/* Define to 1 if you have the `setrlimit' function. */
+#undef HAVE_SETRLIMIT
+
 /* Define to 1 if you have the `sigsetmask' function. */
 #undef HAVE_SIGSETMASK
 
index bdabe8d1a3546e570c3e4cc38bd789de4c36a6b5..35b8ce5049bb38f10fa06e74d8bfe8731370920f 100755 (executable)
@@ -5293,10 +5293,10 @@ funcs="$funcs setproctitle"
 
 vars="sys_errlist sys_nerr sys_siglist"
 
-checkfuncs="__fsetlocking canonicalize_file_name dup3 getrusage getsysinfo \
- gettimeofday on_exit psignal pstat_getdynamic pstat_getstatic realpath \
sbrk spawnve spawnvpe strerror strsignal sysconf sysctl sysmp table \
- times wait3 wait4"
+checkfuncs="__fsetlocking canonicalize_file_name dup3 getrlimit getrusage \
+ getsysinfo gettimeofday on_exit psignal pstat_getdynamic pstat_getstatic \
realpath setrlimit sbrk spawnve spawnvpe strerror strsignal sysconf sysctl \
sysmp table times wait3 wait4"
 
 # These are neither executed nor required, but they help keep
 # autoheader happy without adding a bunch of text to acconfig.h.
@@ -5306,13 +5306,13 @@ if test "x" = "y"; then
     calloc canonicalize_file_name clock \
     dup3 \
     ffs __fsetlocking \
-    getcwd getpagesize getrusage getsysinfo gettimeofday \
+    getcwd getpagesize getrlimit getrusage getsysinfo gettimeofday \
     index insque \
     memchr memcmp memcpy memmem memmove memset mkstemps \
     on_exit \
     psignal pstat_getdynamic pstat_getstatic putenv \
     random realpath rename rindex \
-    sbrk setenv setproctitle sigsetmask snprintf spawnve spawnvpe \
+    sbrk setenv setproctitle setrlimit sigsetmask snprintf spawnve spawnvpe \
      stpcpy stpncpy strcasecmp strchr strdup \
      strerror strncasecmp strndup strrchr strsignal strstr strtod strtol \
      strtoul strverscmp sysconf sysctl sysmp \
index 9f1ff04938ec28cf81e69b0990e0c3831684e2f9..eebd7e991056f629baeb474ae551903306196119 100644 (file)
@@ -358,10 +358,10 @@ funcs="$funcs setproctitle"
 
 vars="sys_errlist sys_nerr sys_siglist"
 
-checkfuncs="__fsetlocking canonicalize_file_name dup3 getrusage getsysinfo \
- gettimeofday on_exit psignal pstat_getdynamic pstat_getstatic realpath \
sbrk spawnve spawnvpe strerror strsignal sysconf sysctl sysmp table \
- times wait3 wait4"
+checkfuncs="__fsetlocking canonicalize_file_name dup3 getrlimit getrusage \
+ getsysinfo gettimeofday on_exit psignal pstat_getdynamic pstat_getstatic \
realpath setrlimit sbrk spawnve spawnvpe strerror strsignal sysconf sysctl \
sysmp table times wait3 wait4"
 
 # These are neither executed nor required, but they help keep
 # autoheader happy without adding a bunch of text to acconfig.h.
@@ -371,13 +371,13 @@ if test "x" = "y"; then
     calloc canonicalize_file_name clock \
     dup3 \
     ffs __fsetlocking \
-    getcwd getpagesize getrusage getsysinfo gettimeofday \
+    getcwd getpagesize getrlimit getrusage getsysinfo gettimeofday \
     index insque \
     memchr memcmp memcpy memmem memmove memset mkstemps \
     on_exit \
     psignal pstat_getdynamic pstat_getstatic putenv \
     random realpath rename rindex \
-    sbrk setenv setproctitle sigsetmask snprintf spawnve spawnvpe \
+    sbrk setenv setproctitle setrlimit sigsetmask snprintf spawnve spawnvpe \
      stpcpy stpncpy strcasecmp strchr strdup \
      strerror strncasecmp strndup strrchr strsignal strstr strtod strtol \
      strtoul strverscmp sysconf sysctl sysmp \
diff --git a/libiberty/stack-limit.c b/libiberty/stack-limit.c
new file mode 100644 (file)
index 0000000..28541b1
--- /dev/null
@@ -0,0 +1,59 @@
+/* Increase stack size limit if possible.
+   Copyright (C) 2011 Free Software Foundation, Inc.
+
+This file is part of the libiberty library.  This library 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 2, or (at your option)
+any later version.
+
+This library 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 GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street - Fifth Floor,
+Boston, MA 02110-1301, USA.
+
+As a special exception, if you link this library with files
+compiled with a GNU compiler to produce an executable, this does not cause
+the resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why
+the executable file might be covered by the GNU General Public License. */
+
+/*
+
+@deftypefn Extension void stack_limit_increase (unsigned long @var{pref})
+
+Attempt to increase stack size limit to @var{pref} bytes if possible.
+
+@end deftypefn
+
+*/
+
+#include "config.h"
+
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+void
+stack_limit_increase (unsigned long pref)
+{
+#if defined(HAVE_SETRLIMIT) && defined(HAVE_GETRLIMIT) \
+    && defined(RLIMIT_STACK) && defined(RLIM_INFINITY)
+  struct rlimit rlim;
+  if (getrlimit (RLIMIT_STACK, &rlim) == 0
+      && rlim.rlim_cur != RLIM_INFINITY
+      && rlim.rlim_cur < pref
+      && (rlim.rlim_max == RLIM_INFINITY || rlim.rlim_cur < rlim.rlim_max))
+    {
+      rlim.rlim_cur = pref;
+      if (rlim.rlim_max != RLIM_INFINITY && rlim.rlim_cur > rlim.rlim_max)
+       rlim.rlim_cur = rlim.rlim_max;
+      setrlimit (RLIMIT_STACK, &rlim);
+    }
+#endif
+}