diff options
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 37 |
1 files changed, 0 insertions, 37 deletions
@@ -4376,7 +4376,6 @@ assign_file_positions_for_load_sections (bfd *abfd, unsigned int alloc; unsigned int i, j; bfd_vma header_pad = 0; - bfd_vma relro_start = 0, relro_end = 0; if (link_info == NULL && !_bfd_elf_map_sections_to_segments (abfd, link_info)) @@ -4447,23 +4446,6 @@ assign_file_positions_for_load_sections (bfd *abfd, header_pad -= off; off += header_pad; - /* Get start and end of PT_GNU_RELRO segment. */ - if (link_info != NULL) - { - relro_start = link_info->relro_start; - relro_end = link_info->relro_end; - } - else - { - for (m = elf_seg_map (abfd); m != NULL; m = m->next) - if (m->p_type == PT_GNU_RELRO) - { - relro_start = m->p_paddr; - relro_end = relro_start + m->p_size; - break; - } - } - for (m = elf_seg_map (abfd), p = phdrs, j = 0; m != NULL; m = m->next, p++, j++) @@ -4807,22 +4789,6 @@ assign_file_positions_for_load_sections (bfd *abfd, } } - if (relro_start != 0 - && p->p_type == PT_LOAD - && p->p_vaddr >= relro_start) - { - /* If PT_LOAD segment doesn't fit PT_GNU_RELRO segment, - adjust its p_filesz and p_memsz. */ - if (p->p_vaddr + p->p_filesz < relro_end) - { - bfd_vma adjust = relro_end - (p->p_vaddr + p->p_filesz); - p->p_filesz += adjust; - off += adjust; - } - if (p->p_vaddr + p->p_memsz < relro_end) - p->p_memsz += relro_end - (p->p_vaddr + p->p_memsz); - } - off -= off_adjust; /* Check that all sections are in a PT_LOAD segment. @@ -5024,14 +4990,11 @@ assign_file_positions_for_non_load_sections (bfd *abfd, { if (lp->p_type == PT_LOAD && lp->p_vaddr < link_info->relro_end - && lp->p_vaddr + lp->p_filesz >= link_info->relro_end && lm->count != 0 && lm->sections[0]->vma >= link_info->relro_start) break; } - /* PR ld/14207. If the RELRO segment doesn't fit in the - LOAD segment, it should be removed. */ BFD_ASSERT (lm != NULL); } else |