[PATCH v2] SHT_GROUP handling: Use _bfd_elf_link_m[un]map_section_contents

Alan Modra amodra@gmail.com
Fri Jun 28 23:38:17 GMT 2024


On Sat, Jun 29, 2024 at 04:48:51AM +0800, H.J. Lu wrote:
> It isn't about the SHT_GROUP section size.

That's exactly what it is about.  elf_mmap_section_contents

      /* Use mmap only if section size >= the minimum mmap section
	 size.  */
      size_t readsz = bfd_get_section_limit_octets (abfd, sec);
      size_t allocsz = bfd_get_section_alloc_size (abfd, sec);
      if (readsz == allocsz && readsz >= _bfd_minimum_mmap_size)

You are not going to use mmap for SHT_GROUP sections!  They will
*always* use fread.  I just don't see anything but a very artificial
testcase with more than 4k sections in a group.  It would imply 4k
different types of data associated with one function or object.

-- 
Alan Modra


More information about the Binutils mailing list