]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Move 'enum bfd_endian' to a non-generated header
authorPedro Alves <palves@redhat.com>
Thu, 11 Feb 2016 11:35:04 +0000 (11:35 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 11 Feb 2016 11:35:04 +0000 (11:35 +0000)
Because:

- GDB uses enum bfd_endian extensively.
- gdbserver does not build/link-with bfd.
- We'd like to share more code between gdb and gdbserver.

It'd make our lives easier if we could just use bfd_endian in
gdbserver as well.

The problem is that bfd_endian is defined in a header that only exists
if bfd is built/configured.

Thus this moves bfd_endian to a separate header, so gdbserver can
include it.

bfd/ChangeLog:
2016-02-11  Pedro Alves  <palves@redhat.com>

* bfd-in.h: Include bfd-types.h
* bfd-in2.h: Regenerate.
* targets.c (enum bfd_endian): Moved to include/bfd-types.h.

include/ChangeLog:
2016-02-11  Pedro Alves  <palves@redhat.com>

* bfd-types.h: New file.

bfd/bfd-in.h
bfd/bfd-in2.h
bfd/targets.c
include/bfd-types.h [new file with mode: 0644]

index 5df2babf88b094524b11e8edf3ba6a6acaf1d3b8..277ca5f2de05401d26792cfd173952f4c731eca4 100644 (file)
@@ -35,6 +35,7 @@ extern "C" {
 #include "ansidecl.h"
 #include "symcat.h"
 #include <sys/stat.h>
+#include "bfd-types.h"
 
 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
 #ifndef SABER
index fb4858c5bd2c1680af8467b4a4b34eb3903c3c79..0d6b40f5e3b1df249fd26a8f344e8a600e872215 100644 (file)
@@ -42,6 +42,7 @@ extern "C" {
 #include "ansidecl.h"
 #include "symcat.h"
 #include <sys/stat.h>
+#include "bfd-types.h"
 
 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
 #ifndef SABER
@@ -7124,8 +7125,6 @@ enum bfd_flavour
   bfd_target_sym_flavour
 };
 
-enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
-
 /* Forward declaration.  */
 typedef struct bfd_link_info _bfd_link_info;
 
index 50f3712be015b351e77b58393ceaa969e9ca65f9..a2ee6ee6900b5ee933d9848e5444b602d6386970 100644 (file)
@@ -171,8 +171,6 @@ DESCRIPTION
 .  bfd_target_sym_flavour
 .};
 .
-.enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
-.
 .{* Forward declaration.  *}
 .typedef struct bfd_link_info _bfd_link_info;
 .
diff --git a/include/bfd-types.h b/include/bfd-types.h
new file mode 100644 (file)
index 0000000..816fac4
--- /dev/null
@@ -0,0 +1,26 @@
+/* bfd core types that do not depend on configuration.
+
+   Copyright (C) 1990-2016 Free Software Foundation, Inc.
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   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, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef BFD_TYPES_H
+#define BFD_TYPES_H
+
+enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
+
+#endif