aboutsummaryrefslogtreecommitdiff
path: root/ld/ldelfgen.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-01-06 08:45:16 -0800
committerH.J. Lu <hjl.tools@gmail.com>2022-01-12 05:15:18 -0800
commite2cbf4df83fe57892a6aaedf737b84baa6321fa7 (patch)
tree900d45cb8e5c64d097999b4532be7d38753c645e /ld/ldelfgen.c
parentfc07cf22c679002bb57e9259eca5dfd6891eb962 (diff)
downloadgdb-e2cbf4df83fe57892a6aaedf737b84baa6321fa7.zip
gdb-e2cbf4df83fe57892a6aaedf737b84baa6321fa7.tar.gz
gdb-e2cbf4df83fe57892a6aaedf737b84baa6321fa7.tar.bz2
elf: Pass need_layout to _bfd_elf_map_sections_to_segments
On some targets, the DT_RELR section size can be computed only after all symbols addresses can be determined. Update ldelf_map_segments to pass need_layout to _bfd_elf_map_sections_to_segments which will size DT_RELR section and set need_layout to true if the DT_RELR section size is changed. bfd/ * elf-bfd.h (_bfd_elf_map_sections_to_segments): Add a bool pointer argument. * elf.c (_bfd_elf_map_sections_to_segments): Add a bool pointer argument to indicate if section layout needs update. (assign_file_positions_for_load_sections): Pass NULL to _bfd_elf_map_sections_to_segments. * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): Pass NULL to _bfd_elf_map_sections_to_segments. ld/ * ldelfgen.c (ldelf_map_segments): Pass &need_layout to _bfd_elf_map_sections_to_segments.
Diffstat (limited to 'ld/ldelfgen.c')
-rw-r--r--ld/ldelfgen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ld/ldelfgen.c b/ld/ldelfgen.c
index 5c033bb..58b37c6 100644
--- a/ld/ldelfgen.c
+++ b/ld/ldelfgen.c
@@ -304,7 +304,8 @@ ldelf_map_segments (bool need_layout)
if (lang_phdr_list == NULL)
elf_seg_map (link_info.output_bfd) = NULL;
if (!_bfd_elf_map_sections_to_segments (link_info.output_bfd,
- &link_info))
+ &link_info,
+ &need_layout))
einfo (_("%F%P: map sections to segments failed: %E\n"));
if (phdr_size != elf_program_header_size (link_info.output_bfd))