1 From 183c7a7a8167333c873525f7908913837b8dc3cb Mon Sep 17 00:00:00 2001
2 From: Victor Kamensky <kamensky@cisco.com>
3 Date: Tue, 20 Mar 2018 12:41:05 -0500
4 Subject: [PATCH] _stp_umodule_relocate needs target file path, not host file
7 Strip of sysroot from module name is required when _stp_umodule_relocate
8 call is generated. Otherwise path won't match path on target and could
9 will fail to calculated address within the file.
11 Upstream-Status: Backport
12 Signed-off-by: Victor Kamensky <kamensky@cisco.com>
14 loc2stap.cxx | 5 ++++-
15 1 file changed, 4 insertions(+), 1 deletion(-)
17 diff --git a/loc2stap.cxx b/loc2stap.cxx
18 index 4818ee0..e09954f 100644
27 #if ! _ELFUTILS_PREREQ(0, 153)
28 #define DW_OP_GNU_entry_value 0xf3
29 @@ -106,7 +107,9 @@ location_context::translate_address(Dwarf_Addr addr)
30 c = "/* pragma:vma */ "
31 "({ unsigned long addr = 0; "
32 "addr = _stp_umodule_relocate (\""
33 - + resolve_path(dw->module_name.c_str()) + "\", "
34 + + path_remove_sysroot(dw->sess,
35 + resolve_path(dw->module_name.c_str()))
38 + ", current); addr; })";