aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-08-20 10:19:47 +0100
committerNick Clifton <nickc@redhat.com>2020-08-20 10:19:47 +0100
commit44466e45c51b1c68ed2f95f86bcdb1f18f08b380 (patch)
tree1ff4a510d9fbf38f3c03274b8b5b93018c177bf9 /bfd/elfcode.h
parentc2fd7faea8f2c3a267f276ceb6a95f9f537ea7c1 (diff)
downloadgdb-44466e45c51b1c68ed2f95f86bcdb1f18f08b380.zip
gdb-44466e45c51b1c68ed2f95f86bcdb1f18f08b380.tar.gz
gdb-44466e45c51b1c68ed2f95f86bcdb1f18f08b380.tar.bz2
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.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 84b08b5..2ed2f13 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -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;