From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26971 invoked by alias); 31 Oct 2007 15:34:29 -0000 Received: (qmail 26960 invoked by uid 22791); 31 Oct 2007 15:34:29 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 31 Oct 2007 15:34:25 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 1480D98348; Wed, 31 Oct 2007 15:34:23 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id B14B9981F1; Wed, 31 Oct 2007 15:34:22 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1InFaH-0002BQ-2x; Wed, 31 Oct 2007 11:34:21 -0400 Date: Wed, 31 Oct 2007 18:06:00 -0000 From: Daniel Jacobowitz To: Ulrich Weigand Cc: gdb-patches@sourceware.org Subject: Re: [rfc] Fix mst_solib_trampoline symbol sections for PLT stubs Message-ID: <20071031153420.GA7724@caradoc.them.org> Mail-Followup-To: Ulrich Weigand , gdb-patches@sourceware.org References: <20071031020856.GA30157@caradoc.them.org> <200710311429.l9VETrn1025150@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200710311429.l9VETrn1025150@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00865.txt.bz2 On Wed, Oct 31, 2007 at 03:29:53PM +0100, Ulrich Weigand wrote: > Daniel Jacobowitz: > > > Yes. But if the address of the function is not taken somewhere in the > > executable, then the address of the undefined symbol will generally be > > left at zero. That should be true most of the time. So while I don't > > see anything wrong with your approach here, I'm surprised it fixed the > > testsuite failures; why do they have non-zero addresses? If we're > > taking their addresses in all cases, we need some new tests. > > I think this is because there are function calls from the main > executable to those functions, and the main executable is not > compiled with -fPIC. I understand those references will also > cause the undefined symbol to carry the address of the main > PLT call stub ... Interesting. On most platforms, that's not necessary: LD only needs to set a canonical address in the executable's symtab if the executable takes the function's address, so this should only happen if those non-PIC calls were indistinguishable from taking the address. That's not implemented for PowerPC. I don't know if it's an ABI requirement or just a missing optimization. Search for "st_value = 0" in elf32-ppc.c versus elf32-i386.c. So, this won't help everywhere or fix the root cause, but it does seem like it would work for PowerPC. -- Daniel Jacobowitz CodeSourcery