)]}'
{
  "commit": "f752be8f916efa70aea9c2e4f664c75690fd136c",
  "tree": "d9d132e96ec211b344ac5de23a1d76d611134bda",
  "parents": [
    "6638cfadb9b78db0da1bf6cd01c2f11e2bc22e74"
  ],
  "author": {
    "name": "H.J. Lu",
    "email": "hjl.tools@gmail.com",
    "time": "Tue Jul 22 14:09:48 2025 -0700"
  },
  "committer": {
    "name": "H.J. Lu",
    "email": "hjl.tools@gmail.com",
    "time": "Thu Jul 24 06:52:02 2025 -0700"
  },
  "message": "strip: Properly handle LLVM IR bitcode\n\ncommit 717a38e9a02109fcbcb18bb2ec3aa251e2ad0a0d\nAuthor: H.J. Lu \u003chjl.tools@gmail.com\u003e\nDate:   Sun May 4 05:12:46 2025 +0800\n\n    strip: Add GCC LTO IR support\n\nadded \"-R .gnu.lto_.*\" to strip to remove all GCC LTO sections.  When\n\"-R .gnu.lto_.*\" is used, the plugin target is ignored so that all LTO\nsections are stripped as the regular sections.  It works for the slim\nGCC LTO IR since the GCC LTO IR is stored in the regular sections.  When\nthe plugin target is ignored, the GCC LTO IR can be recognized as the\nnormal object files.  But it doesn\u0027t work for the slim LLVM IR which\nis stored in a standalone file.\n\n1. Add bfd_check_format_matches_lto and bfd_check_format_lto to take an\nargument, lto_sections_removed, to indicate if all LTO sections should\nbe removed.\n2. Update strip to always enable the plugin target so that the plugin\ntarget is enabled when checking for bfd_archive.\n3. Update strip to ignore the plugin target for bfd_object when all LTO\nsections should be removed.  If the object is unknown, copy it as an\nunknown file without any messages.\n4. Treat the \"-R .llvm.lto\" strip option as removing all LTO sections.\n\nbfd/\n\n\tPR binutils/33198\n\t* format.c (bfd_check_format_lto): New function.\n\t(bfd_check_format): Call bfd_check_format_matches_lto.\n\t(bfd_check_format_matches): Renamed to ...\n\t(bfd_check_format_matches_lto): This.  Add an argument,\n\tlto_sections_removed, to indicate if all LTO sections should be\n\tremoved and don\u0027t match the plugin target if lto_sections_removed\n\tis true.\n\t(bfd_check_format_matches): Call bfd_check_format_matches_lto.\n\t* bfd-in2.h: Regenerated.\n\nbinutils/\n\n\tPR binutils/33198\n\t* objcopy.c (copy_archive): Call bfd_check_format_lto, instead\n\tof bfd_check_format, and pass lto_sections_removed.  Remove the\n\tnon-fatal message on unknown element since it will be copied as\n\tan unknown file.\n\t(copy_file): Don\u0027t check lto_sections_removed when enabling LTO\n\tplugin in strip.\n\t(copy_file): Ignore the plugin target first if all LTO sections\n\tshould be removed.  Try with the plugin target next if ignoring\n\tthe plugin target failed to match the format.\n\t(strip_main): Also set lto_sections_removed for -R .llvm.lto.\n\t* testsuite/binutils-all/x86-64/pr33198.c: New file.\n\t* testsuite/binutils-all/x86-64/x86-64.exp (run_pr33198_test):\n\tNew.\n\tRun binutils/33198 tests.\n\t* testsuite/lib/binutils-common.exp (llvm_plug_opt): New.\n\t(CLANG_FOR_TARGET): New.  Set to \"clang\" for native build if\n\t\"clang -v\" reports \"clang version\".\n\nSigned-off-by: H.J. Lu \u003chjl.tools@gmail.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b013ef954da34a0b3c5a826e057691b0873efe25",
      "old_mode": 33188,
      "old_path": "bfd/bfd-in2.h",
      "new_id": "2ff3e930bfa2fb441aa68bc81618747a576571a2",
      "new_mode": 33188,
      "new_path": "bfd/bfd-in2.h"
    },
    {
      "type": "modify",
      "old_id": "a909b70fe8129e4de19dc2c06f810691779e3bca",
      "old_mode": 33188,
      "old_path": "bfd/format.c",
      "new_id": "f3a0774af081ce445eeea1788b8cb97774a6dd46",
      "new_mode": 33188,
      "new_path": "bfd/format.c"
    },
    {
      "type": "modify",
      "old_id": "2ca04e84d47a56ef933cf69ddb6eab7937437578",
      "old_mode": 33188,
      "old_path": "binutils/objcopy.c",
      "new_id": "905ce917708017c79e6f5fb949f582549ca6e01e",
      "new_mode": 33188,
      "new_path": "binutils/objcopy.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "cd0130cacdfe9c2873c7bdf7c123be00dec9dd0d",
      "new_mode": 33188,
      "new_path": "binutils/testsuite/binutils-all/x86-64/pr33198.c"
    },
    {
      "type": "modify",
      "old_id": "05c73047b601a5573f3c49e30ee8e5d894bc23ef",
      "old_mode": 33188,
      "old_path": "binutils/testsuite/binutils-all/x86-64/x86-64.exp",
      "new_id": "ab1aa50a9a19c27e23d89f06d295a35f5a251f75",
      "new_mode": 33188,
      "new_path": "binutils/testsuite/binutils-all/x86-64/x86-64.exp"
    },
    {
      "type": "modify",
      "old_id": "b73b5558c27cb6c10f72f832276fdd3a8cd8ec6d",
      "old_mode": 33188,
      "old_path": "binutils/testsuite/lib/binutils-common.exp",
      "new_id": "7297f6d29d32321859101c0182963950861aa2ed",
      "new_mode": 33188,
      "new_path": "binutils/testsuite/lib/binutils-common.exp"
    }
  ]
}
