This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 10/18] Link libc.so with libc_nonshared.a to pull in __stack_chk_fail_local.
- From: Nix <nix at esperi dot org dot uk>
- To: libc-alpha at sourceware dot org
- Date: Tue, 8 Mar 2016 13:50:56 +0000
- Subject: [PATCH 10/18] Link libc.so with libc_nonshared.a to pull in __stack_chk_fail_local.
- Authentication-results: sourceware.org; auth=none
- References: <1457445064-7107-1-git-send-email-nix at esperi dot org dot uk>
From: Nick Alcock <nick.alcock@oracle.com>
With this in place, we pull in __stack_chk_fail_local, which will
be required by the next commit, and referenced by every stack-
protected function in libc.
Also prevent that function from being stack-protected itself: this
makes no sense.
v5: Better explanation. Add no-stack-protection of
__stack_chk_fail_local etc.
* Makerules $(common-objpfx)libc.so,
$(common-objpfx)linkobj/libc.so): Add
$(common-objpfx)libc_nonshared.a.
* debug/Makefile (CFLAGS-stack_chk_fail.c): Use $(no-stack-protector).
(CFLAGS-stack_chk_fail_local.c): Likewise.
---
Makerules | 2 ++
debug/Makefile | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/Makerules b/Makerules
index 53eabfa..d369d78 100644
--- a/Makerules
+++ b/Makerules
@@ -674,6 +674,7 @@ $(common-objpfx)linkobj/libc.so: link-libc-deps = # empty
# libraries.
$(common-objpfx)libc.so: $(elf-objpfx)soinit.os \
$(common-objpfx)libc_pic.os$(libc_pic_clean) \
+ $(common-objpfx)libc_nonshared.a \
$(elf-objpfx)sofini.os \
$(elf-objpfx)interp.os \
$(elf-objpfx)ld.so \
@@ -683,6 +684,7 @@ $(common-objpfx)libc.so: $(elf-objpfx)soinit.os \
$(common-objpfx)linkobj/libc.so: $(elf-objpfx)soinit.os \
$(common-objpfx)linkobj/libc_pic.a \
+ $(common-objpfx)libc_nonshared.a \
$(elf-objpfx)sofini.os \
$(elf-objpfx)interp.os \
$(elf-objpfx)ld.so \
diff --git a/debug/Makefile b/debug/Makefile
index 6b5f31e..2f506af 100644
--- a/debug/Makefile
+++ b/debug/Makefile
@@ -52,6 +52,12 @@ routines = backtrace backtracesyms backtracesymsfd noophooks \
$(static-only-routines)
static-only-routines := warning-nop stack_chk_fail_local
+# Building the stack-protector failure routines with stack protection
+# makes no sense.
+
+CFLAGS-stack_chk_fail.c = $(no-stack-protector)
+CFLAGS-stack_chk_fail_local.c = $(no-stack-protector)
+
CFLAGS-backtrace.c = -fno-omit-frame-pointer
CFLAGS-sprintf_chk.c = $(libio-mtsafe)
CFLAGS-snprintf_chk.c = $(libio-mtsafe)
--
2.7.0.198.g6dd47b6