From 1f6e88102435f0b9ae66f0b8e971eae566dd467f Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 30 Sep 2010 21:45:14 -0400 Subject: [PATCH] PR10812: activate build-id relocation code only for module("...") The relocation-basis can be null or something else for user-space executables etc. * translate.cxx (dump_unwindsyms): Skip build-id relocation for modname /FOO. --- translate.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/translate.cxx b/translate.cxx index 8664f5530..464ae085b 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4913,7 +4913,7 @@ dump_unwindsyms (Dwfl_Module *m, } #endif - if (modname != "kernel") + if (modname != "kernel" && modname[0] != '/') // => kernel module { Dwarf_Addr reloc_vaddr = build_id_vaddr; const char *secname; @@ -4925,6 +4925,11 @@ dump_unwindsyms (Dwfl_Module *m, secname = dwfl_module_relocation_info (m, i, NULL); // assert same section name as in runtime/transport/symbols.c + // NB: this is applicable only to module("...") probes. + // process("...") ones may have relocation bases like '.dynamic', + // and so we'll have to store not just a generic offset but + // the relocation section/symbol name too: just like we do + // for probe PC addresses themselves. if (!secname || strcmp(secname, ".note.gnu.build-id")) throw semantic_error ("unexpected build-id reloc section " + string(secname ?: "null")); -- 2.43.5