)]}'
{
  "commit": "0613c3306cc709f950731d87accbfac02b17a787",
  "tree": "18fb3618bb235f205236ebdd01e3b13233250927",
  "parents": [
    "5b3ef0a5952eaf912da343505eff9d0a29334751"
  ],
  "author": {
    "name": "Alan Modra",
    "email": "amodra@gmail.com",
    "time": "Wed Aug 04 18:32:28 2021 +0930"
  },
  "committer": {
    "name": "Alan Modra",
    "email": "amodra@gmail.com",
    "time": "Wed Aug 04 23:28:44 2021 +0930"
  },
  "message": "PR28162, segment fault in mips_elf_assign_gp\n\nFor the testcase in the PR, _bfd_mips_elf32_gprel16_reloc is passed a\nNULL output_bfd.  As expected for reloc special functions if called by\nobjdump or when final linking.  The function attempts to find the\noutput by\n  output_bfd \u003d symbol-\u003esection-\u003eoutput_section-\u003eowner;\nThat makes some sense, since when handling a gp-relative reloc we need\nthe relevant gp to which the symbol is relative.  Possibly the gp\nvalue can be one for a shared library?  But that doesn\u0027t seem useful\nor supported by the various abi docs and won\u0027t work as written.\nSymbols defined in shared libraries have section-\u003eoutput_section\nNULL, and what\u0027s more the code in mips_elf_assign_gp isn\u0027t set up to\nlook at shared library symbols.\n\nAlso, if the symbol is a SHN_ABS one the owner of *ABS* section is\nNULL, which will result in the testcase segfault.  The only gp to\nwhich an absolute symbol can be relative is the linker output bfd when\nlinking, or the input bfd when not.  This patch arranges to do that\nfor all gp-relative reloc symbols.\n\n\t* elf32-mips.c (_bfd_mips_elf32_gprel16_reloc): Don\u0027t use the\n\tsection symbol to find the output bfd, use input_section.\n\t(mips_elf_gprel32_reloc, mips16_gprel_reloc): Likewise.\n\t* elf64-mips.c (mips_elf64_gprel16_reloc): Likewise.\n\t(mips_elf64_literal_reloc, mips_elf64_gprel32_reloc): Likewise.\n\t(mips16_gprel_reloc): Likewise.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1e645c66787651bdb35a8ac42c5b9d92ff59f3bd",
      "old_mode": 33188,
      "old_path": "bfd/elf32-mips.c",
      "new_id": "f8467de478b050201992fc359443cdf6ed1dc1a9",
      "new_mode": 33188,
      "new_path": "bfd/elf32-mips.c"
    },
    {
      "type": "modify",
      "old_id": "876e4f867c291e309581f16f0b8f0c6b82f630cc",
      "old_mode": 33188,
      "old_path": "bfd/elf64-mips.c",
      "new_id": "b94adf129534597964410e5b2f2b90df993acfb6",
      "new_mode": 33188,
      "new_path": "bfd/elf64-mips.c"
    }
  ]
}
