summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-11-19 11:23:05 -0800
committerH.J. Lu <hjl.tools@gmail.com>2017-11-19 11:23:05 -0800
commit277904c8434d46999674d9b4eb2871cd0039d8f2 (patch)
tree634c925a4d7e42aea276990bbdb804a5bd076f49
parent0f74bbf513354d4d0b635b77b96699b33741068b (diff)
downloadglibc-hjl/pr22459/master.tar.gz
libc.so: Replace nscd_hash.os with libc-nscd_hash.os [BZ #22459]hjl/pr22459/master
nscd_hash.os is needed both libc.so as well as nscd. Since nscd_hash.os is compiled as the part of nscd, when -fstack-protector-all is used, nscd_hash.os calls __stack_chk_fail via PLT, which leads to FAIL: elf/check-localplt Extra PLT reference: libc.so: __stack_chk_fail This patch replaces nscd_hash.os with libc-nscd_hash.os in libc_pic.a to avoid calling __stack_chk_fail via PLT inside of libc.so. [BZ #22459] * nscd/Makefile (aux): Replace nscd_hash with libc-nscd_hash. * nscd/libc-nscd_hash.c: New file.
-rw-r--r--nscd/Makefile2
-rw-r--r--nscd/libc-nscd_hash.c19
2 files changed, 20 insertions, 1 deletions
diff --git a/nscd/Makefile b/nscd/Makefile
index 095f3e53d4..7ae6518e2d 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -25,7 +25,7 @@ include ../Makeconfig
ifneq ($(use-nscd),no)
routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \
nscd_initgroups nscd_getserv_r nscd_netgroup
-aux := nscd_helper nscd_hash
+aux := nscd_helper libc-nscd_hash
endif
# To find xmalloc.c
diff --git a/nscd/libc-nscd_hash.c b/nscd/libc-nscd_hash.c
new file mode 100644
index 0000000000..743f1adfb3
--- /dev/null
+++ b/nscd/libc-nscd_hash.c
@@ -0,0 +1,19 @@
+/* Used in libc.so to avoid calling __stack_chk_fail via PLT.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <nscd_hash.c>