diff options
author | Eugeniy Meshcheryakov <eugen@debian.org> | 2009-09-07 11:01:14 +0200 |
---|---|---|
committer | Eugeniy Meshcheryakov <eugen@debian.org> | 2009-09-07 11:01:14 +0200 |
commit | 201e18a8841a2cb341a752ca180014a3b8fe5234 (patch) | |
tree | c5f99def7d6ca026416651aa400fab9d5f96a8fc /translate.cxx | |
parent | 1393520fe0a1064665938bcea0d6382610a478b0 (diff) | |
download | systemtap-steved-201e18a8841a2cb341a752ca180014a3b8fe5234.tar.gz systemtap-steved-201e18a8841a2cb341a752ca180014a3b8fe5234.tar.xz systemtap-steved-201e18a8841a2cb341a752ca180014a3b8fe5234.zip |
Fix build-id check for relocatable kernel
Save offset of build id relative to _stext instead of absolute
address for kernel and apply relocations at run-time. This fixes
Debian bug #545277 (http://bugs.debian.org/545277).
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
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 |