)]}'
{
  "commit": "f55053f1dc94121bcd8a5faedc9e2f8d41d692e1",
  "tree": "1a430e1702d7c2b05e59936001adf636850aa0d6",
  "parents": [
    "a639e0adaf2dc8f0bcb2b55715e7abebbe39bc7f"
  ],
  "author": {
    "name": "Samuel Price",
    "email": "thesamprice@gmail.com",
    "time": "Thu Aug 13 00:45:29 2026 -0400"
  },
  "committer": {
    "name": "Alan Modra",
    "email": "amodra@gmail.com",
    "time": "Fri Aug 28 10:11:28 2026 +0930"
  },
  "message": "microblaze: neutralise relocations against discarded sections\n\nmicroblaze_elf_relocate_section does not handle relocations against\nsymbols defined in sections discarded by linkonce or comdat handling.\nbfd/elf32-microblaze.c contains no RELOC_AGAINST_DISCARDED_SECTION at\nall, where 60 other bfd/elf*.c files use it.  The relocation survives and\nresolves against a dead symbol, so debug sections end up holding garbage\nwhere zero is expected:\n\n  ld-elf/linkonce2\n    regexp \"^.*(NONE|unused|UNUSED).*\\*ABS\\*$\"\n    line   \"00000000 R_MICROBLAZE_32   foo\"\n\n  ld-discard/zero-range\n    regexp \"^ 0000 (01)?000000(01)? (01)?000000(01)? 00000000 00000000 .*$\"\n    line   \" 0000 00000000 00000002 00000000 00000000  ................\"\n\nsym_hashes is checked for NULL as RELOC_FOR_GLOBAL_SYMBOL does, since this\nlookup runs before that macro is reached.  elf_sym_hashes is left NULL for\nan object with no global symbols, the allocation in\nelf_link_add_object_symbols being gated on extsymcount, so the check is\nnot only for the malformed input its comment there mentions.\n\nMost backends put the check after symbol resolution and before the\nbfd_link_relocatable early exit.  This one resolves the symbol separately\nin each of two branches, and the relocatable branch returns early for\nglobal symbols, which is exactly the case ld-elf/linkonce2 exercises.\nThe defining section is therefore looked up once before either branch,\nwhich covers both the final and the relocatable link without\nrestructuring the function.\n\nmicroblaze_elf_howto_table is an array of pointers, and\nR_MICROBLAZE_TEXTREL_32_LO has no entry in microblaze_elf_howto_raw, so\nhowto can be NULL for a type that is in range.  Relaxation creates that\ntype and _bfd_clear_contents reads howto-\u003esize, so the call is guarded, as\nelf32-ppc.c guards its own array of howto pointers.  Such a relocation is\nleft alone rather than neutralised, as before.\n\nFixes four existing tests on microblaze-elf:\n\n  ld-discard/zero-range\n  ld-discard/zero-rel\n  ld-elf/linkonce1\n  ld-elf/linkonce2\n\nld/testsuite goes from 476 passes and 4 unexpected failures to 480 and 0.\ngas and binutils result lists are byte-identical.  No test changes state\nin the other direction.\n\nbfd/\n\t* elf32-microblaze.c (microblaze_elf_relocate_section): Look up\n\tthe section defining the symbol and neutralise relocations\n\tagainst discarded sections, skipping relocation types with no\n\thowto table entry and objects with no symbol hash table.\n\nSigned-off-by: Sam Price \u003cthesamprice@gmail.com\u003e\nReviewed-by: Neal Frager \u003cneal.frager@amd.com\u003e\nAssisted-by: Claude (Anthropic)\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "bf02aca2652a4281afcc6444ee48c9be0799ad80",
      "old_mode": 33188,
      "old_path": "bfd/elf32-microblaze.c",
      "new_id": "027b1886e9a713c9f978e67ca4b73a5a31c1d68c",
      "new_mode": 33188,
      "new_path": "bfd/elf32-microblaze.c"
    }
  ]
}
