Correct Thumb function bound computation in the symbolizer
authorBenjamin Barenblat <bbaren@google.com>
Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)
committerBenjamin Barenblat <bbaren@debian.org>
Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)
commit78b8180162ef90c9a3fd885cce462c17440c8a13
tree29f1aadabe6230548ac7661786c1e379f801b4ca
parent6cbea056d81e954392369feb41ef712e715efd07
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