diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-10-06 14:34:17 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-10-06 14:34:17 -0700 |
commit | 8c6da3dfbc65354975680bf7d8e273dbdca5de87 (patch) | |
tree | 8fb908ec343ee21d9f26337c12f9babc661cc358 /bfd/bfd.c | |
parent | cbd641edf3323ce354c0bc7eb54496057040b564 (diff) | |
download | gdb-8c6da3dfbc65354975680bf7d8e273dbdca5de87.zip gdb-8c6da3dfbc65354975680bf7d8e273dbdca5de87.tar.gz gdb-8c6da3dfbc65354975680bf7d8e273dbdca5de87.tar.bz2 |
Clear the ch_reserved field in 64-bit output
It is better to clear the ch_reserved field of Elf64_External_Chdr
in 64-bit output.
* bfd.c (bfd_update_compression_header): Clear the ch_reserved
field in 64-bit output.
(bfd_convert_section_contents): Likewise.
Diffstat (limited to 'bfd/bfd.c')
-rw-r--r-- | bfd/bfd.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2001,6 +2001,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 +2252,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); } |