[committed, PATCH] Extract get_uncompressed_size
H.J. Lu
hjl.tools@gmail.com
Mon Apr 6 16:04:00 GMT 2015
On Sun, Apr 5, 2015 at 9:26 PM, Hans-Peter Nilsson <hp@bitrange.com> wrote:
> On Sat, 4 Apr 2015, H.J. Lu wrote:
>>
>> * compress.c (get_uncompressed_size): New. Extracted from ...
>> (bfd_init_section_decompress_status): This. Use it.
>
>> +static bfd_size_type
>> +get_uncompressed_size (bfd_byte *compressed_size_buffer)
>> +{
>> + bfd_size_type uncompressed_size = compressed_size_buffer[0];
>> + uncompressed_size <<= 8;
> ...
>
>> + uncompressed_size += compressed_size_buffer[7];
>> + return uncompressed_size;;
>> +}
>
> I know you're just copying code, but for the next copy, please
> consider also change to use bfd functions, in this case bfd_getb64?
>
Thanks for the suggestion. I checked in this patch:
bfd/
* compress.c (get_uncompressed_size): Removed.
(bfd_compress_section_contents): Use bfd_putb64 to write
uncompressed section size.
(bfd_init_section_decompress_status): Replace
get_uncompressed_size with bfd_getb64.
gas/
* write.c (compress_debug): Use bfd_putb64 to write uncompressed
section size.
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Use-bfd_putb64-bfd_getb64.patch
Type: text/x-patch
Size: 5035 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150406/363a796c/attachment.bin>
More information about the Binutils
mailing list