Révision | 9706b5e627dfae1ab0a2788dda8a2aa5a0e09af7 (tree) |
---|---|
l'heure | 2015-10-04 22:14:36 |
Auteur | H.J. Lu <hjl.tools@gmai...> |
Commiter | H.J. Lu |
Change ch_type to Elf_Word in struct Chdr_data<64>
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.
@@ -1,3 +1,10 @@ | ||
1 | +2015-10-02 H.J. Lu <hongjiu.lu@intel.com> | |
2 | + | |
3 | + PR gold/19060 | |
4 | + * elfcpp.h (Chdr::get_ch_type): Change return type to Elf_Word. | |
5 | + * elfcpp_internal.h (Chdr_data<64>): Change ch_type to 4 bytes | |
6 | + and add ch_reserved. | |
7 | + | |
1 | 8 | 2015-04-08 H.J. Lu <hongjiu.lu@intel.com> |
2 | 9 | |
3 | 10 | * elfcpp.h (Elf_sizes): Add chdr_size. |
@@ -1302,7 +1302,7 @@ class Chdr | ||
1302 | 1302 | file->view(loc.file_offset, loc.data_size).data())) |
1303 | 1303 | { } |
1304 | 1304 | |
1305 | - typename Elf_types<size>::Elf_WXword | |
1305 | + Elf_Word | |
1306 | 1306 | get_ch_type() const |
1307 | 1307 | { return Convert<size, big_endian>::convert_host(this->p_->ch_type); } |
1308 | 1308 |
@@ -82,11 +82,23 @@ struct Shdr_data | ||
82 | 82 | // An ELF compression header. |
83 | 83 | |
84 | 84 | template<int size> |
85 | -struct Chdr_data | |
85 | +struct Chdr_data; | |
86 | + | |
87 | +template<> | |
88 | +struct Chdr_data<32> | |
89 | +{ | |
90 | + Elf_Word ch_type; | |
91 | + Elf_Word ch_size; | |
92 | + Elf_Word ch_addralign; | |
93 | +}; | |
94 | + | |
95 | +template<> | |
96 | +struct Chdr_data<64> | |
86 | 97 | { |
87 | - typename Elf_types<size>::Elf_WXword ch_type; | |
88 | - typename Elf_types<size>::Elf_WXword ch_size; | |
89 | - typename Elf_types<size>::Elf_WXword ch_addralign; | |
98 | + Elf_Word ch_type; | |
99 | + Elf_Word ch_reserved; | |
100 | + Elf_Xword ch_size; | |
101 | + Elf_Xword ch_addralign; | |
90 | 102 | }; |
91 | 103 | |
92 | 104 | // An ELF segment header. We use template specialization for the |