)]}'
{
  "commit": "7bdf4127c38081c7764c0bf1db55d0b2e56391dc",
  "tree": "099667b65c51c4ba0289abadb4cf363f63fcf3b8",
  "parents": [
    "458ad2b83ecf4d764703767bccf19723ca741f00"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "andrew.burgess@embecosm.com",
    "time": "Wed Mar 22 17:27:49 2017 +0000"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "andrew.burgess@embecosm.com",
    "time": "Tue Jun 06 09:53:38 2017 +0100"
  },
  "message": "ld: Allow section groups to be resolved as part of a relocatable link\n\nThis commit adds a new linker feature: the ability to resolve section\ngroups as part of a relocatable link.\n\nCurrently section groups are automatically resolved when performing a\nfinal link, and are carried through when performing a relocatable link.\nBy carried through this means that one copy of each section group (from\nall the copies that might be found in all the input files) is placed\ninto the output file.  Sections that are part of a section group will\nnot match input section specifiers within a linker script and are\nforcibly kept as separate sections.\n\nThere is a slight resemblance between section groups and common\nsection.  Like section groups, common sections are carried through when\nperforming a relocatable link, and resolved (allocated actual space)\nonly at final link time.\n\nHowever, with common sections there is an ability to force the linker to\nallocate space for the common sections when performing a relocatable\nlink, there\u0027s currently no such ability for section groups.\n\nThis commit adds such a mechanism.  This new facility can be accessed in\ntwo ways, first there\u0027s a command line switch --force-group-allocation,\nsecond, there\u0027s a new linker script command FORCE_GROUP_ALLOCATION.  If\none of these is used when performing a relocatable link then the linker\nwill resolve the section groups as though it were performing a final\nlink, the section group will be deleted, and the members of the group\nwill be placed like normal input sections.  If there are multiple copies\nof the group (from multiple input files) then only one copy of the group\nmembers will be placed, the duplicate copies will be discarded.\n\nUnlike common sections that have the --no-define-common command line\nflag, and INHIBIT_COMMON_ALLOCATION linker script command there is no\nway to prevent group resolution during a final link, this is because the\nELF gABI specifically prohibits the presence of SHT_GROUP sections in a\nfully linked executable.  However, the code as written should make\nadding such a feature trivial, setting the new resolve_section_groups\nflag to false during a final link should work as you\u0027d expect.\n\nbfd/ChangeLog:\n\n\t* elf.c (_bfd_elf_make_section_from_shdr): Don\u0027t initially mark\n\tSEC_GROUP sections as SEC_EXCLUDE.\n\t(bfd_elf_set_group_contents): Replace use of abort with an assert.\n\t(assign_section_numbers): Use resolve_section_groups flag instead\n\tof relocatable link type.\n\t(_bfd_elf_init_private_section_data): Use resolve_section_groups\n\tflag instead of checking the final_link flag for part of the\n\tchecks in here.  Fix white space as a result.\n\t* elflink.c (elf_link_input_bfd): Use resolve_section_groups flag\n\tinstead of relocatable link type.\n\t(bfd_elf_final_link): Likewise.\n\ninclude/ChangeLog:\n\n\t* bfdlink.h (struct bfd_link_info): Add new resolve_section_groups\n\tflag.\n\nld/ChangeLog:\n\n\t* ld.h (struct args_type): Add force_group_allocation field.\n\t* ldgram.y: Add support for FORCE_GROUP_ALLOCATION.\n\t* ldlex.h: Likewise.\n\t* ldlex.l: Likewise.\n\t* lexsup.c: Likewise.\n\t* ldlang.c (unique_section_p): Check resolve_section_groups flag\n\tnot the relaxable link flag.\n\t(lang_add_section): Discard section groups when we\u0027re resolving\n\tgroups.  Clear the SEC_LINK_ONCE flag if we\u0027re resolving section\n\tgroups.\n\t* ldmain.c (main): Initialise resolve_section_groups flag in\n\tlink_info based on command line flags.\n\t* testsuite/ld-elf/group11.d: New file.\n\t* testsuite/ld-elf/group12.d: New file.\n\t* testsuite/ld-elf/group12.ld: New file.\n\t* NEWS: Mention new features.\n\t* ld.texinfo (Options): Document --force-group-allocation.\n\t(Miscellaneous Commands): Document FORCE_GROUP_ALLOCATION.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7dfc62fe896287731deafec8c449f7fcf570209d",
      "old_mode": 33188,
      "old_path": "bfd/ChangeLog",
      "new_id": "99329c84428cf667724938c679c8b41b680312d2",
      "new_mode": 33188,
      "new_path": "bfd/ChangeLog"
    },
    {
      "type": "modify",
      "old_id": "b0da500dc7aa4846da6f3482a3344687ff3431b7",
      "old_mode": 33188,
      "old_path": "bfd/elf.c",
      "new_id": "bab1e16f8ca3a44bc7aa1c0afcfc5c881a352447",
      "new_mode": 33188,
      "new_path": "bfd/elf.c"
    },
    {
      "type": "modify",
      "old_id": "7b001b78106e01c243e043666f967324f9cd8592",
      "old_mode": 33188,
      "old_path": "bfd/elflink.c",
      "new_id": "1b447bb785081844b2d577f364586d67c81328ce",
      "new_mode": 33188,
      "new_path": "bfd/elflink.c"
    },
    {
      "type": "modify",
      "old_id": "d034b2b54facb57bf8eff4bba86e34a4848b0410",
      "old_mode": 33188,
      "old_path": "include/ChangeLog",
      "new_id": "3818610b5ce59e8719b14a9e58e9a08bc2fe1274",
      "new_mode": 33188,
      "new_path": "include/ChangeLog"
    },
    {
      "type": "modify",
      "old_id": "371822c5fc6a9f3bcd405442c4f5ec21f1175e95",
      "old_mode": 33188,
      "old_path": "include/bfdlink.h",
      "new_id": "2e3f0b15aea88fde6e8a30941c4c500328328a2a",
      "new_mode": 33188,
      "new_path": "include/bfdlink.h"
    },
    {
      "type": "modify",
      "old_id": "0e52c27495ef31384f593934724c3b667c11d6d1",
      "old_mode": 33188,
      "old_path": "ld/ChangeLog",
      "new_id": "e80477ffafc24847058672d122298c87ba84809a",
      "new_mode": 33188,
      "new_path": "ld/ChangeLog"
    },
    {
      "type": "modify",
      "old_id": "52daa6bf57ed9ea6654b7a7e350bdfcd96a5c9e7",
      "old_mode": 33188,
      "old_path": "ld/NEWS",
      "new_id": "98055b5f4edd3bcac3461da74dbe616f3c767fb8",
      "new_mode": 33188,
      "new_path": "ld/NEWS"
    },
    {
      "type": "modify",
      "old_id": "104bb8e2376b192bd10000066cd98e84964cd043",
      "old_mode": 33188,
      "old_path": "ld/ld.h",
      "new_id": "d9bb65306ce2677ad68e3c4d079f2cb8bb10c7d9",
      "new_mode": 33188,
      "new_path": "ld/ld.h"
    },
    {
      "type": "modify",
      "old_id": "edf1e31a8bb3bbc215ad4dcab97053b96323f056",
      "old_mode": 33188,
      "old_path": "ld/ld.texinfo",
      "new_id": "790b52f0251f2558d67273e2879d75754ea34341",
      "new_mode": 33188,
      "new_path": "ld/ld.texinfo"
    },
    {
      "type": "modify",
      "old_id": "849f272f99a8df1fda61d9e75d54a43832012165",
      "old_mode": 33188,
      "old_path": "ld/ldgram.y",
      "new_id": "4c1efdc2ede526e2d1445bbc01fc4c4bc9bfe388",
      "new_mode": 33188,
      "new_path": "ld/ldgram.y"
    },
    {
      "type": "modify",
      "old_id": "ed7e5525ed06ecff730d40d0bb2e7863227dc032",
      "old_mode": 33188,
      "old_path": "ld/ldlang.c",
      "new_id": "252400bd510d8924c9ea343490d9bdc86f842ac5",
      "new_mode": 33188,
      "new_path": "ld/ldlang.c"
    },
    {
      "type": "modify",
      "old_id": "dac152b12d85948e356f8a310a635ff24026ece0",
      "old_mode": 33188,
      "old_path": "ld/ldlex.h",
      "new_id": "5aa7f6bc3e3d5fc29cdd438ca3bca75fd1df9f38",
      "new_mode": 33188,
      "new_path": "ld/ldlex.h"
    },
    {
      "type": "modify",
      "old_id": "acba1a2b4b63c1f8c28d463cb6f4b71c7f05d2bf",
      "old_mode": 33188,
      "old_path": "ld/ldlex.l",
      "new_id": "ba618ecc2715bdb380752e97a919c33563042e31",
      "new_mode": 33188,
      "new_path": "ld/ldlex.l"
    },
    {
      "type": "modify",
      "old_id": "2b3a59150f0320772e7f1a53bc407561c389d667",
      "old_mode": 33188,
      "old_path": "ld/ldmain.c",
      "new_id": "ee5ab1166ade91a6de329cc97ff3179c0ed8ba61",
      "new_mode": 33188,
      "new_path": "ld/ldmain.c"
    },
    {
      "type": "modify",
      "old_id": "0b7d4976ac90e719b25c43117957a757be9836f3",
      "old_mode": 33188,
      "old_path": "ld/lexsup.c",
      "new_id": "95c7e599b9fcbe4e54d563375395278d560be6ea",
      "new_mode": 33188,
      "new_path": "ld/lexsup.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "245cf4403824eae35387f8f220ed52184ca60a67",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-elf/group11.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "3fa7be8e09f8417ffdee9d034e2e26d9c882ddfa",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-elf/group12.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "4a36ee547f78eb38d321ce4787110f499f9ed898",
      "new_mode": 33188,
      "new_path": "ld/testsuite/ld-elf/group12.ld"
    }
  ]
}
