aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-03-11 09:51:06 -0700
committerH.J. Lu <hjl.tools@gmail.com>2024-04-03 09:11:03 -0700
commita9505c74206cfb797d3baac526b19ba7055675dc (patch)
tree77573e019945fcc8f64c3b884cdc42a9d0d6193b /bfd/elf-bfd.h
parent3428c771aef0cebe229ac0f02a654d2ef78f2427 (diff)
downloadgdb-a9505c74206cfb797d3baac526b19ba7055675dc.zip
gdb-a9505c74206cfb797d3baac526b19ba7055675dc.tar.gz
gdb-a9505c74206cfb797d3baac526b19ba7055675dc.tar.bz2
elf: Add _bfd_elf_link_m[un]map_section_contents
To copy input section contents, add _bfd_elf_link_mmap_section_contents and _bfd_elf_link_munmap_section_contents to mmap in the input sections. * elf-bfd.h (_bfd_elf_link_mmap_section_contents): New. (_bfd_elf_link_munmap_section_contents): Likewise. * elf.c (elf_mmap_section_contents): New. (_bfd_elf_mmap_section_contents): Use it. (_bfd_elf_link_mmap_section_contents): New. (_bfd_elf_link_munmap_section_contents): Likewise. * elflink.c (elf_link_input_bfd): Call _bfd_elf_link_mmap_section_contents instead of bfd_get_full_section_contents. Call _bfd_elf_link_munmap_section_contents to munmap the section contents. (bfd_elf_final_link): When mmap is used, initialize max_contents_size to _bfd_minimum_mmap_size and increase it for compressed or linker created sections or sections whose rawsize != size.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 01e0da1..f31244f 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -3146,6 +3146,10 @@ extern bool _bfd_elf_mmap_section_contents
(bfd *abfd, asection *section, bfd_byte **buf);
extern void _bfd_elf_munmap_section_contents
(asection *, void *);
+extern bool _bfd_elf_link_mmap_section_contents
+ (bfd *abfd, asection *section, bfd_byte **buf);
+extern void _bfd_elf_link_munmap_section_contents
+ (asection *);
/* Large common section. */
extern asection _bfd_elf_large_com_section;