)]}'
{
  "commit": "44c39324673cd9bb18db67234253f288497d66a1",
  "tree": "56a794e2460c321e13431ed6a1555f2a25a04d5d",
  "parents": [
    "d9001d36830805cfc09993ecede99f0dfd6fd3fb"
  ],
  "author": {
    "name": "Kito Cheng",
    "email": "kito.cheng@sifive.com",
    "time": "Mon Jan 12 16:26:32 2026 +0800"
  },
  "committer": {
    "name": "Nelson Chu",
    "email": "nelson.chu1990@gmail.com",
    "time": "Thu Jan 15 12:04:57 2026 +0800"
  },
  "message": "RISC-V: Add second-pass relaxation for JAL to C.J/C.JAL\n\nWhen linker relaxation converts CALL (auipc+jalr, 8 bytes) to JAL\n(4 bytes), further relaxation to C.J or C.JAL (2 bytes) may become\npossible as code shrinks and jump distances decrease.\n\nThis patch adds _bfd_riscv_relax_jal to perform this second-pass\nrelaxation.  To enable this, we introduce R_RISCV_DELETE_AND_RELAX,\na new internal relocation that combines piecewise deletion with\npreservation of relaxation capability.  When _bfd_riscv_relax_call\nrelaxes CALL to JAL, it marks the deletion as R_RISCV_DELETE_AND_RELAX\ninstead of R_RISCV_DELETE.  After the piecewise deletion is resolved,\nR_RISCV_DELETE_AND_RELAX is converted back to R_RISCV_RELAX at the\nJAL instruction offset, allowing _bfd_riscv_relax_jal to further\nrelax JAL to C.J/C.JAL.\n\nC.JAL is only available on RV32 (rd\u003dra), while C.J is available on\nboth RV32 and RV64 (rd\u003dx0).\n\nChanges since v1:\n- Use R_RISCV_DELETE_AND_RELAX with piecewise deletion instead of\n  calling _riscv_relax_delete_immediate directly, to maintain\n  relaxation performance.\n- Add preserve_relax parameter to riscv_relax_delete_bytes to\n  simplify the logic in _bfd_riscv_relax_call.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4447eea0682fe34f3a84a6fcbb159193ae6bb8a7",
      "old_mode": 33188,
      "old_path": "bfd/elfnn-riscv.c",
      "new_id": "d3963ec9a586fcbab657022c4910a9f1a32ff662",
      "new_mode": 33188,
      "new_path": "bfd/elfnn-riscv.c"
    },
    {
      "type": "modify",
      "old_id": "b0f635114e190870883756d575084acf21f2c0e9",
      "old_mode": 33188,
      "old_path": "bfd/elfxx-riscv.c",
      "new_id": "ee962b4f6f18c3761a2aa65ec9b3c7d5a6d616d7",
      "new_mode": 33188,
      "new_path": "bfd/elfxx-riscv.c"
    },
    {
      "type": "modify",
      "old_id": "49d6cbf57c40c1fc76636f5fea90ec91232a59a9",
      "old_mode": 33188,
      "old_path": "include/elf/riscv.h",
      "new_id": "f6ca3d4acd89aeca577eaab855abfe134c174ae9",
      "new_mode": 33188,
      "new_path": "include/elf/riscv.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "964e0522f1922624dd8164bcfa90da5eb7c9a66e",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-riscv-elf/j-to-cj-32.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6b9c0f087579f607b7e66f7b4458115f2b6a28a7",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-riscv-elf/j-to-cj-64.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "39f1590713e37fb0ce7ed34bb267a99140f65073",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-riscv-elf/j-to-cj.s"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6d448e233752edd5f505ba6821a4d94f01b0b318",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-riscv-elf/jal-to-cjal.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "4570b87f320e11eb76840e9c6ea906a274186bf9",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-riscv-elf/jal-to-cjal.s"
    },
    {
      "type": "modify",
      "old_id": "f6706b2c6a31a3778fda39924cdb780a18aacae4",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp",
      "new_id": "8e26ccff10a2523187c5bb32fb36eb68ebf23dbb",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp"
    }
  ]
}
