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


Peter S. Mazinger wrote:
[snip]
> > It is possible, and IIRC it was once done for some embedded systems.
> > In general, it is not used (yet?), but there are ELF header flags to
> > support interlinking of non-PIC executables with PIC DSOs, and doing
> > so would improve performance of the executable a bit. OTOH the current
> > ld implementation doesn't handle this correctly.
> 
> We are discussing this piece of code (this would be my proposed patch, 
> because the fPIC|fPIE... part is redundant, the question is only
> should the fno-PIC... -U__PIC__-... line stay in, or should be left out.
> similarly the others checking for fno-PIC -KPIC and non_shared
> 
> Peter
> 
> 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,6 @@
>  
>  #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}"
> +#define SUBTARGET_CPP_SPEC "%{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
> @@ -123,7 +120,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}"

This patch is IMHO ok. (Note that I can't approve any patches.)


Thiemo


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