Bug 11814

Summary: build-id offset calculations missing relocation for some .ko
Product: systemtap Reporter: Frank Ch. Eigler <fche>
Component: translatorAssignee: Unassigned <systemtap>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Frank Ch. Eigler 2010-07-13 18:50:40 UTC
tonyj @ suse reports a case where translator.cxx appears to emit
incorrect buildid-offset values into stap-symbols.h, which leads
to verification errors & aborted scripts.

 honeydew:/sys/module/libata/sections/:[0]# grep .
/sys/module/libata/sections/.??* | sort
 /sys/module/libata/sections/.bss:0xd000000000c7c918
 /sys/module/libata/sections/.data.rel.ro:0xd000000000c67370
 /sys/module/libata/sections/.data.rel:0xd000000000c79718
 /sys/module/libata/sections/.data:0xd000000000c67268
 /sys/module/libata/sections/.exit.text:0xd000000000c5d2fc
 /sys/module/libata/sections/.gnu.linkonce.this_module:0xd000000000c7c6d8
 /sys/module/libata/sections/.note.gnu.build-id:0xd000000000c67244
 /sys/module/libata/sections/.opd:0xd000000000c7a788
 /sys/module/libata/sections/.rodata.str1.8:0xd000000000c62e20
 /sys/module/libata/sections/.rodata:0xd000000000c607e8
 /sys/module/libata/sections/.strtab:0xd000000000cb9a50
 /sys/module/libata/sections/.stubs:0xd000000000c5d8d8
 /sys/module/libata/sections/.symtab:0xd000000000cb0000
 /sys/module/libata/sections/.text:0xd000000000c40000
 /sys/module/libata/sections/.toc1:0xd000000000c79a68
 /sys/module/libata/sections/.toc:0xd000000000c7c6a8

the buildid-offset should be on the order of a few dozen, since runtime/sym.c
properly relocates .ko buildids against the .notes section base.  However,
stap was found to emit ...

tonyj Found build-id in libata, length 20, end at 0x87d7c
tonyj build_id_offset = 0x87d7c - 0x4bd00= 0x3c07c

It appears as if translate.cxx:5384, the XXX section related to build_id_offset
calculation, is neglecting to perform elfutils relocation on the incoming
vaddr for .ko files.
 
There is no theory yet as to why only some .ko's are manifesting this problem.
Comment 1 Frank Ch. Eigler 2011-05-14 14:22:57 UTC
Believed to be solved with
commit 71fa1fe39faa153cf6ede620c4855e508059aa39
Author: Tony Jones <tonyj@suse.de>
Date:   Wed Sep 29 12:47:52 2010 -0400

    PR10812: relocate module build-id

*** This bug has been marked as a duplicate of bug 10812 ***