aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2014-10-11 10:29:10 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2014-10-11 10:29:10 +0100
commitb55f967878a4f7905f78b05a9c37457797b1c7ed (patch)
tree73b2c4359c9138b5fcdf2675a3bcbf363b9fc2b0 /include
parent754dd2b00f2bd3f2d7aaacdb27375bc6faf1458e (diff)
downloadgdb-b55f967878a4f7905f78b05a9c37457797b1c7ed.zip
gdb-b55f967878a4f7905f78b05a9c37457797b1c7ed.tar.gz
gdb-b55f967878a4f7905f78b05a9c37457797b1c7ed.tar.bz2
Sync libiberty with upstream GCC.
include/ChangeLog * libiberty.h (PEX_STDOUT_APPEND): New flag. (PEX_STDERR_APPEND): Likewise. * demangle.h (DMGL_DLANG): New macro. (DMGL_STYLE_MASK): Add DMGL_DLANG. (demangling_styles): Add dlang_demangling. (DLANG_DEMANGLING_STYLE_STRING): New macro. (DLANG_DEMANGLING): New macro. (dlang_demangle): New prototype. * longlong.h: Add __udiv_w_sdiv prototype. libiberty/ChangeLog * cp-demangle.c (d_substitution): Handle abi tags on abbreviation. * pex-common.h (struct pex_funcs): Add new parameter for open_write field. * pex-unix.c (pex_unix_open_write): Add support for new parameter. * pex-djgpp.c (pex_djgpp_open_write): Likewise. * pex-win32.c (pex_win32_open_write): Likewise. * pex-common.c (pex_run_in_environment): Likewise. * Makefile.in (CFILES): Add d-demangle.c. (REQUIRED_OFILES): Add d-demangle.o. * cplus-dem.c (libiberty_demanglers): Add dlang_demangling case. (cplus_demangle): Likewise. * d-demangle.c: New file. * testsuite/Makefile.in (really-check): Add check-d-demangle. * testsuite/d-demangle-expected: New file. * simple-object-elf.c (simple_object_elf_write_ehdr): Correctly handle objects with more than SHN_LORESERVE sections. (simple_object_elf_write_shdr): Add sh_link parameter. (simple_object_elf_write_to_file): Correctly handle objects with more than SHN_LORESERVE sections. * cp-demangle.c (d_dump): Only access field from s_fixed part of the union for DEMANGLE_COMPONENT_FIXED_TYPE. (d_count_templates_scopes): Likewise. * testsuite/demangler-fuzzer.c: New file. * testsuite/Makefile.in (fuzz-demangler): New rule. (demangler-fuzzer): Likewise. (mostlyclean): Clean up demangler fuzzer.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog18
-rw-r--r--include/demangle.h11
-rw-r--r--include/libiberty.h14
-rw-r--r--include/longlong.h3
4 files changed, 42 insertions, 4 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index f13af30..7acd73d 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,21 @@
+2014-09-26 Max Ostapenko <m.ostapenko@partner.samsung.com>
+
+ * libiberty.h (PEX_STDOUT_APPEND): New flag.
+ (PEX_STDERR_APPEND): Likewise.
+
+2014-09-23 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * demangle.h (DMGL_DLANG): New macro.
+ (DMGL_STYLE_MASK): Add DMGL_DLANG.
+ (demangling_styles): Add dlang_demangling.
+ (DLANG_DEMANGLING_STYLE_STRING): New macro.
+ (DLANG_DEMANGLING): New macro.
+ (dlang_demangle): New prototype.
+
+2014-09-15 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * longlong.h: Add __udiv_w_sdiv prototype.
+
2014-08-12 Alan Modra <amodra@gmail.com>
* bfdlink.h (struct bfd_link_callbacks <notice>): Remove "string"
diff --git a/include/demangle.h b/include/demangle.h
index bbad71b..d2a6731 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -63,9 +63,10 @@ extern "C" {
#define DMGL_EDG (1 << 13)
#define DMGL_GNU_V3 (1 << 14)
#define DMGL_GNAT (1 << 15)
+#define DMGL_DLANG (1 << 16)
/* If none of these are set, use 'current_demangling_style' as the default. */
-#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT)
+#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT|DMGL_DLANG)
/* Enumeration of possible demangling styles.
@@ -87,7 +88,8 @@ extern enum demangling_styles
edg_demangling = DMGL_EDG,
gnu_v3_demangling = DMGL_GNU_V3,
java_demangling = DMGL_JAVA,
- gnat_demangling = DMGL_GNAT
+ gnat_demangling = DMGL_GNAT,
+ dlang_demangling = DMGL_DLANG
} current_demangling_style;
/* Define string names for the various demangling styles. */
@@ -102,6 +104,7 @@ extern enum demangling_styles
#define GNU_V3_DEMANGLING_STYLE_STRING "gnu-v3"
#define JAVA_DEMANGLING_STYLE_STRING "java"
#define GNAT_DEMANGLING_STYLE_STRING "gnat"
+#define DLANG_DEMANGLING_STYLE_STRING "dlang"
/* Some macros to test what demangling style is active. */
@@ -115,6 +118,7 @@ extern enum demangling_styles
#define GNU_V3_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU_V3)
#define JAVA_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_JAVA)
#define GNAT_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNAT)
+#define DLANG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_DLANG)
/* Provide information about the available demangle styles. This code is
pulled from gdb into libiberty because it is useful to binutils also. */
@@ -169,6 +173,9 @@ java_demangle_v3 (const char *mangled);
char *
ada_demangle (const char *mangled, int options);
+extern char *
+dlang_demangle (const char *mangled, int options);
+
enum gnu_v3_ctor_kinds {
gnu_v3_complete_object_ctor = 1,
gnu_v3_base_object_ctor,
diff --git a/include/libiberty.h b/include/libiberty.h
index 78c42eb..bcc1f9a 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -106,7 +106,10 @@ extern int countargv (char**);
to find the declaration so provide a fully prototyped one. If it
is 1, we found it so don't provide any declaration at all. */
#if !HAVE_DECL_BASENAME
-#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME)
+#if defined (__GNU_LIBRARY__ ) || defined (__linux__) \
+ || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) \
+ || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) \
+ || defined (__DragonFly__) || defined (HAVE_DECL_BASENAME)
extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
#else
/* Do not allow basename to be used if there is no prototype seen. We
@@ -442,6 +445,11 @@ extern struct pex_obj *pex_init (int flags, const char *pname,
on Unix. */
#define PEX_BINARY_ERROR 0x80
+/* Append stdout to existing file instead of truncating it. */
+#define PEX_STDOUT_APPEND 0x100
+
+/* Thes same as PEX_STDOUT_APPEND, but for STDERR. */
+#define PEX_STDERR_APPEND 0x200
/* Execute one program. Returns NULL on success. On error returns an
error string (typically just the name of a system call); the error
@@ -633,6 +641,10 @@ extern int snprintf (char *, size_t, const char *, ...) ATTRIBUTE_PRINTF_3;
extern int vsnprintf (char *, size_t, const char *, va_list) ATTRIBUTE_PRINTF(3,0);
#endif
+#if defined (HAVE_DECL_STRNLEN) && !HAVE_DECL_STRNLEN
+extern size_t strnlen (const char *, size_t);
+#endif
+
#if defined(HAVE_DECL_STRVERSCMP) && !HAVE_DECL_STRVERSCMP
/* Compare version strings. */
extern int strverscmp (const char *, const char *);
diff --git a/include/longlong.h b/include/longlong.h
index 31f88cb..42c68dd 100644
--- a/include/longlong.h
+++ b/include/longlong.h
@@ -1687,7 +1687,8 @@ extern UHItype __stormy16_count_leading_zeros (UHItype);
#if !defined (udiv_qrnnd) && defined (sdiv_qrnnd)
#define udiv_qrnnd(q, r, nh, nl, d) \
do { \
- USItype __r; \
+ extern UWtype __udiv_w_sdiv (UWtype *, UWtype, UWtype, UWtype); \
+ UWtype __r; \
(q) = __udiv_w_sdiv (&__r, nh, nl, d); \
(r) = __r; \
} while (0)