[PATCH] Add SHF_COMPRESSED support to gas and objcopy

H.J. Lu hjl.tools@gmail.com
Wed Apr 8 14:56:00 GMT 2015


On Wed, Apr 8, 2015 at 6:18 AM, Alan Modra <amodra@gmail.com> wrote:
> On Mon, Apr 06, 2015 at 12:32:08PM -0700, H.J. Lu wrote:
>> diff --git a/bfd/elf.c b/bfd/elf.c
>> index cbc0c91..2335eb6 100644
>> --- a/bfd/elf.c
>> +++ b/bfd/elf.c
>> @@ -1069,6 +1078,8 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
>>                abfd, name);
>>             return FALSE;
>>           }
>> +       if ((abfd->flags & BFD_COMPRESS_GABI) != 0)
>> +         goto remove_z;
>>         /* PR binutils/18087: Compression does not always make a section
>>            smaller.  So only rename the section when compression has
>>            actually taken place.  */
>> @@ -1095,6 +1106,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
>>                abfd, name);
>>             return FALSE;
>>           }
>> +remove_z:
>>         if (name[1] == 'z')
>>           {
>>             unsigned int len = strlen (name);
>
> I think this would be better if you moved the new_name code out of the
> switch.
>
>       new_name = NULL;
>       if (action == decompress
>           || (action == compress && (abfd->flags & BFD_COMPRESS_GABI) != 0))
>         {
>           remove z code
>         }
>       else if (action == compress)
>         {
>           add z code
>         }
>       if (new_name != NULL)
>         bfd_rename_section (abfd, newsect, new_name);
>
> With this change the patch is OK.
>

Done.  This is what I checked in.

Thanks.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-SHF_COMPRESSED-support-to-gas-and-objcopy.patch
Type: text/x-patch
Size: 73075 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150408/447545f2/attachment.bin>


More information about the Binutils mailing list