return result;
}
-/* Mmap in section contents. If FINAL_LINK is false, set *BUF to NULL
- before calling bfd_get_full_section_contents. */
+/* Mmap in section contents. */
static bool
-elf_mmap_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **buf,
- bool final_link)
+elf_mmap_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **buf)
{
#ifdef USE_MMAP
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
abort ();
sec->mmapped_p = 1;
- /* Never use the preallocated buffer if mmapp is used. */
+ /* We can't use the final link preallocated buffer for mmap. */
*buf = NULL;
}
}
#endif
- /* NB: When this is called from elf_link_input_bfd, FINAL_LINK is
- true. If FINAL_LINK is false, *BUF is set to the preallocated
- buffer if USE_MMAP is undefined and *BUF is set to NULL if
- USE_MMAP is defined. */
- if (!final_link)
- *buf = NULL;
bool ret = bfd_get_full_section_contents (abfd, sec, buf);
if (ret && sec->mmapped_p)
*buf = sec->contents;
bool
_bfd_elf_mmap_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **buf)
{
- return elf_mmap_section_contents (abfd, sec, buf, false);
+ *buf = NULL;
+ return elf_mmap_section_contents (abfd, sec, buf);
}
/* Mmap in the full section contents for the final link. */
_bfd_elf_link_mmap_section_contents (bfd *abfd, sec_ptr sec,
bfd_byte **buf)
{
- return elf_mmap_section_contents (abfd, sec, buf, true);
+ return elf_mmap_section_contents (abfd, sec, buf);
}
/* Munmap section contents. */