summaryrefslogtreecommitdiff
path: root/gcc/config/alpha
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-02 22:18:11 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-02 22:18:11 +0000
commit9fbba7ae91cf8d69602fae359a500b3982d6be2d (patch)
treec1d159624825d693c1673e551e37788d6a49f86f /gcc/config/alpha
parente9f1fe8605d5c23f537bf6fd654a71a662037fd4 (diff)
downloadgcc-9fbba7ae91cf8d69602fae359a500b3982d6be2d.tar.gz
* config/alpha/vms.h (SUBTARGET_OVERRIDE_OPTIONS): For pic code,
unset flag_jump_tables. * stmt.c (expand_case): Remove special flag_pic case conditional on ASM_OUTPUT_ADDR_DIFF_ELT not being defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187065 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/alpha')
-rw-r--r--gcc/config/alpha/vms.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
index 8caec548ef8..73e45a5f85c 100644
--- a/gcc/config/alpha/vms.h
+++ b/gcc/config/alpha/vms.h
@@ -257,7 +257,15 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
#undef ASM_FINAL_SPEC
/* The VMS convention is to always provide minimal debug info
- for a traceback unless specifically overridden. */
+ for a traceback unless specifically overridden.
+
+ Because ASM_OUTPUT_ADDR_DIFF_ELT is not defined for alpha-vms,
+ jump tables cannot be output for PIC code, because you can't put
+ an absolute address in a readonly section. Putting the table in
+ a writable section is a security hole. Therefore, we unset the
+ flag_jump_tables flag, forcing switch statements to be expanded
+ using decision trees. There are probably other ways to address
+ this issue, but using a decision tree is clearly safe. */
#undef SUBTARGET_OVERRIDE_OPTIONS
#define SUBTARGET_OVERRIDE_OPTIONS \
@@ -268,6 +276,8 @@ do { \
write_symbols = VMS_DEBUG; \
debug_info_level = DINFO_LEVEL_TERSE; \
} \
+ if (flag_pic) \
+ flag_jump_tables = 0; \
} while (0)
#undef LINK_SPEC