mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 07:53:51 +08:00
Apply a workaround to mitigate a quadratic performance hit in the linker when writing out secondary reloc sections.
PR 26406 * elf-bfd.h (struct bfd_elf_section_data): Add has_secondary_relocs field. * elf.c (_bfd_elf_copy_special_section_fields): Set the has_secondary_relocs field for sections which have associated secondary relocs. * elfcode.h (elf_write_relocs): Only call write_secondary_relocs on sections which have associated secondary relocs.
This commit is contained in:
@ -999,7 +999,8 @@ elf_write_relocs (bfd *abfd, asection *sec, void *data)
|
||||
(*swap_out) (abfd, &src_rela, dst_rela);
|
||||
}
|
||||
|
||||
if (!bed->write_secondary_relocs (abfd, sec))
|
||||
if (elf_section_data (sec)->has_secondary_relocs
|
||||
&& !bed->write_secondary_relocs (abfd, sec))
|
||||
{
|
||||
*failedp = TRUE;
|
||||
return;
|
||||
|
Reference in New Issue
Block a user