From patchwork Thu Oct 29 19:16:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 56504 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9TJGkL8002558 for ; Thu, 29 Oct 2009 19:16:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756421AbZJ2TQl (ORCPT ); Thu, 29 Oct 2009 15:16:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756555AbZJ2TQk (ORCPT ); Thu, 29 Oct 2009 15:16:40 -0400 Received: from hiauly1.hia.nrc.ca ([132.246.100.193]:4275 "EHLO hiauly1.hia.nrc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756421AbZJ2TQk (ORCPT ); Thu, 29 Oct 2009 15:16:40 -0400 Received: by hiauly1.hia.nrc.ca (Postfix, from userid 1000) id E9D014E38; Thu, 29 Oct 2009 15:16:43 -0400 (EDT) Date: Thu, 29 Oct 2009 15:16:43 -0400 From: John David Anglin To: Helge Deller Cc: linux-parisc@vger.kernel.org, carlos@systemhalted.org, randolph@tausq.org Subject: Re: Out of order unwind entry warning Message-ID: <20091029191642.GA21129@hiauly1.hia.nrc.ca> Reply-To: John David Anglin References: <20091028221827.1B7774E38@hiauly1.hia.nrc.ca> <4AE8C918.8060908@gmx.de> <4AE8CCE3.1030503@gmx.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4AE8CCE3.1030503@gmx.de> Organization: nrc.ca User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Index: config/tc-hppa.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-hppa.c,v retrieving revision 1.145 diff -u -3 -p -r1.145 tc-hppa.c --- config/tc-hppa.c 24 Jul 2009 11:45:00 -0000 1.145 +++ config/tc-hppa.c 29 Oct 2009 18:37:39 -0000 @@ -5961,13 +5961,41 @@ pa_build_unwind_subspace (struct call_in subsegT save_subseg; unsigned int unwind; int reloc; - char *p; + char *name, *p; + symbolS *symbolP; if ((bfd_get_section_flags (stdoutput, now_seg) & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)) != (SEC_ALLOC | SEC_LOAD | SEC_READONLY)) return; + /* Replace the start symbol with a local symbol that will be reduced + to a section offset. This avoids problems with weak functions with + multiple definitions, etc. */ + name = xmalloc (strlen ("L$\001start_") + + strlen (S_GET_NAME (call_info->start_symbol)) + + 1); + strcpy (name, "L$\001start_"); + strcat (name, S_GET_NAME (call_info->start_symbol)); + + /* If we have a .procend preceded by a .exit, then the symbol will have + already been defined. In that case, we don't want another unwind + entry. */ + symbolP = symbol_find (name); + if (symbolP) + { + xfree (name); + return; + } + else + { + symbolP = symbol_new (name, now_seg, + S_GET_VALUE (call_info->start_symbol), frag_now); + gas_assert (symbolP); + S_CLEAR_EXTERNAL (symbolP); + symbol_table_insert (symbolP); + } + reloc = R_PARISC_SEGREL32; save_seg = now_seg; save_subseg = now_subseg; @@ -5993,7 +6021,7 @@ pa_build_unwind_subspace (struct call_in /* Relocation info. for start offset of the function. */ md_number_to_chars (p, 0, 4); fix_new_hppa (frag_now, p - frag_now->fr_literal, 4, - call_info->start_symbol, (offsetT) 0, + symbolP, (offsetT) 0, (expressionS *) NULL, 0, reloc, e_fsel, 32, 0, 0);