m->count = new_count;
}
- /* Yes, we call elf_backend_modify_segment_map at least two times
- for the linker. The final time the link_orders are available. */
bed = get_elf_backend_data (abfd);
if (bed->elf_backend_modify_segment_map != NULL)
{
unsigned int alloc;
unsigned int i;
- if (!elf_modify_segment_map (abfd, link_info))
+ if (link_info == NULL
+ && !elf_modify_segment_map (abfd, link_info))
return FALSE;
alloc = 0;
if (lp->p_type == PT_LOAD
&& lp->p_vaddr <= link_info->relro_end
&& lp->p_vaddr >= link_info->relro_start
- && lp->p_vaddr + lp->p_filesz
- >= link_info->relro_end)
+ && (lp->p_vaddr + lp->p_filesz
+ >= link_info->relro_end))
break;
}
if (!assign_file_positions_for_non_load_sections (abfd, link_info))
return FALSE;
+ if (bed->elf_backend_modify_program_headers != NULL)
+ {
+ if (!(*bed->elf_backend_modify_program_headers) (abfd, link_info))
+ return FALSE;
+ }
+
/* Write out the program headers. */
alloc = tdata->program_header_size / bed->s->sizeof_phdr;
if (bfd_seek (abfd, (bfd_signed_vma) bed->s->sizeof_ehdr, SEEK_SET) != 0