aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2012-06-03 17:56:24 +0000
committerCaroline Tice <cmtice@google.com>2012-06-03 17:56:24 +0000
commit6ee6ee4d1d25a05b6082ea6f3a2f5cd855d0bd5c (patch)
tree60a0d569a85107c2748018d69a22973930fd63eb
parent12ab856108a15f0bd04fc0e9ddf21eec3bfd7ebc (diff)
Completely remove code for generating dummy functions.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/google/gcc-4_6-mobile@188154 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--vtable-security/ChangeLog.vtable-security6
-rw-r--r--vtable-security/gcc/config/i386/i386.c175
2 files changed, 6 insertions, 175 deletions
diff --git a/vtable-security/ChangeLog.vtable-security b/vtable-security/ChangeLog.vtable-security
index cbb2153a1eb..79c1d9780b6 100644
--- a/vtable-security/ChangeLog.vtable-security
+++ b/vtable-security/ChangeLog.vtable-security
@@ -1,5 +1,11 @@
2012-06-03 Caroline Tice <cmtice@google.com>
+ * gcc/config/i386/i386.c (ix86_vtable_security_code_end): Remove
+ function.
+ (ix86_code_end): Remove call to ix86_vtable_security_code_end.
+
+2012-06-03 Caroline Tice <cmtice@google.com>
+
* gcc/temp-libgcc.cc (__VerifyVtablePointer): Put hack back in
for the moment, to allow various things to build and run, until
the more permanent fix is done.
diff --git a/vtable-security/gcc/config/i386/i386.c b/vtable-security/gcc/config/i386/i386.c
index afd1b47c793..16d977e8d40 100644
--- a/vtable-security/gcc/config/i386/i386.c
+++ b/vtable-security/gcc/config/i386/i386.c
@@ -8768,176 +8768,6 @@ ix86_setup_frame_addresses (void)
static int pic_labels_used;
-/* Emit weak version of __VerifyVtablePointer, __VLTChangePermission, and
- __VLTRegisterPair. */
-
-static void
-ix86_vtable_security_code_end (void)
-{
- rtx xops[2];
- int regno;
-
- int i;
- char name1[38] = "_Z21__VerifyVtablePointerPPvS_PciS1_i";
- char name2[29] = "_Z21__VLTChangePermissionPci";
- char name3[34] = "_Z17__VLTRegisterPairPPvS_PciS1_i";
- tree decl1, decl2, decl3;
- tree ptr_void = build_pointer_type (void_type_node);
- tree param_types = build_tree_list (NULL, ptr_void);
- tree second_arg = build_tree_list (NULL, ptr_void);
- tree third_arg = build_tree_list (NULL, ptr_void);
- tree fourth_arg = build_tree_list (NULL, build_pointer_type (integer_type_node));
- tree fifth_arg = build_tree_list (NULL, ptr_void);
- tree sixth_arg = build_tree_list (NULL, build_pointer_type (integer_type_node));
-
- param_types = chainon (param_types, second_arg);
-
- /* __VLTChangePermission only has two parameters... */
-
- decl2 = build_decl (BUILTINS_LOCATION, FUNCTION_DECL,
- get_identifier (name2),
- build_function_type (void_type_node,
- build_tree_list (NULL, ptr_void)));
- DECL_RESULT (decl2) = build_decl (BUILTINS_LOCATION, RESULT_DECL,
- NULL_TREE, ptr_void);
- TREE_PUBLIC (decl2) = 1;
- TREE_STATIC (decl2) = 1;
-
- /* The other two functions have six parameters... */
-
- param_types = chainon (param_types, third_arg);
- param_types = chainon (param_types, fourth_arg);
- param_types = chainon (param_types, fifth_arg);
- param_types = chainon (param_types, sixth_arg);
-
- decl1 = build_decl (BUILTINS_LOCATION, FUNCTION_DECL,
- get_identifier (name1),
- build_function_type (ptr_void, param_types));
- DECL_RESULT (decl1) = build_decl (BUILTINS_LOCATION, RESULT_DECL,
- NULL_TREE, ptr_void);
- TREE_PUBLIC (decl1) = 1;
- TREE_STATIC (decl1) = 1;
-
- decl3 = build_decl (BUILTINS_LOCATION, FUNCTION_DECL,
- get_identifier (name3),
- build_function_type (void_type_node, param_types));
- DECL_RESULT (decl3) = build_decl (BUILTINS_LOCATION, RESULT_DECL,
- NULL_TREE, ptr_void);
- TREE_PUBLIC (decl3) = 1;
- TREE_STATIC (decl3) = 1;
-
- for (i = 1; i < 4; ++i)
- {
- tree decl = NULL_TREE;
- char *name = NULL;
- switch (i)
- {
- case 1:
- decl = decl1;
- name = name1;
- break;
- case 2:
- decl = decl2;
- name = name2;
- break;
- case 3:
- decl = decl3;
- name = name3;
- break;
- default:
- break;
- }
-
-#if TARGET_MACHO
- if (TARGET_MACHO)
- {
- switch_to_section (darwin_sections[text_coal_section]);
- fputs ("\t.weak_definition\t", asm_out_file);
- assemble_name (asm_out_file, name);
- fputs ("\n\t.private_extern\t", asm_out_file);
- assemble_name (asm_out_file, name);
- putc ('\n', asm_out_file);
- ASM_OUTPUT_LABEL (asm_out_file, name);
- DECL_WEAK (decl) = 1;
- }
- else
-#endif
- if (USE_HIDDEN_LINKONCE)
- {
- DECL_COMDAT_GROUP (decl) = DECL_ASSEMBLER_NAME (decl);
-
- targetm.asm_out.unique_section (decl, 0);
- switch_to_section (get_named_section (decl, NULL, 0));
-
- fputs ("\t.weak\t", asm_out_file);
- assemble_name (asm_out_file, name);
- fputc ('\n', asm_out_file);
- fputs ("\t.hidden\t", asm_out_file);
- assemble_name (asm_out_file, name);
- putc ('\n', asm_out_file);
- ASM_DECLARE_FUNCTION_NAME (asm_out_file, name, decl);
- }
- else
- {
- switch_to_section (text_section);
- ASM_OUTPUT_LABEL (asm_out_file, name);
- }
-
- DECL_INITIAL (decl) = make_node (BLOCK);
- current_function_decl = decl;
- init_function_start (decl);
- first_function_block_is_cold = false;
- /* Make sure unwind info is emitted for the thunk if needed. */
- final_start_function (emit_barrier (), asm_out_file, 1);
-
- /* Pad stack IP move with 4 instructions (two NOPs count
- as one instruction). */
- if (TARGET_PAD_SHORT_FUNCTION)
- {
- int j = 8;
-
- while (j--)
- fputs ("\tnop\n", asm_out_file);
- }
-
- xops[0] = gen_rtx_REG (Pmode, regno);
- xops[1] = gen_rtx_MEM (Pmode, stack_pointer_rtx);
- if (TARGET_64BIT)
- {
- fputs ("\tpushq\t%rbp\n", asm_out_file);
- fputs ("\tmovq\t%rsp, %rbp\n", asm_out_file);
- fputs ("\tmovq\t%rdi, -8(%rbp)\n", asm_out_file);
- fputs ("\tmovq\t%rsi, -16(%rbp)\n", asm_out_file);
- if (i != 2)
- {
- fputs ("\tmovq\t%rdx, -24(%rbp)\n", asm_out_file);
- fputs ("\tmovl\t%ecx, -28(%rbp)\n", asm_out_file);
- fputs ("\tmovq\t%r8, -40(%rbp)\n", asm_out_file);
- fputs ("\tmovl\t%r9d, -32(%rbp)\n", asm_out_file);
- }
- fputs ("\tmovq\t-16(%rbp), %rax\n", asm_out_file);
- fputs ("\tpopq\t%rbp\n", asm_out_file);
- fputs ("\tret\n", asm_out_file);
- }
- else
- {
- fputs ("\tpushl\t%ebp\n", asm_out_file);
- fputs ("\tmovl\t%esp, %ebp\n", asm_out_file);
- fputs ("\tmovl\t12(%ebp), %eax\n", asm_out_file);
- fputs ("\tpopl\t%ebp\n", asm_out_file);
- fputs ("\tret\n", asm_out_file);
- }
- final_end_function ();
- init_insn_lengths ();
- free_after_compilation (cfun);
- set_cfun (NULL);
- current_function_decl = NULL;
-
- if (flag_split_stack)
- file_end_indicate_split_stack ();
- }
-}
-
/* Fills in the label name that should be used for a pc thunk for
the given register. */
@@ -8962,11 +8792,6 @@ ix86_code_end (void)
rtx xops[2];
int regno;
- /* TODO: Do we need this?
- if (flag_vtable_verify)
- ix86_vtable_security_code_end ();
- */
-
for (regno = AX_REG; regno <= SP_REG; regno++)
{
char name[32];