)]}'
{
  "commit": "c6291d749aece753ae8dcba0a5baff2fe9598541",
  "tree": "27b0044bd8d5574abfd069e7c62ac704f75efe62",
  "parents": [
    "584b30e4b3538a64d38bc1da9cfa09fc9355378a"
  ],
  "author": {
    "name": "H.J. Lu",
    "email": "hjl.tools@gmail.com",
    "time": "Sun Mar 03 08:44:01 2024 -0800"
  },
  "committer": {
    "name": "H.J. Lu",
    "email": "hjl.tools@gmail.com",
    "time": "Wed Apr 03 09:11:03 2024 -0700"
  },
  "message": "elf: Use mmap to map in symbol and relocation tables\n\nAdd _bfd_mmap_read_temporary to mmap in symbol tables and relocations\nwhose sizes \u003e\u003d 4 * page size.  For the final link, allocate an external\nrelocation buffer of 4 * page size to avoid using mmap and munmap on\nsmaller relocation sections.  Since _bfd_mmap_read_temporary allocates\nbuffer as needed, its callers don\u0027t need to.\n\nWhen mmap is used to map in all ELF sections, data to link the 3.5GB\nclang executable in LLVM 17 debug build on Linux/x86-64 with 32GB RAM\nis:\n\n\t\tstdio\t\tmmap\t\timprovement\nuser\t\t84.79\t\t85.27\t\t-0.5%\nsystem\t\t10.95\t\t9.09\t\t17%\ntotal\t\t97.91\t\t94.90\t\t3%\npage faults\t4837944\t\t4033778\t\t17%\n\nand data to link the 275M cc1plus executable in GCC 14 stage 1 build\nis:\n\nuser\t\t5.31\t\t5.33\t\t-0.4%\nsystem\t\t0.86\t\t0.76\t\t12%\ntotal\t\t6.19\t\t6.13\t\t1%\npage faults\t361273\t\t322491\t\t11%\n\n\t* elf.c (bfd_elf_get_elf_syms): Don\u0027t allocate buffer for external\n\tsymbol table.  Replace bfd_read with _bfd_mmap_read_temporary.\n\t* elflink.c (elf_link_read_relocs_from_section): Add 2 arguments\n\tto return mmap memory address and size.\n\t(_bfd_elf_link_info_read_relocs): Don\u0027t allocate buffer for\n\texternal relocation information.  Replace bfd_read with\n\t_bfd_mmap_read_temporary.\n\t(bfd_elf_final_link): Cache external relocations up to\n\t_bfd_minimum_mmap_size bytes when mmap is used.\n\t* libbfd.c (_bfd_mmap_read_temporary): New.\n\t* libbfd-in.h (_bfd_mmap_read_temporary): Likewise.\n\t* libbfd.h: Regenerated.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5d2996505f44274c1c02d4613122fd56cefd54ed",
      "old_mode": 33188,
      "old_path": "bfd/elf.c",
      "new_id": "868abeccddbcbdf1355e71ff834c7e0d632fd36a",
      "new_mode": 33188,
      "new_path": "bfd/elf.c"
    },
    {
      "type": "modify",
      "old_id": "2991e06fe46b22d4d6ffc113f6f0917783e1d9ba",
      "old_mode": 33188,
      "old_path": "bfd/elflink.c",
      "new_id": "7e9f4c7f0b042db2fbb546731b395fb80148ee05",
      "new_mode": 33188,
      "new_path": "bfd/elflink.c"
    },
    {
      "type": "modify",
      "old_id": "c5a79cf932c509ddec2f149dbada2db7b9d28495",
      "old_mode": 33188,
      "old_path": "bfd/libbfd-in.h",
      "new_id": "889b221a9508d4aa031ee7094499227be39a8533",
      "new_mode": 33188,
      "new_path": "bfd/libbfd-in.h"
    },
    {
      "type": "modify",
      "old_id": "e5147a29d6977b596ca73b5d80a86b4dea9c2939",
      "old_mode": 33188,
      "old_path": "bfd/libbfd.c",
      "new_id": "869f0ed5c6611dd964dbeff1f329d739dbe5b954",
      "new_mode": 33188,
      "new_path": "bfd/libbfd.c"
    },
    {
      "type": "modify",
      "old_id": "0caf0f39e61cf39783fb4413df70956af2d21956",
      "old_mode": 33188,
      "old_path": "bfd/libbfd.h",
      "new_id": "0676f461382c56af52bdc2e5631ce4d62e168224",
      "new_mode": 33188,
      "new_path": "bfd/libbfd.h"
    }
  ]
}
