[PATCH v2] riscv: Ignore attributes in input file with empty code section
Jan Beulich
jbeulich@suse.com
Tue Jun 2 08:04:08 GMT 2026
On 28.05.2026 23:45, H.J. Lu wrote:
> On Thu, May 28, 2026 at 5:29 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>>
>> Ignore empty and .note.gnu.build-id sections when merging attributes.
>> The following linker tests now pass for riscv:
>>
>> FAIL: Diagnostics - Wrong magic number mixed with valid CTF sections
>> FAIL: --gc-sections with --defsym
>> FAIL: --gc-sections with KEEP
>> FAIL: --gc-sections with __start_SECTIONNAME
>> FAIL: ld-plugin/lto-10r
>> FAIL: ld-plugin/lto-3r
>> FAIL: ld-plugin/lto-4r-a
>> FAIL: ld-plugin/lto-4r-b
>> FAIL: ld-plugin/lto-4r-c
>> FAIL: ld-plugin/lto-4r-d
>> FAIL: ld-plugin/lto-5r
>> FAIL: PR ld/19317 (2)
>> FAIL: PR ld/19317 (3)
>>
>> PR ld/34185
>> * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Ignore
>> attributes in empty input file
>
> Here is the v2 patch to ignore attributes in input file with empty code section
> when merging attributes.
I'm not sure if this is correct: Attributes may have a meaning even if there are
only empty code sections (or none at all). RISC-V folks will need to comment
here.
Jan
More information about the Binutils
mailing list