)]}'
{
  "commit": "b21318bd2c29fcca8f99c1de7facdaa5cb2e66e2",
  "tree": "e1c2baacc959a91de68e4625ec356c85ea929c5a",
  "parents": [
    "38b95a529385e32adc39428231c6fc8b0e8d6f21"
  ],
  "author": {
    "name": "Joseph Myers",
    "email": "joseph@codesourcery.com",
    "time": "Thu May 11 14:31:09 2023 +0000"
  },
  "committer": {
    "name": "Joseph Myers",
    "email": "joseph@codesourcery.com",
    "time": "Thu May 11 14:31:09 2023 +0000"
  },
  "message": "Add LDPT_REGISTER_CLAIM_FILE_HOOK_V2 linker plugin hook [GCC PR109128]\n\nThis is one part of the fix for GCC PR109128, along with a\ncorresponding GCC change.  Without this patch, what happens in the\nlinker, when an unused object in a .a file has offload data, is that\nelf_link_is_defined_archive_symbol calls bfd_link_plugin_object_p,\nwhich ends up calling the plugin\u0027s claim_file_handler, which then\nrecords the object as one with offload data. That is, the linker never\ndecides to use the object in the first place, but use of this _p\ninterface (called as part of trying to decide whether to use the\nobject) results in the plugin deciding to use its offload data (and a\nconsequent mismatch in the offload data present at runtime).\n\nThe new hook allows the linker plugin to distinguish calls to\nclaim_file_handler that know the object is being used by the linker\n(from ldmain.c:add_archive_element), from calls that don\u0027t know it\u0027s\nbeing used by the linker (from elf_link_is_defined_archive_symbol); in\nthe latter case, the plugin should avoid recording the object as one\nwith offload data.\n\n\tbfd/\n\t* plugin.c (struct plugin_list_entry): Add claim_file_v2.\n\t(register_claim_file_v2): New.\n\t(try_load_plugin): Use LDPT_REGISTER_CLAIM_FILE_HOOK_V2.\n\t(ld_plugin_object_p): Take second argument.\n\t(bfd_link_plugin_object_p): Update call to ld_plugin_object_p.\n\t(register_ld_plugin_object_p): Update argument prototype.\n\t(bfd_plugin_object_p): Update call to ld_plugin_object_p.\n\t* plugin.h (register_ld_plugin_object_p): Update argument\n\tprototype.\n\n\tinclude/\n\t* plugin.api.h (ld_plugin_claim_file_handler_v2)\n\t(ld_plugin_register_claim_file_v2)\n\t(LDPT_REGISTER_CLAIM_FILE_HOOK_V2): New.\n\t(struct ld_plugin_tv): Add tv_register_claim_file_v2.\n\n\tld/\n\t* plugin.c (struct plugin): Add claim_file_handler_v2.\n\t(LDPT_REGISTER_CLAIM_FILE_HOOK_V2): New.\n\t(plugin_object_p): Add second argument.  Update call to\n\tplugin_call_claim_file.\n\t(register_claim_file_v2): New.\n\t(set_tv_header): Handle LDPT_REGISTER_CLAIM_FILE_HOOK_V2.\n\t(plugin_call_claim_file): Add argument known_used.\n\t(plugin_maybe_claim): Update call to plugin_object_p.\n\t* testplug.c, testplug2.c, testplug3.c, testplug4.c: Handle\n\tLDPT_REGISTER_CLAIM_FILE_HOOK_V2.\n\t* testsuite/ld-plugin/plugin-1.d, testsuite/ld-plugin/plugin-10.d,\n\ttestsuite/ld-plugin/plugin-11.d, testsuite/ld-plugin/plugin-13.d,\n\ttestsuite/ld-plugin/plugin-14.d, testsuite/ld-plugin/plugin-15.d,\n\ttestsuite/ld-plugin/plugin-16.d, testsuite/ld-plugin/plugin-17.d,\n\ttestsuite/ld-plugin/plugin-18.d, testsuite/ld-plugin/plugin-19.d,\n\ttestsuite/ld-plugin/plugin-2.d, testsuite/ld-plugin/plugin-26.d,\n\ttestsuite/ld-plugin/plugin-3.d, testsuite/ld-plugin/plugin-30.d,\n\ttestsuite/ld-plugin/plugin-4.d, testsuite/ld-plugin/plugin-5.d,\n\ttestsuite/ld-plugin/plugin-6.d, testsuite/ld-plugin/plugin-7.d,\n\ttestsuite/ld-plugin/plugin-8.d, testsuite/ld-plugin/plugin-9.d:\n\tUpdate test expectations.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "66d286af6b67a883ba43628335eb8198cf9a2362",
      "old_mode": 33188,
      "old_path": "bfd/plugin.c",
      "new_id": "b798d3477aecbab760fc3262f7c37a49b3095316",
      "new_mode": 33188,
      "new_path": "bfd/plugin.c"
    },
    {
      "type": "modify",
      "old_id": "8da436a86b9d0dc0b1271a113810ee5c59ddc9e8",
      "old_mode": 33188,
      "old_path": "bfd/plugin.h",
      "new_id": "6a6f0f19fc2dab48160e020564e5f6861951daec",
      "new_mode": 33188,
      "new_path": "bfd/plugin.h"
    },
    {
      "type": "modify",
      "old_id": "379828ba854c10ebd1b77d022c698c5ca8b54df3",
      "old_mode": 33188,
      "old_path": "include/plugin-api.h",
      "new_id": "395d5bcc59836a616af0c32d5bbc3d00429c9608",
      "new_mode": 33188,
      "new_path": "include/plugin-api.h"
    },
    {
      "type": "modify",
      "old_id": "34aefc584ccd507f3fd8c9bbf6f92f912ac87546",
      "old_mode": 33188,
      "old_path": "ld/plugin.c",
      "new_id": "970cf566ffef006a4425a65970c248ef6f1e7680",
      "new_mode": 33188,
      "new_path": "ld/plugin.c"
    },
    {
      "type": "modify",
      "old_id": "796d67fe056a9285ce82dae1de839d4a039ba142",
      "old_mode": 33188,
      "old_path": "ld/testplug.c",
      "new_id": "4b1bb8ecdbea2f8d1fe3590b1bd88da2f1692c91",
      "new_mode": 33188,
      "new_path": "ld/testplug.c"
    },
    {
      "type": "modify",
      "old_id": "0a3339238f09c89049082c5f5f44033bbc4d3eed",
      "old_mode": 33188,
      "old_path": "ld/testplug2.c",
      "new_id": "f1d6f5f95531a3591f16988774f12b2ce029c42f",
      "new_mode": 33188,
      "new_path": "ld/testplug2.c"
    },
    {
      "type": "modify",
      "old_id": "7e009e1ee7a0aaf46ef8141c3efa0051a36e11d3",
      "old_mode": 33188,
      "old_path": "ld/testplug3.c",
      "new_id": "652d11f4710511e9501cec4fa8692017711f7288",
      "new_mode": 33188,
      "new_path": "ld/testplug3.c"
    },
    {
      "type": "modify",
      "old_id": "109d500dc0a0239bbc1e753f7be585020233c8b0",
      "old_mode": 33188,
      "old_path": "ld/testplug4.c",
      "new_id": "9b63e8343c877f74db6bcb69122176ce32d03cf0",
      "new_mode": 33188,
      "new_path": "ld/testplug4.c"
    },
    {
      "type": "modify",
      "old_id": "6aae4cdc3835157b524b24f15e78b382978e3195",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-1.d",
      "new_id": "381974fcb4925ca8fd9cc4f3f4e4d38011db92e9",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-1.d"
    },
    {
      "type": "modify",
      "old_id": "f92ee650c134eac0214087e946f76293adb76cd2",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-10.d",
      "new_id": "f6bb0eb45c601ddf82985f1a1780581c18bc871b",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-10.d"
    },
    {
      "type": "modify",
      "old_id": "6a5abcfc060a2cf201ad2414ec9485f0f5251b38",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-11.d",
      "new_id": "63b81603684a6920aa64cff70fff396db60fddbd",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-11.d"
    },
    {
      "type": "modify",
      "old_id": "55dea651ec555861e0e0c41529a37d8785f6e502",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-13.d",
      "new_id": "4521b34459c94e39f136764979d188dffa74597c",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-13.d"
    },
    {
      "type": "modify",
      "old_id": "81365af7524b5f0197441b2ea4d0439ddf6195ea",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-14.d",
      "new_id": "bd8ef65a2046fe7c02df342e2334e5af1bc6b69f",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-14.d"
    },
    {
      "type": "modify",
      "old_id": "02c5e60bf9b78416b6788081b21f5fb466970f1e",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-15.d",
      "new_id": "1647500e98fad227547bb281bc18fbc29dc86a9d",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-15.d"
    },
    {
      "type": "modify",
      "old_id": "504fbdbc0e9a6d5b50641bd64d04eaea84069383",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-16.d",
      "new_id": "f1ee03a4768df429bb63e6b83064c97ddfbcc0f7",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-16.d"
    },
    {
      "type": "modify",
      "old_id": "159d4e47580f038f264a962f35e9da9378b5e733",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-17.d",
      "new_id": "5a520b68466b5988a8efbf0eb54a298c39103a6d",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-17.d"
    },
    {
      "type": "modify",
      "old_id": "284fd057686b256c624230a4aa4fb925ee92fbaf",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-18.d",
      "new_id": "63d8147ce8e452c1687b8b602061455e5ba98cdb",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-18.d"
    },
    {
      "type": "modify",
      "old_id": "621ee7689f0c177b44d1c37254251802df16ff99",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-19.d",
      "new_id": "aa3076372b3ac3d4ccbaf939f4922a4bbaca4262",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-19.d"
    },
    {
      "type": "modify",
      "old_id": "91822c1f8676d22b08156a1bd5e8417342642957",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-2.d",
      "new_id": "f272f53b3c1e76922e1e7069b605e8cf54b434c8",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-2.d"
    },
    {
      "type": "modify",
      "old_id": "c631e387a05a04e833dadc7ad78277874968047d",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-26.d",
      "new_id": "fef25d5c2957ea9a7754519b4964fedef17ad8c9",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-26.d"
    },
    {
      "type": "modify",
      "old_id": "f030da467b344c3c280c4b9130005686cba4d6ea",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-3.d",
      "new_id": "0c23218fef9823b7791f12758e322836894b9328",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-3.d"
    },
    {
      "type": "modify",
      "old_id": "eb9d4244786aa94f892c38aac85ea58f8b4df3a3",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-30.d",
      "new_id": "690ae8329905b612db9172f435ebe5e3400979ae",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-30.d"
    },
    {
      "type": "modify",
      "old_id": "b240eb221e06cc4b337845bec12a3f5e339f81f3",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-4.d",
      "new_id": "ac4769b99d2975aa5c9cf9d63ad192804bb5bfc6",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-4.d"
    },
    {
      "type": "modify",
      "old_id": "52abaf2db9d2579731cb6950fd05a83a0f3a4f51",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-5.d",
      "new_id": "5c8e8b8393c66c64e21ffe586cb632426a3c5a1b",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-5.d"
    },
    {
      "type": "modify",
      "old_id": "b1854ac03f4f851bc142dc86eb0c0360fb7014f5",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-6.d",
      "new_id": "41f44fbc37e2dd3a5746f4c73724d7241a13e066",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-6.d"
    },
    {
      "type": "modify",
      "old_id": "c77b66fa9bc12cb656db4c12889457d29e835a11",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-7.d",
      "new_id": "b202edc863e1f00d9f9844ba7cdad7703024537d",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-7.d"
    },
    {
      "type": "modify",
      "old_id": "ca24227a02f7a1e2d5bcae451f52d8eb2948a2f3",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-8.d",
      "new_id": "0a38ddb1e4eb811b69e6a721969305e2188a9c06",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-8.d"
    },
    {
      "type": "modify",
      "old_id": "1155f4f2e338e33e7493f79411f9b0564f346f21",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-plugin/plugin-9.d",
      "new_id": "35fde40c0b1d2f42b0b6aa311f870a93dd378fbb",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-plugin/plugin-9.d"
    }
  ]
}
