X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fbfd.c;h=806b9fb33f517618d9f51f6984e7b6cfa4e03896;hb=46a2d504dd875caf60f9be191a55c9ff676bcd5c;hp=f68f665d9c7e2f22ca5f42e5803c1ede3484d77a;hpb=cbd44e247ede49688e1e1fa42e57d390ad141967;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/bfd.c b/bfd/bfd.c index f68f665d9c..806b9fb33f 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -1,5 +1,5 @@ /* Generic BFD library interface and support routines. - Copyright (C) 1990-2015 Free Software Foundation, Inc. + Copyright (C) 1990-2016 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -46,7 +46,7 @@ CODE_FRAGMENT . .enum bfd_plugin_format . { -. bfd_plugin_uknown = 0, +. bfd_plugin_unknown = 0, . bfd_plugin_yes = 1, . bfd_plugin_no = 2 . }; @@ -91,7 +91,7 @@ CODE_FRAGMENT . ENUM_BITFIELD (bfd_direction) direction : 2; . . {* Format_specific flags. *} -. flagword flags : 18; +. flagword flags : 20; . . {* Values that may appear in the flags field of a BFD. These also . appear in the object_flags field of the bfd_target structure, where @@ -171,16 +171,23 @@ CODE_FRAGMENT . {* Compress sections in this BFD with SHF_COMPRESSED from gABI. *} .#define BFD_COMPRESS_GABI 0x20000 . +. {* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this +. BFD. *} +.#define BFD_CONVERT_ELF_COMMON 0x40000 +. +. {* Use the ELF STT_COMMON type in this BFD. *} +.#define BFD_USE_ELF_STT_COMMON 0x80000 +. . {* Flags bits to be saved in bfd_preserve_save. *} .#define BFD_FLAGS_SAVED \ . (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN \ -. | BFD_COMPRESS_GABI) +. | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) . . {* Flags bits which are for BFD use only. *} .#define BFD_FLAGS_FOR_BFD_USE_MASK \ . (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ . | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ -. | BFD_COMPRESS_GABI) +. | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) . . {* Is the file descriptor being cached? That is, can it be closed as . needed, and re-opened when accessed later? *} @@ -696,7 +703,8 @@ _bfd_default_error_handler (const char *fmt, ...) if (abfd == NULL) /* Invoking %B with a null bfd pointer is an internal error. */ abort (); - else if (abfd->my_archive) + else if (abfd->my_archive + && !bfd_is_thin_archive (abfd->my_archive)) snprintf (bufp, avail, "%s(%s)", abfd->my_archive->filename, abfd->filename); else @@ -2001,6 +2009,7 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents, Elf64_External_Chdr *echdr = (Elf64_External_Chdr *) contents; bfd_put_32 (abfd, ELFCOMPRESS_ZLIB, &echdr->ch_type); + bfd_put_32 (abfd, 0, &echdr->ch_reserved); bfd_put_64 (abfd, sec->size, &echdr->ch_size); bfd_put_64 (abfd, 1 << sec->alignment_power, &echdr->ch_addralign); @@ -2251,6 +2260,7 @@ bfd_convert_section_contents (bfd *ibfd, sec_ptr isec, bfd *obfd, { Elf64_External_Chdr *echdr = (Elf64_External_Chdr *) contents; bfd_put_32 (obfd, ELFCOMPRESS_ZLIB, &echdr->ch_type); + bfd_put_32 (obfd, 0, &echdr->ch_reserved); bfd_put_64 (obfd, chdr.ch_size, &echdr->ch_size); bfd_put_64 (obfd, chdr.ch_addralign, &echdr->ch_addralign); }