mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
Compile the dynamic linker without stack protection [BZ #7065]
Also compile corresponding routines in the static libc.a with the same flag.
This commit is contained in:
parent
10c85e76c0
commit
995635f95b
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
||||
2016-12-26 Nick Alcock <nick.alcock@oracle.com>
|
||||
|
||||
[BZ #7065]
|
||||
Compile the dynamic linker without stack protection.
|
||||
* elf/Makefile (elide-stack-protector): New.
|
||||
(CFLAGS-.os): Use it, eliding $(all-rtld-routines).
|
||||
(CFLAGS-.o, CFLAGS-.op): Likewise, but for $(elide-routines.os).
|
||||
* elf/rtld-Rules (rtld-CFLAGS): Add $(no-stack-protector).
|
||||
* sysdeps/i386/Makefile (rtld-CFLAGS): Use +=, not =.
|
||||
|
||||
2016-12-26 Nick Alcock <nick.alcock@oracle.com>
|
||||
|
||||
[BZ #7065]
|
||||
|
12
elf/Makefile
12
elf/Makefile
@ -51,6 +51,18 @@ CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables
|
||||
CFLAGS-dl-lookup.c = -fexceptions -fasynchronous-unwind-tables
|
||||
CFLAGS-dl-iterate-phdr.c = $(uses-callbacks)
|
||||
|
||||
# Compile rtld itself without stack protection.
|
||||
# Also compile all routines in the static library that are elided from
|
||||
# the shared libc because they are in libc.a in the same way.
|
||||
|
||||
define elide-stack-protector
|
||||
$(if $(filter $(@F),$(patsubst %,%$(1),$(2))), $(no-stack-protector))
|
||||
endef
|
||||
|
||||
CFLAGS-.o += $(call elide-stack-protector,.o,$(elide-routines.os))
|
||||
CFLAGS-.op += $(call elide-stack-protector,.op,$(elide-routines.os))
|
||||
CFLAGS-.os += $(call elide-stack-protector,.os,$(all-rtld-routines))
|
||||
|
||||
ifeq ($(unwind-find-fde),yes)
|
||||
routines += unwind-dw2-fde-glibc
|
||||
shared-only-routines += unwind-dw2-fde-glibc
|
||||
|
@ -144,4 +144,6 @@ cpp-srcs-left := $(rtld-modules:%.os=%)
|
||||
lib := rtld
|
||||
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
|
||||
|
||||
rtld-CFLAGS += $(no-stack-protector)
|
||||
|
||||
endif
|
||||
|
@ -88,7 +88,7 @@ endif
|
||||
# the first 3 mm/xmm/ymm/zmm registers are used to pass vector parameters
|
||||
# which must be preserved.
|
||||
# With SSE disabled, ensure -fpmath is not set to use sse either.
|
||||
rtld-CFLAGS = -mno-sse -mno-mmx -mfpmath=387
|
||||
rtld-CFLAGS += -mno-sse -mno-mmx -mfpmath=387
|
||||
ifeq ($(subdir),elf)
|
||||
CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
|
||||
$(rtld-CFLAGS))
|
||||
|
Loading…
Reference in New Issue
Block a user