]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
faddr2line: Fix overlapping text section failures, the sequel
authorJosh Poimboeuf <jpoimboe@kernel.org>
Thu, 2 Jun 2022 00:42:22 +0000 (17:42 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:53:30 +0000 (10:53 +0200)
commit11e900f34dc3843146650d37f416a5aa0645c438
treefb01be529a3ba7664a3963478c3a525a85f7d2b5
parent6cdbe14d65b91f81ed368d603ff1a339cb3d1fe8
faddr2line: Fix overlapping text section failures, the sequel

BugLink: https://bugs.launchpad.net/bugs/1983149
[ Upstream commit dcea997beed694cbd8705100ca1a6eb0d886de69 ]

If a function lives in a section other than .text, but .text also exists
in the object, faddr2line may wrongly assume .text.  This can result in
comically wrong output.  For example:

  $ scripts/faddr2line vmlinux.o enter_from_user_mode+0x1c
  enter_from_user_mode+0x1c/0x30:
  find_next_bit at /home/jpoimboe/git/linux/./include/linux/find.h:40
  (inlined by) perf_clear_dirty_counters at /home/jpoimboe/git/linux/arch/x86/events/core.c:2504

Fix it by passing the section name to addr2line, unless the object file
is vmlinux, in which case the symbol table uses absolute addresses.

Fixes: 1d1a0e7c5100 ("scripts/faddr2line: Fix overlapping text section failures")
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/7d25bc1408bd3a750ac26e60d2f2815a5f4a8363.1654130536.git.jpoimboe@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
scripts/faddr2line