public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* rfc patch for buildid < shlib base address
@ 2009-02-25  2:16 Frank Ch. Eigler
  2009-02-25  2:38 ` Roland McGrath
  0 siblings, 1 reply; 9+ messages in thread
From: Frank Ch. Eigler @ 2009-02-25  2:16 UTC (permalink / raw)
  To: systemtap

Hi -

On my i686 F10 box, elfutils 0.140 probing /lib/libc-2.9.so, the
buildid data logic results in an address that is smaller than the dwfl
relocation base address for the module.  readelf indicates the
build-id .note section well before .text.  This causes a negative
offset, which in turn causes a pass-4 compile error.

The following patch papers over the issue by making this particular
offset a signed quantity.  I'd appreciate mjw/roland sanity checking,
and someone confirming that we actually check buildids of userspace
modules.

- FChE

diff --git a/runtime/sym.h b/runtime/sym.h
index e642cab..169f9d3 100644
--- a/runtime/sym.h
+++ b/runtime/sym.h
@@ -47,7 +47,7 @@ struct _stp_module {
 	uint32_t unwind_is_ehframe; /* unwind data comes from .eh_frame */
 	/* build-id information */
 	unsigned char *build_id_bits;
-	unsigned long  build_id_offset;
+	long     long  build_id_offset;
 	unsigned long  notes_sect;
 	int build_id_len;
 };
diff --git a/translate.cxx b/translate.cxx
index 135830d..6946758 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -4713,12 +4713,11 @@ dump_unwindsyms (Dwfl_Module *m,
        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
-                << dec << ",\n";
+      c->output << ".build_id_offset = " << build_id_vaddr << ",\n";
     else
-      c->output << ".build_id_offset = 0x" << hex
-                << build_id_vaddr - base
-                << dec << ",\n";
+      c->output << ".build_id_offset = "
+                << (signed long long)(build_id_vaddr - base)
+                << ",\n";
   } else
     c->output << ".build_id_len = 0,\n";
   

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-03-16 13:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-25  2:16 rfc patch for buildid < shlib base address Frank Ch. Eigler
2009-02-25  2:38 ` Roland McGrath
2009-02-25  2:53   ` Frank Ch. Eigler
2009-02-25  3:02     ` Roland McGrath
2009-02-25 22:15       ` Mark Wielaard
2009-03-16  5:20         ` Mark Wielaard
2009-03-16  6:16           ` Mark Wielaard
2009-03-16  6:32             ` Mark Wielaard
2009-03-16 17:28               ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).