forked from Imagelibrary/binutils-gdb
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.
This commit is contained in:
@@ -4609,10 +4609,13 @@ elf_modify_segment_map (bfd *abfd,
|
||||
#define IS_TBSS(s) \
|
||||
((s->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) == SEC_THREAD_LOCAL)
|
||||
|
||||
/* Set up a mapping from BFD sections to program segments. */
|
||||
/* Set up a mapping from BFD sections to program segments. Update
|
||||
NEED_LAYOUT if the section layout is changed. */
|
||||
|
||||
bool
|
||||
_bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
|
||||
_bfd_elf_map_sections_to_segments (bfd *abfd,
|
||||
struct bfd_link_info *info,
|
||||
bool *need_layout ATTRIBUTE_UNUSED)
|
||||
{
|
||||
unsigned int count;
|
||||
struct elf_segment_map *m;
|
||||
@@ -5416,7 +5419,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
|
||||
unsigned int opb = bfd_octets_per_byte (abfd, NULL);
|
||||
|
||||
if (link_info == NULL
|
||||
&& !_bfd_elf_map_sections_to_segments (abfd, link_info))
|
||||
&& !_bfd_elf_map_sections_to_segments (abfd, link_info, NULL))
|
||||
return false;
|
||||
|
||||
alloc = 0;
|
||||
|
||||
Reference in New Issue
Block a user