elf: Add PT_GNU_PROPERTY segment type
[binutils-gdb.git] / binutils / sysdep.h
index 9627b46d459c479c0195c61a1f37e5db36d58982..64ae1d088340dbf8b6645736c5e7df9e9d52931e 100644 (file)
@@ -1,12 +1,11 @@
 /* sysdep.h -- handle host dependencies for binutils
 /* sysdep.h -- handle host dependencies for binutils
-   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1991-2018 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
    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
 
    This file is part of GNU Binutils.
 
    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 2 of the License, or
+   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,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
 #ifndef _BIN_SYSDEP_H
 #define _BIN_SYSDEP_H
 
 #ifndef _BIN_SYSDEP_H
 #define _BIN_SYSDEP_H
 
+#include "alloca-conf.h"
 #include "ansidecl.h"
 #include <stdio.h>
 #include <sys/types.h>
 
 #include "bfdver.h"
 #include "ansidecl.h"
 #include <stdio.h>
 #include <sys/types.h>
 
 #include "bfdver.h"
-#include "config.h"
 
 #include <stdarg.h>
 
 
 #include <stdarg.h>
 
@@ -45,6 +44,10 @@ extern int errno;
 #include <unistd.h>
 #endif
 
 #include <unistd.h>
 #endif
 
+#ifdef STRING_WITH_STRINGS
+#include <string.h>
+#include <strings.h>
+#else
 #ifdef HAVE_STRING_H
 #include <string.h>
 #else
 #ifdef HAVE_STRING_H
 #include <string.h>
 #else
@@ -55,6 +58,7 @@ extern char *strchr ();
 extern char *strrchr ();
 #endif
 #endif
 extern char *strrchr ();
 #endif
 #endif
+#endif
 
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
@@ -68,6 +72,12 @@ extern char *strrchr ();
 #endif
 #endif
 
 #endif
 #endif
 
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#include "binary-io.h"
+
 #if !HAVE_DECL_STPCPY
 extern char *stpcpy (char *, const char *);
 #endif
 #if !HAVE_DECL_STPCPY
 extern char *stpcpy (char *, const char *);
 #endif
@@ -102,6 +112,10 @@ extern int snprintf(char *, size_t, const char *, ...);
 extern int vsnprintf(char *, size_t, const char *, va_list);
 #endif
 
 extern int vsnprintf(char *, size_t, const char *, va_list);
 #endif
 
+#if !HAVE_DECL_STRNLEN
+size_t strnlen (const char *, size_t);
+#endif
+
 #ifndef O_RDONLY
 #define O_RDONLY 0
 #endif
 #ifndef O_RDONLY
 #define O_RDONLY 0
 #endif
@@ -120,23 +134,6 @@ extern int vsnprintf(char *, size_t, const char *, va_list);
 #define SEEK_END 2
 #endif
 
 #define SEEK_END 2
 #endif
 
-#if defined(__GNUC__) && !defined(C_ALLOCA)
-# undef alloca
-# define alloca __builtin_alloca
-#else
-# if defined(HAVE_ALLOCA_H) && !defined(C_ALLOCA)
-#  include <alloca.h>
-# else
-#  ifndef alloca /* predefined by HP cc +Olibcalls */
-#   if !defined (__STDC__) && !defined (__hpux)
-char *alloca ();
-#   else
-void *alloca ();
-#   endif /* __STDC__, __hpux */
-#  endif /* alloca */
-# endif /* HAVE_ALLOCA_H */
-#endif
-
 #ifdef HAVE_LOCALE_H
 # ifndef ENABLE_NLS
    /* The Solaris version of locale.h always includes libintl.h.  If we have
 #ifdef HAVE_LOCALE_H
 # ifndef ENABLE_NLS
    /* The Solaris version of locale.h always includes libintl.h.  If we have
@@ -162,8 +159,14 @@ void *alloca ();
 # define gettext(Msgid) (Msgid)
 # define dgettext(Domainname, Msgid) (Msgid)
 # define dcgettext(Domainname, Msgid, Category) (Msgid)
 # define gettext(Msgid) (Msgid)
 # define dgettext(Domainname, Msgid) (Msgid)
 # define dcgettext(Domainname, Msgid, Category) (Msgid)
-# define textdomain(Domainname) while (0) /* nothing */
-# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
+# define ngettext(Msgid1, Msgid2, n) \
+  (n == 1 ? Msgid1 : Msgid2)
+# define dngettext(Domainname, Msgid1, Msgid2, n) \
+  (n == 1 ? Msgid1 : Msgid2)
+# define dcngettext(Domainname, Msgid1, Msgid2, n, Category) \
+  (n == 1 ? Msgid1 : Msgid2)
+# define textdomain(Domainname) do {} while (0)
+# define bindtextdomain(Domainname, Dirname) do {} while (0)
 # define _(String) (String)
 # define N_(String) (String)
 #endif
 # define _(String) (String)
 # define N_(String) (String)
 #endif
@@ -171,4 +174,31 @@ void *alloca ();
 /* Used by ar.c and objcopy.c.  */
 #define BUFSIZE 8192
 
 /* Used by ar.c and objcopy.c.  */
 #define BUFSIZE 8192
 
+/* For PATH_MAX.  */
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#ifndef PATH_MAX
+/* For MAXPATHLEN.  */
+# ifdef HAVE_SYS_PARAM_H
+#  include <sys/param.h>
+# endif
+# ifndef PATH_MAX
+#  ifdef MAXPATHLEN
+#   define PATH_MAX MAXPATHLEN
+#  else
+#   define PATH_MAX 1024
+#  endif
+# endif
+#endif
+
+#if defined HAVE_LONG_LONG && SIZEOF_LONG_LONG > SIZEOF_LONG
+/* We can't use any bfd types here since readelf may define BFD64 and
+   objdump may not.  */
+#define HOST_WIDEST_INT        long long
+#else
+#define HOST_WIDEST_INT long
+#endif
+
 #endif /* _BIN_SYSDEP_H */
 #endif /* _BIN_SYSDEP_H */