Commit fbdb92eb by Maxim Ostapenko Committed by Maxim Ostapenko

asan.h (ASAN_STACK_MAGIC_PARTIAL): Remove.

gcc/

	* asan.h (ASAN_STACK_MAGIC_PARTIAL): Remove.
	* asan.c (ASAN_STACK_MAGIC_PARTIAL): Replace with
	ASAN_STACK_MAGIC_MIDDLE.
	(asan_global_struct): Increase the size of fields.
	(asan_add_global): Add new field constructor.
	* sanitizer.def (__asan_version_mismatch_check_v6): Replace with
	__asan_version_mismatch_check_v8.

gcc/testsuite/

	* c-c++-common/asan/null-deref-1.c: Adjust testcase.

From-SVN: r241983
parent 8f16b6ca
2016-11-08 David Edelsohn <dje.gcc@gmail.com>
2016-11-09 Maxim Ostapenko <m.ostapenko@samsung.com>
* asan.h (ASAN_STACK_MAGIC_PARTIAL): Remove.
* asan.c (ASAN_STACK_MAGIC_PARTIAL): Replace with
ASAN_STACK_MAGIC_MIDDLE.
(asan_global_struct): Increase the size of fields.
(asan_add_global): Add new field constructor.
* sanitizer.def (__asan_version_mismatch_check_v6): Replace with
__asan_version_mismatch_check_v8.
2016-11-08 David Edelsohn <dje.gcc@gmail.com>
* dwarf2asm.c (USE_LINKONCE_INDIRECT): Test XCOFF_DEBUGGING_INFO
at runtime.
......@@ -1242,7 +1242,7 @@ asan_emit_stack_protection (rtx base, rtx pbase, unsigned int alignb,
shadow_bytes[i] = offset - aoff;
}
else
shadow_bytes[i] = ASAN_STACK_MAGIC_PARTIAL;
shadow_bytes[i] = ASAN_STACK_MAGIC_MIDDLE;
emit_move_insn (shadow_mem, asan_shadow_cst (shadow_bytes));
offset = aoff;
}
......@@ -2260,19 +2260,20 @@ asan_dynamic_init_call (bool after_p)
const void *__module_name;
uptr __has_dynamic_init;
__asan_global_source_location *__location;
char *__odr_indicator;
} type. */
static tree
asan_global_struct (void)
{
static const char *field_names[7]
static const char *field_names[8]
= { "__beg", "__size", "__size_with_redzone",
"__name", "__module_name", "__has_dynamic_init", "__location"};
tree fields[7], ret;
"__name", "__module_name", "__has_dynamic_init", "__location", "__odr_indicator"};
tree fields[8], ret;
int i;
ret = make_node (RECORD_TYPE);
for (i = 0; i < 7; i++)
for (i = 0; i < 8; i++)
{
fields[i]
= build_decl (UNKNOWN_LOCATION, FIELD_DECL,
......@@ -2381,6 +2382,8 @@ asan_add_global (tree decl, tree type, vec<constructor_elt, va_gc> *v)
else
locptr = build_int_cst (uptr, 0);
CONSTRUCTOR_APPEND_ELT (vinner, NULL_TREE, locptr);
/* TODO: support ODR indicators. */
CONSTRUCTOR_APPEND_ELT (vinner, NULL_TREE, build_int_cst (uptr, 0));
init = build_constructor (type, vinner);
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, init);
}
......
......@@ -59,7 +59,6 @@ extern hash_set <tree> *asan_used_labels;
#define ASAN_STACK_MAGIC_LEFT 0xf1
#define ASAN_STACK_MAGIC_MIDDLE 0xf2
#define ASAN_STACK_MAGIC_RIGHT 0xf3
#define ASAN_STACK_MAGIC_PARTIAL 0xf4
#define ASAN_STACK_MAGIC_USE_AFTER_RET 0xf5
#define ASAN_STACK_MAGIC_USE_AFTER_SCOPE 0xf8
......
......@@ -34,7 +34,7 @@ DEF_BUILTIN_STUB(BEGIN_SANITIZER_BUILTINS, (const char *)0)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_INIT, "__asan_init",
BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_VERSION_MISMATCH_CHECK,
"__asan_version_mismatch_check_v6",
"__asan_version_mismatch_check_v8",
BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
/* Do not reorder the BUILT_IN_ASAN_{REPORT,CHECK}* builtins, e.g. cfgcleanup.c
relies on this order. */
......
2016-11-09 Maxim Ostapenko <m.ostapenko@samsung.com>
* c-c++-common/asan/null-deref-1.c: Adjust testcase.
2016-11-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/68440
......
......@@ -17,6 +17,6 @@ int main()
}
/* { dg-output "ERROR: AddressSanitizer:? SEGV on unknown address\[^\n\r]*" } */
/* { dg-output "0x\[0-9a-f\]+ \[^\n\r]*pc 0x\[0-9a-f\]+\[^\n\r]*(\n|\r\n|\r)" } */
/* { dg-output "\[^\n\r]* #0 0x\[0-9a-f\]+ +(in \[^\n\r]*NullDeref\[^\n\r]* (\[^\n\r]*null-deref-1.c:10|\[^\n\r]*:0)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
/* { dg-output "0x\[0-9a-f\]+ \[^\n\r]*pc 0x\[0-9a-f\]+.*(\n|\r\n|\r)" } */
/* { dg-output " #0 0x\[0-9a-f\]+ +(in \[^\n\r]*NullDeref\[^\n\r]* (\[^\n\r]*null-deref-1.c:10|\[^\n\r]*:0)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
/* { dg-output " #1 0x\[0-9a-f\]+ +(in _*main (\[^\n\r]*null-deref-1.c:15|\[^\n\r]*:0)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
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