)]}'
{
  "commit": "2c726047023a0809016f8e0b663f0238f4156227",
  "tree": "33464f777a4d59e3b7579649f43955d1956c4cf9",
  "parents": [
    "dae7170ce45119d1a55cb62b864c44bec998d924"
  ],
  "author": {
    "name": "bd1976llvm",
    "email": "Ben.Dunbobbin@sony.com",
    "time": "Thu Apr 16 10:45:31 2020 +0000"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Thu Oct 22 18:17:22 2020 -0700"
  },
  "message": "[MC][ELF] Put explicit section name symbols into entry size compatible sections\n\nEnsure that symbols explicitly* assigned a section name are placed into\na section with a compatible entry size.\n\nThis is done by creating multiple sections with the same name** if\nincompatible symbols are explicitly given the name of an incompatible\nsection, whilst:\n\n  - Avoiding using uniqued sections where possible (for readability and\n    to maximize compatibly with assemblers).\n\n  - Creating as few SHF_MERGE sections as possible (for efficiency).\n\nGiven that each symbol is assigned to a section in a single pass, we\nmust decide which section each symbol is assigned to without seeing the\nproperties of all symbols. A stable and easy to understand assignment is\ndesirable. The following rules facilitate this: The \"generic\" section\nfor a given section name will be mergeable if the name is a mergeable\n\"default\" section name (such as .debug_str), a mergeable \"implicit\"\nsection name (such as .rodata.str2.2), or MC has already created a\nmergeable \"generic\" section for the given section name (e.g. in response\nto a section directive in inline assembly). Otherwise, the \"generic\"\nsection for a given name is non-mergeable; and, non-mergeable symbols\nare assigned to the \"generic\" section, while mergeable symbols are\nassigned to uniqued sections.\n\nTerminology:\n\"default\" sections are those always created by MC initially, e.g. .text\nor .debug_str.\n\n\"implicit\" sections are those created normally by MC in response to the\nsymbols that it encounters, i.e. in the absence of an explicit section\nname assignment on the symbol, e.g. a function foo might be placed into\na .text.foo section.\n\n\"generic\" sections are those that are referred to when a unique section\nID is not supplied, e.g. if there are multiple unique .bob sections then\n\".quad .bob\" will reference the generic .bob section. Typically, the\ngeneric section is just the first section of a given name to be created.\nDefault sections are always generic.\n\n* Typically, section names might be explicitly assigned in source code\nusing a language extension e.g. a section attribute: _attribute_\n((section (\"section-name\"))) -\nhttps://clang.llvm.org/docs/AttributeReference.html\n\n** I refer to such sections as unique/uniqued sections. In assembly the\n\", unique,\" assembly syntax is used to express such sections.\n\nFixes https://bugs.llvm.org/show_bug.cgi?id\u003d43457.\n\nSee https://reviews.llvm.org/D68101 for previous discussions leading to\nthis patch.\n\nSome minor fixes were required to LLVM\u0027s tests, for tests had been using\nthe old behavior - which allowed for explicitly assigning globals with\nincompatible entry sizes to a section.\n\nThis fix relies on the \",unique ,\" assembly feature. This feature is not\navailable until bintuils version 2.35\n(https://sourceware.org/bugzilla/show_bug.cgi?id\u003d25380). If the\nintegrated assembler is not being used then we avoid using this feature\nfor compatibility and instead try to place mergeable symbols into\nnon-mergeable sections or issue an error otherwise.\n\nDifferential Revision: https://reviews.llvm.org/D72194\n\nGitOrigin-RevId: 86478d3de91a81978c2c310fda13f04541cd3b23\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "44db0eacca1a336811e25a8ed5ec039ddeb2dae9",
      "old_mode": 33188,
      "old_path": "include/llvm/IR/DiagnosticInfo.h",
      "new_id": "a8e8a7915b2a4d007ddc2ad52e61d8318ab5f73e",
      "new_mode": 33188,
      "new_path": "include/llvm/IR/DiagnosticInfo.h"
    },
    {
      "type": "modify",
      "old_id": "9e02bd1a4be0f7708b24c7a85c523b49aace1a93",
      "old_mode": 33188,
      "old_path": "include/llvm/MC/MCContext.h",
      "new_id": "b1fa8e7a1d0ef97eed4a9aa3b9bb7a3b41971a5c",
      "new_mode": 33188,
      "new_path": "include/llvm/MC/MCContext.h"
    },
    {
      "type": "modify",
      "old_id": "0acea0871dab4016309381d5af00a0d87c4f4414",
      "old_mode": 33188,
      "old_path": "lib/CodeGen/TargetLoweringObjectFileImpl.cpp",
      "new_id": "a5f380168c10e311fea526a51c41482a060f7a75",
      "new_mode": 33188,
      "new_path": "lib/CodeGen/TargetLoweringObjectFileImpl.cpp"
    },
    {
      "type": "modify",
      "old_id": "f68320fa9ada18539b33b1ded250bb3c7de1125c",
      "old_mode": 33188,
      "old_path": "lib/MC/MCContext.cpp",
      "new_id": "1bc313553affdbb93190702d8549e06a59dad945",
      "new_mode": 33188,
      "new_path": "lib/MC/MCContext.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2b60a19247df2a4820f4c3213c286f6885338d47",
      "new_mode": 33188,
      "new_path": "test/CodeGen/X86/explicit-section-mergeable.ll"
    },
    {
      "type": "modify",
      "old_id": "c1eb45566cf17f96e053dc7bf64706838894072b",
      "old_mode": 33188,
      "old_path": "unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp",
      "new_id": "02747b69b1c94e0d98b0b85e1c6f1a09bd87424e",
      "new_mode": 33188,
      "new_path": "unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp"
    },
    {
      "type": "modify",
      "old_id": "9a50571b19696a80bde03b9f9acc7bbdb64e5bcd",
      "old_mode": 33188,
      "old_path": "unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp",
      "new_id": "4a192c1f28ac343874942cbb2b44b710da804069",
      "new_mode": 33188,
      "new_path": "unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp"
    }
  ]
}
