From 9a010a5f6328aa7ba353679e9a9e07465917d6a0 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Mon, 23 Sep 2013 01:44:38 -0400 Subject: BZ #15754: Fix test case for ARM. Statically built binaries use __pointer_chk_guard_local, while dynamically built binaries use __pointer_chk_guard. Provide the right definition depending on the test case we are building. --- ChangeLog | 7 +++++++ elf/Makefile | 3 +++ sysdeps/generic/stackguard-macros.h | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5be5ee59d1..5a5a2b5a7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-09-23 Carlos O'Donell + + [BZ #15754] + * sysdeps/generic/stackguard-macros.h: If PTRGUARD_LOCAL use + __pointer_chk_guard_local, otherwise __pointer_chk_guard. + * elf/Makefile: Define CFLAGS-tst-ptrguard1-static.c. + 2013-09-23 Carlos O'Donell [BZ #15754] diff --git a/elf/Makefile b/elf/Makefile index 98834f4cb7..9e21c27e03 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -1019,6 +1019,9 @@ tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child" tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child" tst-ptrguard1-ARGS = --command "$(host-test-program-cmd) --child" +# When built statically, the pointer guard interface uses +# __pointer_chk_guard_local. +CFLAGS-tst-ptrguard1-static.c = -DPTRGUARD_LOCAL tst-ptrguard1-static-ARGS = --command "$(objpfx)tst-ptrguard1-static --child" $(objpfx)tst-leaks1: $(libdl) diff --git a/sysdeps/generic/stackguard-macros.h b/sysdeps/generic/stackguard-macros.h index 4fa3d96f79..b4a6b23ff8 100644 --- a/sysdeps/generic/stackguard-macros.h +++ b/sysdeps/generic/stackguard-macros.h @@ -3,5 +3,10 @@ extern uintptr_t __stack_chk_guard; #define STACK_CHK_GUARD __stack_chk_guard +#ifdef PTRGUARD_LOCAL extern uintptr_t __pointer_chk_guard_local; -#define POINTER_CHK_GUARD __pointer_chk_guard_local +# define POINTER_CHK_GUARD __pointer_chk_guard_local +#else +extern uintptr_t __pointer_chk_guard; +# define POINTER_CHK_GUARD __pointer_chk_guard +#endif -- cgit 1.4.1