)]}'
{
  "commit": "ebb191adac4ab45498dec0bfaac62f0a33537ba4",
  "tree": "34999ecb8d01541fde94b8a70b3164d80682a516",
  "parents": [
    "29ba33db77f22a54d97db90cb87c39126efad3db"
  ],
  "author": {
    "name": "H.J. Lu",
    "email": "hjl.tools@gmail.com",
    "time": "Wed Feb 09 15:51:22 2022 -0800"
  },
  "committer": {
    "name": "H.J. Lu",
    "email": "hjl.tools@gmail.com",
    "time": "Fri Feb 11 10:24:54 2022 -0800"
  },
  "message": "x86: Disallow invalid relocation against protected symbol\n\nI am checking this into master and will backport it to 2.38 branch.\n\nH.J\n----\nOn x86, GCC 12 supports -mno-direct-extern-access to enable canonical\nreference to protected function and disable copy relocation.  With\n-mno-direct-extern-access, the canonical protected function symbols must\nbe accessed via canonical reference and the protected data symbols in\nshared libraries are non-copyable. Under glibc 2.35, non-canonical\nreference to the canonical protected function will get the run-time error:\n\n./y: internal_f: ./libfoo.so: non-canonical reference to canonical protected function\n\nand copy relocations against the non-copyable protected symbols will get\nthe run-time error:\n\n./x: internal_i: ./libfoo.so: copy relocation against non-copyable protected symbol\n\nUpdate x86 linker to disallow non-canonical reference to the canonical\nprotected function:\n\nld: plt.o: non-canonical reference to canonical protected function `internal_f\u0027 in libfoo.so\nld: failed to set dynamic section sizes: bad value\n\nand copy relocation against the non-copyable protected symbol:\n\nld: main.o: copy relocation against non-copyable protected symbol `internal_i\u0027 in libfoo.so\n\nat link-time.\n\nbfd/\n\n\tPR ld/28875\n\t* elf-properties.c (_bfd_elf_parse_gnu_properties): Don\u0027t skip\n\tshared libraries for GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS.\n\t* elf32-i386.c (elf_i386_scan_relocs): Disallow non-canonical\n\treference to canonical protected function.\n\t* elf64-x86-64.c (elf_x86_64_scan_relocs): Likewise.\n\t* elfxx-x86.c (elf_x86_allocate_dynrelocs): Don\u0027t allow copy\n\trelocation against non-copyable protected symbol.\n\nld/\n\n\tPR ld/28875\n\t* testsuite/ld-i386/i386.exp: Check non-canonical reference to\n\tcanonical protected function and check copy relocation against\n\tnon-copyable protected symbol.\n\t* testsuite/ld-i386/pr21997-1.err: New file.\n\t* testsuite/ld-i386/pr28875.err: Likewise.\n\t* testsuite/ld-i386/pr28875a.c: Likewise.\n\t* testsuite/ld-i386/pr28875b.c: Likewise.\n\t* testsuite/ld-x86-64/pr21997-1a.err: Updated.\n\t* testsuite/ld-x86-64/pr21997-1b.err: Likewise.\n\t* testsuite/ld-x86-64/pr28875-data.err: New file.\n\t* testsuite/ld-x86-64/pr28875-func.err: Likewise.\n\t* testsuite/ld-x86-64/x86-64.exp: Check non-canonical reference\n\tto canonical protected function and check copy relocation against\n\tnon-copyable protected symbol.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "bf4f70d62566e04cdb2867011464a3fd881af0df",
      "old_mode": 33188,
      "old_path": "bfd/elf-properties.c",
      "new_id": "d67aadde16b778477b2d8f73dce0eac74edb5417",
      "new_mode": 33188,
      "new_path": "bfd/elf-properties.c"
    },
    {
      "type": "modify",
      "old_id": "25977cc56bd6b73aa75205f11943ca08592ad631",
      "old_mode": 33188,
      "old_path": "bfd/elf32-i386.c",
      "new_id": "fb5ed161f50c4cde39e8d7b24fe843fe18aaad09",
      "new_mode": 33188,
      "new_path": "bfd/elf32-i386.c"
    },
    {
      "type": "modify",
      "old_id": "02ca55200bb2320549aaa4dd1eb03d555cadc8fc",
      "old_mode": 33188,
      "old_path": "bfd/elf64-x86-64.c",
      "new_id": "b5718e71121fc58d6bf7277b81f57a45bdd42890",
      "new_mode": 33188,
      "new_path": "bfd/elf64-x86-64.c"
    },
    {
      "type": "modify",
      "old_id": "d00dc45677b71832789002b9321f93a7951f4685",
      "old_mode": 33188,
      "old_path": "bfd/elfxx-x86.c",
      "new_id": "acb2cc8528db8f69bd5168da42cd64bcdabd1905",
      "new_mode": 33188,
      "new_path": "bfd/elfxx-x86.c"
    },
    {
      "type": "modify",
      "old_id": "82e14ab38d05b842b8a7c4271c5bd771fdfaa1cb",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-i386/i386.exp",
      "new_id": "d997c757325833847bb225e5ac1aa7e9c0c51404",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-i386/i386.exp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e46f1cebeb933a835a7f5600722ee1faa83fc32c",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-i386/pr21997-1.err"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "46f6f47dfd31ba5176bce1b483e7a4b5e54a482f",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-i386/pr28875.err"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "d24cf29faac4bf6ce423b5536339ffe6823e52df",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-i386/pr28875a.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2c0381d4252c64be3f31fbcba741adc21b6414da",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-i386/pr28875b.c"
    },
    {
      "type": "modify",
      "old_id": "e57ebd1f4613333eaeb13717890f046a08f8261e",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-x86-64/pr21997-1a.err",
      "new_id": "e46f1cebeb933a835a7f5600722ee1faa83fc32c",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-x86-64/pr21997-1a.err"
    },
    {
      "type": "modify",
      "old_id": "a99fc1d5149e6a227cb8643312a3db88c71ea088",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-x86-64/pr21997-1b.err",
      "new_id": "af028b7d5e9c612c268caf583048e4207c3f2aaa",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-x86-64/pr21997-1b.err"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "62dd5b042237a829e23da7502fa6d9633773685d",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-x86-64/pr28875-data.err"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "64e961cb3d4771fe726603f2ab3b180dbff9ad05",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-x86-64/pr28875-func.err"
    },
    {
      "type": "modify",
      "old_id": "3bfc5e6e467c6739c596576a57d21dece104790e",
      "old_mode": 33188,
      "old_path": "ld/testsuite/ld-x86-64/x86-64.exp",
      "new_id": "c6d88a97f497cfcac4fefa22e6a8f5502f628736",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-x86-64/x86-64.exp"
    }
  ]
}
