From aeaf1aa16433216476708eba3f48b49025427d52 Mon Sep 17 00:00:00 2001 From: nickc Date: Fri, 8 Jul 2005 10:00:15 +0000 Subject: [PATCH] * config/m32r/linux.h (STARTFILE_SPEC): Support PIE. (ENDFILE_SPEC): Likewise. * config/m32r/m32r.h (ASM_SPEC): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101757 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/m32r/linux.h | 8 +++++++- gcc/config/m32r/m32r.h | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f0494163eed..d8ac67a1930 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-07-08 Kazuhiro Inaoka + + * config/m32r/linux.h (STARTFILE_SPEC): Support PIE. + (ENDFILE_SPEC): Likewise. + * config/m32r/m32r.h (ASM_SPEC): Likewise. + 2005-07-08 David Billinghurst * final.c: Include sdbout.h when required. diff --git a/gcc/config/m32r/linux.h b/gcc/config/m32r/linux.h index 6da0e7fbdae..c338ed6d592 100644 --- a/gcc/config/m32r/linux.h +++ b/gcc/config/m32r/linux.h @@ -85,14 +85,20 @@ %{profile:-lc_p} %{!profile: -lc}}" #undef STARTFILE_SPEC +#if defined HAVE_LD_PIE +#define STARTFILE_SPEC \ + "%{!shared: %{pg|p|profile: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:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" +#endif #undef ENDFILE_SPEC #define ENDFILE_SPEC \ - "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" + "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" #undef SUBTARGET_CPP_SPEC #define SUBTARGET_CPP_SPEC "\ diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h index ca6e86f53a7..4b85a426406 100644 --- a/gcc/config/m32r/m32r.h +++ b/gcc/config/m32r/m32r.h @@ -183,7 +183,7 @@ /* Options to pass on to the assembler. */ #undef ASM_SPEC -#define ASM_SPEC "%{v} %(asm_cpu) %(relax) %{fpic:-K PIC} %{fPIC:-K PIC}" +#define ASM_SPEC "%{v} %(asm_cpu) %(relax) %{fpic|fpie:-K PIC} %{fPIC|fPIE:-K PIC}" #define LINK_SPEC "%{v} %(link_cpu) %(relax)" -- 2.11.4.GIT