diff options
author | Pedro Alves <palves@redhat.com> | 2016-02-11 11:35:04 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2016-02-11 11:35:04 +0000 |
commit | dd4a4f86240eac1262c760b6109b42242e007923 (patch) | |
tree | 760d435ad3493a5cab94dc130fee963fd6995b54 | |
parent | 32875eb1f3b928dfe63c5752e8152a9dc09928f3 (diff) | |
download | gdb-dd4a4f86240eac1262c760b6109b42242e007923.zip gdb-dd4a4f86240eac1262c760b6109b42242e007923.tar.gz gdb-dd4a4f86240eac1262c760b6109b42242e007923.tar.bz2 |
Move 'enum bfd_endian' to a non-generated header
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.
-rw-r--r-- | bfd/bfd-in.h | 1 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 3 | ||||
-rw-r--r-- | bfd/targets.c | 2 | ||||
-rw-r--r-- | include/bfd-types.h | 26 |
4 files changed, 28 insertions, 4 deletions
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 5df2bab..277ca5f 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -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 diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index fb4858c..0d6b40f 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -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; diff --git a/bfd/targets.c b/bfd/targets.c index 50f3712..a2ee6ee 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -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 index 0000000..816fac4 --- /dev/null +++ b/include/bfd-types.h @@ -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 |