[PATCH] lto: fix LTO debug sections copying.

Martin Liška mliska@suse.cz
Tue Oct 6 10:20:14 GMT 2020


On 10/6/20 10:00 AM, Richard Biener wrote:
> On Tue, Oct 6, 2020 at 9:01 AM Martin Liška <mliska@suse.cz> wrote:
>>
>> On 10/5/20 6:34 PM, Ian Lance Taylor wrote:
>>> On Mon, Oct 5, 2020 at 9:09 AM Martin Liška <mliska@suse.cz> wrote:
>>>>
>>>> The previous patch was not correct. This one should be.
>>>>
>>>> Ready for master?
>>>
>>> I don't understand why this code uses symtab_indices_shndx at all.
>>> There should only be one SHT_SYMTAB_SHNDX section.  There shouldn't be
>>> any need for the symtab_indices_shndx vector.
>>
>> Well, the question is if we can have multiple .symtab sections in one ELF
>> file? Theoretically yes, so we should also handle SHT_SYMTAB_SHNDX sections.
>> Note that the original usage of the SHT_SYMTAB_SHNDX section was motivated
>> by PR81968 which is about Solaris ld.
> 
> It wasn't my code but I suppose this way the implementation was
> "easiest".  There
> should be exactly one symtab / shndx section.  Rainer authored this support.

If we expect at maximum one SHT_SYMTAB_SHNDX section section, then I'm suggesting
an updated version of the patch. It's what Ian offered.

Thoughts?
Martin

> 
>>>
>>> But in any case this patch looks OK.
> 
> I also think the patch looks OK.  Rainer?
> 
> Richard.
> 
>> Waiting for a feedback from Richi.
>>
>> Thanks,
>> Martin
>>
>>>
>>> Thanks.
>>>
>>> Ian
>>>
>>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lto-fix-LTO-debug-sections-copying.patch
Type: text/x-patch
Size: 5176 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201006/c4d6fc25/attachment.bin>


More information about the Gcc-patches mailing list