[PATCH] readelf: Warn zero-sized relocation sections

Jan Beulich jbeulich@suse.com
Tue Apr 14 13:38:02 GMT 2020


On 14.04.2020 15:30, H.J. Lu wrote:
> On Tue, Apr 14, 2020 at 6:25 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 14.04.2020 15:03, H.J. Lu wrote:
>>> On Tue, Apr 14, 2020 at 5:42 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>>
>>>> On 14.04.2020 14:25, H.J. Lu via Binutils wrote:
>>>>> Older linkers may fail with zero-sized relocation section in section
>>>>> group.
>>>>>
>>>>>       PR ld/25767
>>>>>       * readelf.c (process_section_headers): Warn zero-sized
>>>>>       relocation sections.
>>>>
>>>> Zero-sized sections of whatever kind are perfectly fine in ELF. I
>>>> see no reason why one would want to see a warning for such by
>>>> default.
>>>
>>> Linkers older than 2.35 may fail with
>>>
>>> ./ld: BFD (GNU Binutils) 2.34.50.20200402 assertion fail
>>> /export/gnu/import/git/gitlab/x86-binutils/bfd/elf.c:3652
>>
>> Which is a bug, yes, but imo no reason to clutter readelf output.
>>
> 
> When such linker failures happen, this is useful to identify why.

And hence an option to enable such a warning would seem reasonable,
but not making this default behavior.

Jan



More information about the Binutils mailing list