GNU Binutils with patches for OS216
Revision | 55172d69d08941ecb3bb1abd640f22abca10de47 (tree) |
---|---|
Time | 2015-02-11 19:04:47 |
Author | Pedro Alves <palves@redh...> |
Commiter | Pedro Alves |
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".
@@ -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 | + | |
1 | 12 | 2015-02-10 Nick Clifton <nickc@redhat.com> |
2 | 13 | |
3 | 14 | PR binutils/17512 |
@@ -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 | + | |
1 | 6 | 2015-01-12 Bernd Edlinger <bernd.edlinger@hotmail.de> |
2 | 7 | Alan Modra <amodra@gmail.com> |
3 | 8 |
@@ -275,6 +275,9 @@ libbfd.h: $(LIBBFD_H_DEP) | ||
275 | 275 | ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ |
276 | 276 | esac; \ |
277 | 277 | done |
278 | + echo "#ifdef __cplusplus" >> $@ | |
279 | + echo "}" >> $@ | |
280 | + echo "#endif" >> $@ | |
278 | 281 | |
279 | 282 | LIBCOFF_H_DEP = \ |
280 | 283 | $(srcdir)/../libcoff-in.h \ |
@@ -294,6 +297,9 @@ libcoff.h: $(LIBCOFF_H_DEP) | ||
294 | 297 | ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ |
295 | 298 | esac; \ |
296 | 299 | done |
300 | + echo "#ifdef __cplusplus" >> $@ | |
301 | + echo "}" >> $@ | |
302 | + echo "#endif" >> $@ | |
297 | 303 | |
298 | 304 | BFD_H_DEP = \ |
299 | 305 | $(srcdir)/../bfd-in.h \ |
@@ -960,6 +960,9 @@ libbfd.h: $(LIBBFD_H_DEP) | ||
960 | 960 | ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ |
961 | 961 | esac; \ |
962 | 962 | done |
963 | + echo "#ifdef __cplusplus" >> $@ | |
964 | + echo "}" >> $@ | |
965 | + echo "#endif" >> $@ | |
963 | 966 | |
964 | 967 | libcoff.h: $(LIBCOFF_H_DEP) |
965 | 968 | echo "$(LIBCOFF_H_DEP)" | sed -f $(srcdir)/header.sed > $@ |
@@ -972,6 +975,9 @@ libcoff.h: $(LIBCOFF_H_DEP) | ||
972 | 975 | ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ |
973 | 976 | esac; \ |
974 | 977 | done |
978 | + echo "#ifdef __cplusplus" >> $@ | |
979 | + echo "}" >> $@ | |
980 | + echo "#endif" >> $@ | |
975 | 981 | |
976 | 982 | bfd.h: $(BFD_H_DEP) |
977 | 983 | echo "$(BFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@ |
@@ -27,6 +27,10 @@ | ||
27 | 27 | #include "elf/internal.h" |
28 | 28 | #include "bfdlink.h" |
29 | 29 | |
30 | +#ifdef __cplusplus | |
31 | +extern "C" { | |
32 | +#endif | |
33 | + | |
30 | 34 | /* The number of entries in a section is its size divided by the size |
31 | 35 | of a single entry. This is normally only applicable to reloc and |
32 | 36 | symbol table sections. |
@@ -2540,4 +2544,7 @@ extern asection _bfd_elf_large_com_section; | ||
2540 | 2544 | (!(H)->unique_global \ |
2541 | 2545 | && ((INFO)->symbolic || ((INFO)->dynamic && !(H)->dynamic))) |
2542 | 2546 | |
2547 | +#ifdef __cplusplus | |
2548 | +} | |
2549 | +#endif | |
2543 | 2550 | #endif /* _LIBELF_H_ */ |
@@ -24,6 +24,10 @@ | ||
24 | 24 | |
25 | 25 | #include "hashtab.h" |
26 | 26 | |
27 | +#ifdef __cplusplus | |
28 | +extern "C" { | |
29 | +#endif | |
30 | + | |
27 | 31 | /* Align an address upward to a boundary, expressed as a number of bytes. |
28 | 32 | E.g. align to an 8-byte boundary with argument of 8. Take care never |
29 | 33 | to wrap around if the address is within boundary-1 of the end of the |
@@ -29,6 +29,10 @@ | ||
29 | 29 | |
30 | 30 | #include "hashtab.h" |
31 | 31 | |
32 | +#ifdef __cplusplus | |
33 | +extern "C" { | |
34 | +#endif | |
35 | + | |
32 | 36 | /* Align an address upward to a boundary, expressed as a number of bytes. |
33 | 37 | E.g. align to an 8-byte boundary with argument of 8. Take care never |
34 | 38 | 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, | ||
3015 | 3019 | bfd_boolean code); |
3016 | 3020 | |
3017 | 3021 | /* Extracted from elf.c. */ |
3022 | +#ifdef __cplusplus | |
3023 | +} | |
3024 | +#endif |
@@ -22,6 +22,10 @@ | ||
22 | 22 | #include "bfdlink.h" |
23 | 23 | #include "coff-bfd.h" |
24 | 24 | |
25 | +#ifdef __cplusplus | |
26 | +extern "C" { | |
27 | +#endif | |
28 | + | |
25 | 29 | /* Object file tdata; access macros. */ |
26 | 30 | |
27 | 31 | #define coff_data(bfd) ((bfd)->tdata.coff_obj_data) |
@@ -26,6 +26,10 @@ | ||
26 | 26 | #include "bfdlink.h" |
27 | 27 | #include "coff-bfd.h" |
28 | 28 | |
29 | +#ifdef __cplusplus | |
30 | +extern "C" { | |
31 | +#endif | |
32 | + | |
29 | 33 | /* Object file tdata; access macros. */ |
30 | 34 | |
31 | 35 | #define coff_data(bfd) ((bfd)->tdata.coff_obj_data) |
@@ -951,3 +955,6 @@ typedef struct | ||
951 | 955 | PE object file. */ |
952 | 956 | #define bfd_pei_p(abfd) \ |
953 | 957 | (CONST_STRNEQ ((abfd)->xvec->name, "pei-")) |
958 | +#ifdef __cplusplus | |
959 | +} | |
960 | +#endif |
@@ -24,6 +24,10 @@ | ||
24 | 24 | #include "bfd.h" |
25 | 25 | #include "mach-o/loader.h" |
26 | 26 | |
27 | +#ifdef __cplusplus | |
28 | +extern "C" { | |
29 | +#endif | |
30 | + | |
27 | 31 | typedef struct bfd_mach_o_header |
28 | 32 | { |
29 | 33 | unsigned long magic; |
@@ -746,4 +750,8 @@ bfd_mach_o_backend_data; | ||
746 | 750 | #define SYM_MACHO_FIELDS_UNSET ((bfd_vma) -1) |
747 | 751 | #define SYM_MACHO_FIELDS_NOT_VALIDATED ((bfd_vma) -2) |
748 | 752 | |
753 | +#ifdef __cplusplus | |
754 | +} | |
755 | +#endif | |
756 | + | |
749 | 757 | #endif /* _BFD_MACH_O_H_ */ |
@@ -40,6 +40,10 @@ | ||
40 | 40 | #include <dl.h> |
41 | 41 | #endif |
42 | 42 | |
43 | +#ifdef __cplusplus | |
44 | +extern "C" { | |
45 | +#endif | |
46 | + | |
43 | 47 | #if defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) |
44 | 48 | /* BSD uses a completely different scheme for object file identification. |
45 | 49 | 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 | ||
235 | 239 | bfd_boolean bfd_som_attach_compilation_unit (bfd *, const char *, const char *, const char *, const char *); |
236 | 240 | asection * bfd_section_from_som_symbol (bfd *abfd, struct som_external_symbol_dictionary_record *symbol); |
237 | 241 | |
242 | +#ifdef __cplusplus | |
243 | +} | |
244 | +#endif | |
238 | 245 | #endif /* _SOM_H */ |