From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6663 invoked by alias); 25 Feb 2009 01:47:06 -0000 Received: (qmail 6656 invoked by uid 22791); 25 Feb 2009 01:47:05 -0000 X-SWARE-Spam-Status: No, hits=0.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from elastic.org (HELO elastic.org) (69.20.226.105) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Feb 2009 01:47:01 +0000 Received: from fche by elastic.org with local (auth fche) (Exim 4.69) id 1Lc8qs-0004bF-Be for systemtap@sources.redhat.com; Tue, 24 Feb 2009 20:46:22 -0500 Date: Wed, 25 Feb 2009 02:16:00 -0000 From: "Frank Ch. Eigler" To: systemtap@sources.redhat.com Subject: rfc patch for buildid < shlib base address Message-ID: <20090225014622.GA17348@elastic.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00515.txt.bz2 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";