• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revision55172d69d08941ecb3bb1abd640f22abca10de47 (tree)
Time2015-02-11 19:04:47
AuthorPedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

Wrap BFD headers in extern "C"

These were the BFD changes needed for building a C++ GDB with
--enable-targets=all, on x86_64 Fedora 20.

For libbfd.h and libcoff.h, this does same as already done when
generating bfd.h: open extern "C" in the -in.h header, and close it
from the Makefile.

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

* Makefile.am (libbfd.h, libcoff.h): Close extern "C" scope.
* Makefile.in: Regenerate.

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

* libbfd-in.h [__cplusplus]: Open extern "C" scope.
* libcoff-in.h [__cplusplus]: Open extern "C" scope.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.

* elf-bfd.h [__cplusplus]: Wrap in extern "C".
* mach-o.h [__cplusplus]: Wrap in extern "C".
* som.h [__cplusplus]: Wrap in extern "C".

Change Summary

Incremental Difference

--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,14 @@
1+2015-02-11 Pedro Alves <palves@redhat.com>
2+
3+ * libbfd-in.h [__cplusplus]: Open extern "C" scope.
4+ * libcoff-in.h [__cplusplus]: Open extern "C" scope.
5+ * libbfd.h: Regenerate.
6+ * libcoff.h: Regenerate.
7+
8+ * elf-bfd.h [__cplusplus]: Wrap in extern "C".
9+ * mach-o.h [__cplusplus]: Wrap in extern "C".
10+ * som.h [__cplusplus]: Wrap in extern "C".
11+
112 2015-02-10 Nick Clifton <nickc@redhat.com>
213
314 PR binutils/17512
--- a/bfd/doc/ChangeLog
+++ b/bfd/doc/ChangeLog
@@ -1,3 +1,8 @@
1+2015-02-11 Pedro Alves <palves@redhat.com>
2+
3+ * Makefile.am (libbfd.h, libcoff.h): Close extern "C" scope.
4+ * Makefile.in: Regenerate.
5+
16 2015-01-12 Bernd Edlinger <bernd.edlinger@hotmail.de>
27 Alan Modra <amodra@gmail.com>
38
--- a/bfd/doc/Makefile.am
+++ b/bfd/doc/Makefile.am
@@ -275,6 +275,9 @@ libbfd.h: $(LIBBFD_H_DEP)
275275 ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
276276 esac; \
277277 done
278+ echo "#ifdef __cplusplus" >> $@
279+ echo "}" >> $@
280+ echo "#endif" >> $@
278281
279282 LIBCOFF_H_DEP = \
280283 $(srcdir)/../libcoff-in.h \
@@ -294,6 +297,9 @@ libcoff.h: $(LIBCOFF_H_DEP)
294297 ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
295298 esac; \
296299 done
300+ echo "#ifdef __cplusplus" >> $@
301+ echo "}" >> $@
302+ echo "#endif" >> $@
297303
298304 BFD_H_DEP = \
299305 $(srcdir)/../bfd-in.h \
--- a/bfd/doc/Makefile.in
+++ b/bfd/doc/Makefile.in
@@ -960,6 +960,9 @@ libbfd.h: $(LIBBFD_H_DEP)
960960 ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
961961 esac; \
962962 done
963+ echo "#ifdef __cplusplus" >> $@
964+ echo "}" >> $@
965+ echo "#endif" >> $@
963966
964967 libcoff.h: $(LIBCOFF_H_DEP)
965968 echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@
@@ -972,6 +975,9 @@ libcoff.h: $(LIBCOFF_H_DEP)
972975 ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \
973976 esac; \
974977 done
978+ echo "#ifdef __cplusplus" >> $@
979+ echo "}" >> $@
980+ echo "#endif" >> $@
975981
976982 bfd.h: $(BFD_H_DEP)
977983 echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -27,6 +27,10 @@
2727 #include "elf/internal.h"
2828 #include "bfdlink.h"
2929
30+#ifdef __cplusplus
31+extern "C" {
32+#endif
33+
3034 /* The number of entries in a section is its size divided by the size
3135 of a single entry. This is normally only applicable to reloc and
3236 symbol table sections.
@@ -2540,4 +2544,7 @@ extern asection _bfd_elf_large_com_section;
25402544 (!(H)->unique_global \
25412545 && ((INFO)->symbolic || ((INFO)->dynamic && !(H)->dynamic)))
25422546
2547+#ifdef __cplusplus
2548+}
2549+#endif
25432550 #endif /* _LIBELF_H_ */
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -24,6 +24,10 @@
2424
2525 #include "hashtab.h"
2626
27+#ifdef __cplusplus
28+extern "C" {
29+#endif
30+
2731 /* Align an address upward to a boundary, expressed as a number of bytes.
2832 E.g. align to an 8-byte boundary with argument of 8. Take care never
2933 to wrap around if the address is within boundary-1 of the end of the
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -29,6 +29,10 @@
2929
3030 #include "hashtab.h"
3131
32+#ifdef __cplusplus
33+extern "C" {
34+#endif
35+
3236 /* Align an address upward to a boundary, expressed as a number of bytes.
3337 E.g. align to an 8-byte boundary with argument of 8. Take care never
3438 to wrap around if the address is within boundary-1 of the end of the
@@ -3015,3 +3019,6 @@ void *bfd_arch_default_fill (bfd_size_type count,
30153019 bfd_boolean code);
30163020
30173021 /* Extracted from elf.c. */
3022+#ifdef __cplusplus
3023+}
3024+#endif
--- a/bfd/libcoff-in.h
+++ b/bfd/libcoff-in.h
@@ -22,6 +22,10 @@
2222 #include "bfdlink.h"
2323 #include "coff-bfd.h"
2424
25+#ifdef __cplusplus
26+extern "C" {
27+#endif
28+
2529 /* Object file tdata; access macros. */
2630
2731 #define coff_data(bfd) ((bfd)->tdata.coff_obj_data)
--- a/bfd/libcoff.h
+++ b/bfd/libcoff.h
@@ -26,6 +26,10 @@
2626 #include "bfdlink.h"
2727 #include "coff-bfd.h"
2828
29+#ifdef __cplusplus
30+extern "C" {
31+#endif
32+
2933 /* Object file tdata; access macros. */
3034
3135 #define coff_data(bfd) ((bfd)->tdata.coff_obj_data)
@@ -951,3 +955,6 @@ typedef struct
951955 PE object file. */
952956 #define bfd_pei_p(abfd) \
953957 (CONST_STRNEQ ((abfd)->xvec->name, "pei-"))
958+#ifdef __cplusplus
959+}
960+#endif
--- a/bfd/mach-o.h
+++ b/bfd/mach-o.h
@@ -24,6 +24,10 @@
2424 #include "bfd.h"
2525 #include "mach-o/loader.h"
2626
27+#ifdef __cplusplus
28+extern "C" {
29+#endif
30+
2731 typedef struct bfd_mach_o_header
2832 {
2933 unsigned long magic;
@@ -746,4 +750,8 @@ bfd_mach_o_backend_data;
746750 #define SYM_MACHO_FIELDS_UNSET ((bfd_vma) -1)
747751 #define SYM_MACHO_FIELDS_NOT_VALIDATED ((bfd_vma) -2)
748752
753+#ifdef __cplusplus
754+}
755+#endif
756+
749757 #endif /* _BFD_MACH_O_H_ */
--- a/bfd/som.h
+++ b/bfd/som.h
@@ -40,6 +40,10 @@
4040 #include <dl.h>
4141 #endif
4242
43+#ifdef __cplusplus
44+extern "C" {
45+#endif
46+
4347 #if defined (HOST_HPPABSD) || defined (HOST_HPPAOSF)
4448 /* BSD uses a completely different scheme for object file identification.
4549 so for now, define _PA_RISC_ID to accept any random value for a model
@@ -235,4 +239,7 @@ int ** hppa_som_gen_reloc_type (bfd *, int, int, enum hppa_reloc
235239 bfd_boolean bfd_som_attach_compilation_unit (bfd *, const char *, const char *, const char *, const char *);
236240 asection * bfd_section_from_som_symbol (bfd *abfd, struct som_external_symbol_dictionary_record *symbol);
237241
242+#ifdef __cplusplus
243+}
244+#endif
238245 #endif /* _SOM_H */