From gcc-patches-return-67124-listarch-gcc-patches=gcc dot gnu dot org at gcc dot gnu dot org Fri Aug 30 23:49:35 2002 Return-Path: Delivered-To: listarch-gcc-patches at gcc dot gnu dot org Received: (qmail 21145 invoked by alias); 30 Aug 2002 23:49:34 -0000 Mailing-List: contact gcc-patches-help at gcc dot gnu dot org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner at gcc dot gnu dot org Delivered-To: mailing list gcc-patches at gcc dot gnu dot org Received: (qmail 21136 invoked from network); 30 Aug 2002 23:49:33 -0000 Received: from unknown (HELO mta02bw.bigpond.com) (139.134.6.34) by sources dot redhat dot com with SMTP; 30 Aug 2002 23:49:33 -0000 Received: from bubble.local ([144.135.24.81]) by mta02bw dot bigpond dot com (Netscape Messaging Server 4 dot 15 mta02bw May 23 2002 23:53:28) with SMTP id H1OKUJ00 dot 19H for ; Sat, 31 Aug 2002 09:49:31 +1000 Received: from CPE-144-136-184-138.sa.bigpond.net.au ([144.136.184.138]) by bwmam05.mailsvc.email.bigpond.com(MailRouter V3.0n 44/3685932); 31 Aug 2002 09:49:31 Received: (qmail 18032 invoked by uid 179); 30 Aug 2002 23:49:30 -0000 Date: Sat, 31 Aug 2002 09:19:30 +0930 From: Alan Modra To: David Edelsohn Cc: Richard Henderson , Franz Sirl , Geoff Keating , gcc-patches at gcc dot gnu dot org Subject: Re: [RFC] PowerPC select_section / unique_section Message-ID: <20020831091930.C18764@bubble.sa.bigpond.net.au> Mail-Followup-To: David Edelsohn , Richard Henderson , Franz Sirl , Geoff Keating , gcc-patches at gcc dot gnu dot org References: <200208301527.LAA26424@makai.watson.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200208301527 dot LAA26424 at makai dot watson dot ibm dot com>; from dje at watson dot ibm dot com on Fri, Aug 30, 2002 at 11:27:25AM -0400 On Fri, Aug 30, 2002 at 11:27:25AM -0400, David Edelsohn wrote: > >>>>> Alan Modra writes: > > Alan> Uh, oh. If I understand binds_local_p and mark_constant_function > Alan> correctly, setting flag_pic is actually a bug-fix when compiling > Alan> powerpc64-linux shared libs. We have the standard ELF binding of > Alan> global syms. That is, global functions may be overridden by functions > Alan> in another shared library or by the main application. > > Alan> So powerpc64-linux-gcc should allow -fpic/PIC to twiddle flag_pic for > Alan> binds_local_p, and users should set -fPIC when compiling shared libs > Alan> as is common on other ELF targets. We could use another flag, because > Alan> like that annoying rs6000.c warning says "all code is position > Alan> independent" on ppc64, but that would make powerpc64-linux just that > Alan> more odd. Lots of packages set -fPIC to mean "compile me code for a > Alan> shared library". > > This is what the patch that I applied to both gcc-3.2 and the > trunk already does, without utilizing the generic infrastructure. The > PowerPC port currently does not use the targetm.binds_local_p. We can > discuss evolving to the generic infrastructure for GCC 3.4. The PowerPC back-end code doesn't use binds_local_p, but mark_constant_function does. I think I'm correct in claiming that powerpc64-linux-gcc lacks a way to say "I want this code compiled for a shared library; Don't try to analyze global functions for pure/const as the function in this file may not be the one called at runtime." -- Alan Modra IBM OzLabs - Linux Technology Centre