)]}'
{
  "commit": "d3ffd7f77654adafe5f1989bdfdbe4a337ff2e8b",
  "tree": "4175e17a9569dcc539f92e32ed3ec098328217ee",
  "parents": [
    "fd0ff19bf435b267caae6a1ae04e7b4a4ba64f5b"
  ],
  "author": {
    "name": "Nelson Chu",
    "email": "nelson.chu@sifive.com",
    "time": "Fri Nov 19 17:11:06 2021 +0800"
  },
  "committer": {
    "name": "Nelson Chu",
    "email": "nelson.chu@sifive.com",
    "time": "Fri Nov 19 18:50:27 2021 +0800"
  },
  "message": "RISC-V: Support new .option arch directive.\n\nhttps://github.com/riscv/riscv-asm-manual/pull/67\n\nFormat:\n.option arch, +\u003cextension\u003e\u003cversion\u003e, ...\n.option arch, -\u003cextension\u003e\n.option arch, \u003d\u003cISA string\u003e\n\nThe new direcitve is used to enable/disable extensions for the specific\ncode region.  For example,\n\n.attribute arch, \"rv64ic\"   # arch \u003d rv64i2p0_c2p0\n.option push\n.option arch, +d2p0, -c     # arch \u003d rv64i2p0_f2p0_d2p0, f is added implied\n.option arch, \u003drv32gc       # arch \u003d rv32i2p0_m2p0_a2p0_f2p0_d2p0_c2p0\n.option pop                 # arch \u003d rv64i2p0_c2p0\n\nNote that,\n1. \".option rvc/norvc\" have the same behavior as \".option arch +c/-c\".\n2. \".option arch -i\" is illegal, since we cannot remove base i extension.\n3. If arch\u003drv64i2p0, then \".option arch, +i3p0\" will update the i\u0027s version\n   from 2.0 to 3.0.\n4. If arch\u003drv64i3p0, then \".option arch, +i\" will update the i\u0027s version\n   from 2.0 to the default one according to the chosen isa spec.\n\nbfd/\n\t* elfxx-riscv.c (riscv_add_subset): If the subset is already added,\n\tand the new versions are not RISCV_UNKNOWN_VERSION, then update the\n\tversions to the subset list.\n\t(riscv_copy_subset): New function.  Copy the subset from list.\n\t(riscv_copy_subset_list): New function.  Return the new copyed list.\n\t(riscv_update_subset): Updated to make .option arch directives workable.\n\t* elfxx-riscv.h: Updated.\ngas/\n\t* config/tc-riscv.c (riscv_subsets): Defined as a pointer.\n\t(riscv_rps_as): Init the subset_list to NULL, we will set it later\n\tonce riscv_opts_stack is created or updated.\n\t(struct riscv_option_stack, riscv_opts_stack): Moved forward.\n\t(riscv_set_arch): Updated.\n\t(s_riscv_option): Support new .option arch directive, to add, remove\n\tor update subsets for the specific code region.\n\t(riscv_write_out_attrs): Updated.\n\t* doc/c-riscv.texi: Added document for new .option arch directive.\n\t* testsuite/gas/riscv/option-arch-01a.d: New testcase.\n\t* testsuite/gas/riscv/option-arch-01b.d: Likewise.\n\t* testsuite/gas/riscv/option-arch-01.s: Likewise..\n\t* testsuite/gas/riscv/option-arch-02.d: Likewise.\n\t* testsuite/gas/riscv/option-arch-02.s: Likewise.\n\t* testsuite/gas/riscv/option-arch-fail.d: Likewise.\n\t* testsuite/gas/riscv/option-arch-fail.l: Likewise.\n\t* testsuite/gas/riscv/option-arch-fail.s: Likewise.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "91afd4c715f420351a585aac7ce85f0a5b914f8d",
      "old_mode": 33188,
      "old_path": "bfd/elfxx-riscv.c",
      "new_id": "b8da40ce2b414f1031af627ef46785fd8b0dc9df",
      "new_mode": 33188,
      "new_path": "bfd/elfxx-riscv.c"
    },
    {
      "type": "modify",
      "old_id": "8de9adca0b175b7c4b23e94ec95c72d886b2b6ec",
      "old_mode": 33188,
      "old_path": "bfd/elfxx-riscv.h",
      "new_id": "ea7edc42f358d55e4b93be12b5a8b3585dca9438",
      "new_mode": 33188,
      "new_path": "bfd/elfxx-riscv.h"
    },
    {
      "type": "modify",
      "old_id": "930cfb2125a3c2f36bc10cbca42a0eb74ccd29db",
      "old_mode": 33188,
      "old_path": "gas/config/tc-riscv.c",
      "new_id": "da3d91156672d74ef4a5b57de1f7ab1cf7c1c23e",
      "new_mode": 33188,
      "new_path": "gas/config/tc-riscv.c"
    },
    {
      "type": "modify",
      "old_id": "bfbf61d64a753368d32792973cfb2272f22a4ee0",
      "old_mode": 33188,
      "old_path": "gas/doc/c-riscv.texi",
      "new_id": "697be3a699698c9cc8c08564a309776abb6e2ac6",
      "new_mode": 33188,
      "new_path": "gas/doc/c-riscv.texi"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "201f9b3702351b14844ed456b84342582cbfa60f",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/riscv/option-arch-01.s"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "59bc1d29664a48a508a80cb3954b2e71f18b4fac",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/riscv/option-arch-01a.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "9a6c2c528ca6ccb380d90e7d5f309b7e83efb218",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/riscv/option-arch-01b.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0fe89ecaecbdc0d7a2d78db9b20e091d51866e7f",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/riscv/option-arch-02.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f4ceee8426ae0fcdc1eea27d643348604e9d7aeb",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/riscv/option-arch-02.s"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b621d036c29e3ba4fc046576e2aa2eec904e9037",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/riscv/option-arch-03.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7183140b028ac01b6406fe744bf4a9494fe0f056",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/riscv/option-arch-03.s"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "bce5d324f37d6006ce501b16bf7f424254b00f1e",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/riscv/option-arch-fail.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "3e0599e8e0e582b1cedc983791c8ba1cf77192a1",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/riscv/option-arch-fail.l"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a0b1bdef3228a7e8cfbe737d49aa32d7afba38e1",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/riscv/option-arch-fail.s"
    }
  ]
}
