diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-03 09:06:55 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-03 09:06:55 +0000 |
commit | c3ce66b01e47e99e429d17fb6df311852d2d5fc5 (patch) | |
tree | 9086bda0149c0c0178acfce160ac6deb805491fd /gcc/config/alpha/elf.h | |
parent | 9fe0e1b8f7411a3eaa3e4f96db117498975d36d2 (diff) | |
download | gcc-c3ce66b01e47e99e429d17fb6df311852d2d5fc5.tar.gz |
* configure.in (HAVE_LD_PIE): Check for ld -pie.
* config.in: Rebuilt.
* configure: Rebuilt.
* toplev.c (flag_pie, flag_shlib): New variables.
(f_options): Add -fpie and -fPIE.
(parse_options_and_default_flags): Set flag_pic if -fpie/-fPIE.
Set flag_shlib if flag_pic and not -fpie/-fPIE.
* flags.h (flag_pic, flag_shlib): Add.
* varasm.c (default_binds_local_p): Use flag_shlib instead of
flag_pic.
* gcc.c (LINK_PIE_SPEC): Define.
(LINK_COMMAND_SPEC): Use LINK_PIE_SPEC.
(option_map): Add --pie -> -pie mapping.
* config/sol2.h (ASM_SPEC): Handle -fpie the same way as -fpic
and -fPIE the same way as -fPIC.
* config/openbsd.h (ASM_SPEC): Likewise.
* config/frv/frv.h (ASM_SPEC): Likewise.
* config/arm/linux-gas.h (SUBTARGET_CPP_SPEC): Likewise.
* config/arm/semi.h (ASM_SPEC): Likewise.
* config/arm/netbsd-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise.
* config/freebsd-spec.h (FBSD_CPP_SPEC): Likewise.
* config/i386/beos-elf.h (CC1_SPEC): Likewise.
* config/i386/freebsd-aout.h (ASM_SPEC): Likewise.
* config/m68k/linux.h (CPP_SPEC): Likewise.
* config/m68k/netbsd.h (ASM_SPEC): Likewise.
* config/m68k/openbsd.h (ASM_SPEC): Likewise.
* config/m68k/netbsd-elf.h (ASM_SPEC): Likewise.
* config/mips/linux.h (SUBTARGET_CPP_SPEC): Likewise.
* config/mips/openbsd.h (SUBTARGET_ASM_SPEC): Likewise.
* config/pa/pa-linux.h (CPP_SPEC): Likewise.
* config/netbsd-aout.h (ASM_SPEC): Likewise.
* config/rs6000/sysv4.h (ASM_SPEC, CPP_SYSV_SPEC): Likewise.
* config/rs6000/vxworks.h (CPP_SPEC): Likewise.
* config/sparc/linux.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise.
* config/sparc/linux64.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise.
* config/sparc/sparc.h (ASM_SPEC): Likewise.
* config/sparc/sp64-elf.h (ASM_SPEC): Likewise.
* config/sparc/sysv4.h (ASM_SPEC): Likewise.
* config/sparc/netbsd-elf.h (ASM_SPEC): Likewise.
* config/sparc/openbsd64.h (ASM_SPEC): Likewise.
* config/cris/linux.h (CRIS_ASM_SUBTARGET_SPEC): Likewise.
* config/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Handle -pie.
Simplify.
* config/alpha/elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* config/i386/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* config/ia64/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* config/rs6000/sysv4.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* config/rs6000/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* config/sparc/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* config/sparc/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise.
* doc/invoke.texi: Document -pie, -fpie and -fPIE options.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67359 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/alpha/elf.h')
-rw-r--r-- | gcc/config/alpha/elf.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h index 3ca8d6c7478..abdb92af501 100644 --- a/gcc/config/alpha/elf.h +++ b/gcc/config/alpha/elf.h @@ -413,11 +413,15 @@ void FN () \ before entering `main'. */ #undef STARTFILE_SPEC +#ifdef HAVE_LD_PIE #define STARTFILE_SPEC \ - "%{!shared: \ - %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\ - crti.o%s %{static:crtbeginT.o%s}\ - %{!static:%{shared:crtbeginS.o%s}%{!shared:crtbegin.o%s}}" + "%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\ + crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" +#else +#define STARTFILE_SPEC \ + "%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}}\ + crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" +#endif /* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the magical crtend.o file which provides part of the support for @@ -427,7 +431,7 @@ void FN () \ #undef ENDFILE_SPEC #define ENDFILE_SPEC \ "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ - %{shared:crtendS.o%s}%{!shared:crtend.o%s} crtn.o%s" + %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" /* We support #pragma. */ #define HANDLE_SYSV_PRAGMA 1 |