From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22755 invoked by alias); 9 Jul 2007 18:43:46 -0000 Received: (qmail 22746 invoked by uid 22791); 9 Jul 2007 18:43:45 -0000 X-Spam-Check-By: sourceware.org Received: from alnrmhc13.comcast.net (HELO alnrmhc13.comcast.net) (204.127.225.93) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 09 Jul 2007 18:43:42 +0000 Received: from lucon.org ([24.6.230.138]) by comcast.net (alnrmhc13) with ESMTP id <20070709184341b1300jbl68e>; Mon, 9 Jul 2007 18:43:41 +0000 Received: by lucon.org (Postfix, from userid 500) id C933BF8249; Mon, 9 Jul 2007 11:43:40 -0700 (PDT) Date: Mon, 09 Jul 2007 18:56:00 -0000 From: "H.J. Lu" To: binutils@sources.redhat.com Subject: PATCH: PR binutils/4756: addr2line fails on relocatable linux kernel Message-ID: <20070709184340.GA14140@lucon.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.14 (2007-02-12) Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00190.txt.bz2 bfd_simple_get_relocated_section_content shouldn't apply relocations on executable and shared library with relocations. This patch uses the same check in binutils/objdump.c. H.J. --- 2007-07-09 H.J. Lu PR binutils/4756 * simple.c (bfd_simple_get_relocated_section_content): Don't apply relocation on executable and shared library. --- bfd/simple.c.reloc 2007-07-03 10:51:13.000000000 -0700 +++ bfd/simple.c 2007-07-09 11:28:26.000000000 -0700 @@ -162,7 +162,8 @@ bfd_simple_get_relocated_section_content int storage_needed; void *saved_offsets; - if (! (sec->flags & SEC_RELOC)) + if ((abfd->flags & (HAS_RELOC | EXEC_P | DYNAMIC)) != HAS_RELOC + || ! (sec->flags & SEC_RELOC)) { bfd_size_type amt = sec->rawsize > sec->size ? sec->rawsize : sec->size; bfd_size_type size = sec->rawsize ? sec->rawsize : sec->size;