)]}'
{
  "commit": "8b99ca44515b2b56f1492786e23522e4abbe8a96",
  "tree": "4b870d37557c35acb87928551bf130b5be492bbb",
  "parents": [
    "57ccec66689305cdb59afa179b3f9a6464c84820"
  ],
  "author": {
    "name": "Alan Modra",
    "email": "amodra@gmail.com",
    "time": "Thu Oct 30 16:26:50 2025 +1030"
  },
  "committer": {
    "name": "Alan Modra",
    "email": "amodra@gmail.com",
    "time": "Thu Oct 30 16:26:50 2025 +1030"
  },
  "message": "Don\u0027t read and cache local syms for gc-sections\n\nMost places just need the local sym section, so reading and sometimes\ncaching the symbols is excessive.  A symbol shndx can be stored in 4\nbytes, an elf symbol internal form requires 32 bytes.  When caching\nthe local symbols we went slightly crazy trying to avoid memory usage,\nresulting in the symbols being freed then immediately read again for\nthe testcase in the PR33530.\n\nTo avoid this problem, this patch caches the local symbol section\nindices in the bfd rather than in the reloc cookie.  They are not\ninitialised until there is a need for them, so unlike elf_sym_hashes\nfor global syms you cannot rely on them being present.\n\nOne place that does need local syms is adjust_eh_frame_local_symbols,\nbut that is called once via bfd_discard_info so there is no problem\nsimply reading them.  The other place that needs local syms is\nppc64_elf_gc_mark_hook for the old ELFv1 ABI when handling .opd.\nbfd_sym_from_r_symndx should be sufficient for function pointer\nreferences to static functions, which is how this code is triggered.\n\n\tPR 33530\n\t* elf-bfd.h (struct elf_reloc_cookie): Delete \"locsyms\",\n\t\"sym_hashes\", \"bad_symtab\".  Make \"locsymcount\" and\n\t\"extsymoff\" unsigned int.\n\t(struct elf_obj_tdata): Add loc_shndx.\n\t(elf_loc_shndx): Define.\n\t(_bfd_get_local_sym_section): Declare.\n\t* elf-eh-frame.c (find_merged_cie): Use\n\t_bfd_get_local_sym_section for local syms.\n\t(adjust_eh_frame_local_symbols): Read local syms if any match\n\t.eh_frame section.  Return them if changed.\n\t(_bfd_elf_discard_section_eh_frame): Adjust.\n\t* elf64-ppc.c (ppc64_elf_gc_mark_hook): Use\n\t_bfd_get_local_sym_section.  Use bfd_sym_from_r_symndx when\n\treading opd local symbol.\n\t* elflink.c (_bfd_get_local_sym_section): New function.\n\t(_bfd_elf_section_for_symbol): Use it.\n\t(elf_link_add_object_symbols): Remove unnecessary cast on\n\tbfd_zalloc return.\n\t(init_reloc_cookie): Remove \"info\" and \"keep_memory\" params.\n\tAdjust all callers.  Don\u0027t stash elf_sym_hashes and\n\telf_bad_symtab to cookie.  Don\u0027t read local syms to cookie.\n\t(fini_reloc_cookie): Do nothing.\n\t(_bfd_elf_gc_mark_hook): Use _bfd_get_local_sym_section.\n\t(elf_gc_mark_debug_section): Likewise.\n\t(bfd_elf_reloc_symbol_deleted_p): Likewise.  Update cookie use.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "dfadb3e933e3c1eac99067f63031b15a7d940a4a",
      "old_mode": 33188,
      "old_path": "bfd/elf-bfd.h",
      "new_id": "e51bfcf63603ee9f613583cbb00252f43deb5255",
      "new_mode": 33188,
      "new_path": "bfd/elf-bfd.h"
    },
    {
      "type": "modify",
      "old_id": "87cf45a0db039d4c684c4a20bcf1c88fdf091676",
      "old_mode": 33188,
      "old_path": "bfd/elf-eh-frame.c",
      "new_id": "97ba1a3dce69db0210541b82b17c15be062abf91",
      "new_mode": 33188,
      "new_path": "bfd/elf-eh-frame.c"
    },
    {
      "type": "modify",
      "old_id": "26dab93c5383a3f7f287d2b23bb0eb0e27e1dd7b",
      "old_mode": 33188,
      "old_path": "bfd/elf64-ppc.c",
      "new_id": "b706cf4d438c36576cda47d0fdefadf448fca9b7",
      "new_mode": 33188,
      "new_path": "bfd/elf64-ppc.c"
    },
    {
      "type": "modify",
      "old_id": "5f8ba26453df479ba9bd162561fb2af8c1a019ea",
      "old_mode": 33188,
      "old_path": "bfd/elflink.c",
      "new_id": "989a7a0a6afec7bf8a6202313de61ba0b656044f",
      "new_mode": 33188,
      "new_path": "bfd/elflink.c"
    }
  ]
}
