Correct Thumb function bound computation in the symbolizer
authorBenjamin Barenblat <bbaren@google.com>
Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)
committerBenjamin Barenblat <bbaren@debian.org>
Thu, 14 Apr 2022 17:20:16 +0000 (18:20 +0100)
commit5b15cab0e6927ba2395c2a1ff316c237c4e354de
tree1efc7f120abca0dbbb04a1780492e03d6d707eb1
parent3dc91e56d07c1744f11851f34f74883b64b175a4
Correct Thumb function bound computation in the symbolizer

Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/1ae9b71c474628d60eb251a3f62967fe64151bb2

On 32-bit ARM, all functions are aligned to multiples of two bytes, and
the lowest-order bit in a function’s address is ignored by the CPU when
computing branch targets. That bit is still present in instructions and
ELF symbol tables, though; it’s repurposed to indicate whether the
function contains ARM or Thumb code. If the symbolizer doesn’t ignore
that bit, it will believe Thumb functions have boundaries that are off
by one byte, so instruct the symbolizer to null out the lowest-order bit
after retrieving it from the symbol table.

The author works at Google. Upstream applied this patch as Piper
revision 369254082 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.

Gbp-Pq: Name thumb-function-bounds.diff
absl/debugging/symbolize_elf.inc
absl/debugging/symbolize_test.cc