summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/sym.c3
-rw-r--r--translate.cxx5
2 files changed, 5 insertions, 3 deletions
diff --git a/runtime/sym.c b/runtime/sym.c
index dd2235cc..856ccbcc 100644
--- a/runtime/sym.c
+++ b/runtime/sym.c
@@ -259,7 +259,8 @@ static int _stp_module_check(void)
/* notes end address */
if (!strcmp(m->name, "kernel")) {
- notes_addr = m->build_id_offset;
+ notes_addr = _stp_module_relocate("kernel",
+ "_stext", m->build_id_offset);
base_addr = _stp_module_relocate("kernel",
"_stext", 0);
} else {
diff --git a/translate.cxx b/translate.cxx
index 9a25df61..88968d45 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -4928,11 +4928,12 @@ dump_unwindsyms (Dwfl_Module *m,
c->output << ".build_id_len = " << build_id_len << ",\n";
/* XXX: kernel data boot-time relocation works differently from text.
- This hack disables relocation altogether, but that's not necessarily
+ This hack assumes that offset between _stext and build id
+ stays constant after relocation, but that's not necessarily
correct either. We may instead need a relocation basis different
from _stext, such as __start_notes. */
if (modname == "kernel")
- c->output << ".build_id_offset = 0x" << hex << build_id_vaddr
+ c->output << ".build_id_offset = 0x" << hex << build_id_vaddr - (base + extra_offset)
<< dec << ",\n";
else
c->output << ".build_id_offset = 0x" << hex