)]}'
{
  "commit": "4454bbf4cac4083a180edc71f15aeba9697265f3",
  "tree": "f2af48328a8eb06d3ce6fba0a8a04c905efb632e",
  "parents": [
    "b956c52c878776391430443706d884c124610c41"
  ],
  "author": {
    "name": "Ryan Prichard",
    "email": "rprichard@google.com",
    "time": "Wed Oct 16 02:38:47 2019 +0000"
  },
  "committer": {
    "name": "Ryan Prichard",
    "email": "rprichard@google.com",
    "time": "Wed Oct 16 02:38:47 2019 +0000"
  },
  "message": "[libunwind][Android] Improve workaround for PIE zero-dlpi_addr bug\n\nSummary:\nThe workaround added in https://reviews.llvm.org/rL299575 appears to be\nworking around a bug in Android JB 4.1.x and 4.2.x (API 16 and 17).\n\nStarting in API 16, Android added support for PIE binaries, but the\ndynamic linker failed to initialize dlpi_addr to the address that the\nexecutable was loaded at. The bug was fixed in Android JB 4.3.x (API 18).\n\nImprove the true load bias calculation:\n\n * The code was assuming that the first segment would be the PT_PHDR\n   segment. I think it\u0027s better to be explicit and search for PT_PHDR. (It\n   will be almost as fast in practice.)\n\n * It\u0027s more correct to use p_vaddr rather than p_offset. If a PIE\n   executable is linked with a non-zero image base (e.g. lld\u0027s\n   -Wl,--image-base\u003dxxxx), then we must use p_vaddr here.\n\nThe \"phdr-\u003ep_vaddr \u003c image_base\" condition seems unnecessary and maybe\nslightly wrong. If the OS were to load a binary at an address smaller than\na vaddr in the binary, we would still want to do this workaround.\n\nThe workaround is safe when the linker bug isn\u0027t present, because it\nshould calculate an image_base equal to dlpi_addr. Note that with API 21\nand up, this workaround should never activate for dynamically-linked\nobjects, because non-PIE executables aren\u0027t allowed.\n\nConsolidate the fix into a single block of code that calculates the true\nimage base, and make it clear that the fix no longer applies after API 18.\n\nSee https://github.com/android/ndk/issues/505 for details.\n\nReviewers: mclow.lists, srhines, danalbert, compnerd\n\nReviewed By: compnerd\n\nSubscribers: srhines, krytarowski, christof, libcxx-commits\n\nTags: #libc\n\nDifferential Revision: https://reviews.llvm.org/D68971\n\ngit-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@374969 91177308-0d34-0410-b5e6-96231b3b80d8\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "bf57fdacbe6a76404523d394263e9cdc2ab6a91a",
      "old_mode": 33188,
      "old_path": "src/AddressSpace.hpp",
      "new_id": "6c134086e0ba9e82d82686d9817f8f1726dfc0e3",
      "new_mode": 33188,
      "new_path": "src/AddressSpace.hpp"
    }
  ]
}
