Change ch_type to Elf_Word in struct Chdr_data<64>
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 4 Oct 2015 13:14:13 +0000 (06:14 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 4 Oct 2015 13:14:36 +0000 (06:14 -0700)
The ch_type field in struct Chdr_data<64>  is 4 bytes, followed by a
4-byte padding.  This change doesn't introduce any functional change
since only the lower 32 bits of the ch_type field are used.

PR gold/19060
* elfcpp.h (Chdr::get_ch_type): Change return type to Elf_Word.
* elfcpp_internal.h (Chdr_data<64>): Change ch_type to 4 bytes
and add ch_reserved.

elfcpp/ChangeLog
elfcpp/elfcpp.h
elfcpp/elfcpp_internal.h

index 3342ac945432f7ba4e986820b1088db0505a2e7b..042d86ecbb2cedd878780bfcc945c9c2418a7abe 100644 (file)
@@ -1,3 +1,10 @@
+2015-10-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gold/19060
+       * elfcpp.h (Chdr::get_ch_type): Change return type to Elf_Word.
+       * elfcpp_internal.h (Chdr_data<64>): Change ch_type to 4 bytes
+       and add ch_reserved.
+
 2015-04-08  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elfcpp.h (Elf_sizes): Add chdr_size.
index 722984e5452bbec8b64d446e99a74bcac5d43342..70380a5a32a72549f3ad9ea0ab9744811f94ecc4 100644 (file)
@@ -1302,7 +1302,7 @@ class Chdr
           file->view(loc.file_offset, loc.data_size).data()))
   { }
 
-  typename Elf_types<size>::Elf_WXword
+  Elf_Word
   get_ch_type() const
   { return Convert<size, big_endian>::convert_host(this->p_->ch_type); }
 
index 424a1f6f713f173aaaf8e7b911b17d1cd2c46cad..6f9dd4887a20a4e7a2793d97de7d16a508aad1cf 100644 (file)
@@ -82,11 +82,23 @@ struct Shdr_data
 // An ELF compression header.
 
 template<int size>
-struct Chdr_data
+struct Chdr_data;
+
+template<>
+struct Chdr_data<32>
+{
+  Elf_Word ch_type;
+  Elf_Word ch_size;
+  Elf_Word ch_addralign;
+};
+
+template<>
+struct Chdr_data<64>
 {
-  typename Elf_types<size>::Elf_WXword ch_type;
-  typename Elf_types<size>::Elf_WXword ch_size;
-  typename Elf_types<size>::Elf_WXword ch_addralign;
+  Elf_Word ch_type;
+  Elf_Word ch_reserved;
+  Elf_Xword ch_size;
+  Elf_Xword ch_addralign;
 };
 
 // An ELF segment header.  We use template specialization for the
This page took 0.026208 seconds and 4 git commands to generate.