This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc corrections for better pie support


On Tue, 9 Nov 2004, Richard Sandiford wrote:

> What with all the comments about procedure, I've kind-of lost track of
> this thread.  At the risk of repeating what's already been suggested..
> 
> "Peter S. Mazinger" <ps.m@gmx.net> writes:
> > diff -urN gcc.old/gcc/config/mips/linux.h gcc/gcc/config/mips/linux.h
> > --- gcc.old/gcc/config/mips/linux.h	Wed Sep  8 02:17:15 2004
> > +++ gcc/gcc/config/mips/linux.h	Mon Nov  8 11:04:47 2004
> > @@ -97,9 +97,7 @@
> >  
> >  #undef  SUBTARGET_CPP_SPEC
> >  #define SUBTARGET_CPP_SPEC "\
> > -%{fno-PIC:-U__PIC__ -U__pic__} %{fno-pic:-U__PIC__ -U__pic__} \
> > -%{fPIC|fPIE|fpic|fpie:-D__PIC__ -D__pic__} \
> > -%{pthread:-D_REENTRANT}"
> > +%{fno-PIC|fno-pic:-U__PIC__ -U__pic__} %{pthread:-D_REENTRANT}"
> >  
> >  /* From iris5.h */
> >  /* -G is incompatible with -KPIC which is the default, so only allow objects
> 
> I think you should just remove all the PIC stuff from SUBTARGET_CPP_SPEC
> and guard the builtin_defines in linux.h with flag_shlib instead.

what about guarding the builtin_defines w/ flag_pic as the archs do, but 
set flag_pic to retain the current behaviour. if later on there will be 
cases where the builtin_defines shouldn't be used, it can be done by 
adapting only flag_pic.

> > @@ -123,7 +121,7 @@
> >  #define SUBTARGET_ASM_SPEC "\
> >  %{mabi=64: -64} \
> >  %{!fno-PIC:%{!fno-pic:-KPIC}} \
> > -%{fno-PIC:-non_shared} %{fno-pic:-non_shared}"
> > +%{fno-PIC|fno-pic:-non_shared}"
> 
> If this is causing trouble, you should be able to get rid of all the
> PIC stuff here too.  GAS assumes -non_shared by default and GCC uses
> .abicalls if it wants -KPIC.

so -KPIC is not needed (current behaviour is to use it all the time for 
asm)

Peter

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]