riscv: Cache the max alignment of output sections
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 10 Oct 2017 05:03:42 +0000 (22:03 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 10 Oct 2017 05:04:00 +0000 (22:04 -0700)
commitfc3c534364ca6d6de4f0dbcaf347ec85f5e2f8ff
tree6c238d0947b088bfc688ed2be95db1314a296232
parentb9399fcf4ec90d898a610e39bd9141e85c008fbb
riscv: Cache the max alignment of output sections

Cache the max alignment of output sections instead of scanning all
output sections for each input section, which can take a very long
time if there are millions of input/output sections.

PR ld/22274
* elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
(riscv_elf_link_hash_table_create): Initialize max_alignment to
(bfd_vma) -1.
(_bfd_riscv_relax_section): Cache the max alignment of output
sections if possible.
bfd/ChangeLog
bfd/elfnn-riscv.c