summaryrefslogtreecommitdiff
path: root/gcc/config/sh/vxworks.h
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-04 13:01:33 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-04 13:01:33 +0000
commitfc4b79ac62df6f78bffb246168a35c23c7383111 (patch)
tree6a2113dc552ef9ac00d4f41f482003467af4fc1c /gcc/config/sh/vxworks.h
parentbce44532c527d530bf67ef88c98ea03c56507536 (diff)
downloadgcc-fc4b79ac62df6f78bffb246168a35c23c7383111.tar.gz
gcc/
* config/sh/vxworks.h (SUBTARGET_OVERRIDE_OPTIONS): Reject -mrelax unless compiling RTP PIC. gcc/testsuite/ * gcc.dg/sh-relax.c: Skip for VxWorks if non-PIC. * gcc.dg/sh-relax-vxworks.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126317 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sh/vxworks.h')
-rw-r--r--gcc/config/sh/vxworks.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/config/sh/vxworks.h b/gcc/config/sh/vxworks.h
index 63f2bbf6969..82b32f143c6 100644
--- a/gcc/config/sh/vxworks.h
+++ b/gcc/config/sh/vxworks.h
@@ -30,7 +30,20 @@ Boston, MA 02110-1301, USA. */
while (0)
#undef SUBTARGET_OVERRIDE_OPTIONS
-#define SUBTARGET_OVERRIDE_OPTIONS VXWORKS_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS \
+ do \
+ { \
+ VXWORKS_OVERRIDE_OPTIONS; \
+ /* The kernel loader cannot handle the relaxation \
+ relocations, so it cannot load kernel modules \
+ (which are ET_REL) or RTP executables (which are \
+ linked with --emit-relocs). No relaxation relocations \
+ appear in shared libraries, so relaxation is OK \
+ for RTP PIC. */ \
+ if (TARGET_RELAX && !(TARGET_VXWORKS_RTP && flag_pic)) \
+ error ("-mrelax is only supported for RTP PIC"); \
+ } \
+ while (0)
#undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC VXWORKS_ADDITIONAL_CPP_SPEC