Commit f0025c1f by Richard Sandiford Committed by Richard Sandiford

vxworks.h (SUBTARGET_OVERRIDE_OPTIONS): Reject -mrelax unless compiling RTP PIC.

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.

From-SVN: r126317
parent 7d8c27ff
2007-07-04 Richard Sandiford <richard@codesourcery.com>
* config/sh/vxworks.h (SUBTARGET_OVERRIDE_OPTIONS): Reject -mrelax
unless compiling RTP PIC.
2007-07-04 Richard Guenther <rguenther@suse.de> 2007-07-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/32482 PR tree-optimization/32482
......
...@@ -30,7 +30,20 @@ Boston, MA 02110-1301, USA. */ ...@@ -30,7 +30,20 @@ Boston, MA 02110-1301, USA. */
while (0) while (0)
#undef SUBTARGET_OVERRIDE_OPTIONS #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 #undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC VXWORKS_ADDITIONAL_CPP_SPEC #define SUBTARGET_CPP_SPEC VXWORKS_ADDITIONAL_CPP_SPEC
......
2007-07-04 Richard Sandiford <richard@codesourcery.com>
* gcc.dg/sh-relax.c: Skip for VxWorks if non-PIC.
* gcc.dg/sh-relax-vxworks.c: New test.
2007-07-04 Richard Guenther <rguenther@suse.de> 2007-07-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/32500 PR tree-optimization/32500
/* Check that -mrelax produces the correct error message. */
/* { dg-do compile { target { sh-*-vxworks* && nonpic } } } */
/* { dg-error "-mrelax is only supported for RTP PIC" "" { target *-*-* } 0 } */
/* { dg-options "-O1 -mrelax" } */
int x;
/* Check that -mrelax works. */ /* Check that -mrelax works. */
/* { dg-do run { target sh-*-* sh?-*-* } } */ /* { dg-do run { target { { sh-*-* sh?-*-* } && { ! { sh*-*-vxworks* && nonpic } } } } } */
/* { dg-options "-O1 -mrelax" } */ /* { dg-options "-O1 -mrelax" } */
extern void abort (void); extern void abort (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment