summaryrefslogtreecommitdiff
path: root/sys-libs/glibc/files/2.12/glibc-2.12-hardened-pie.patch
blob: 3315171d953fb51939e4759fff4a627f0dff2690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
2010-08-11  Magnus Granberg  <zorry@ume.nu>

	#332331
	* Makeconfig (+link): Set to +link-pie.
	(+link-static): Change $(static-start-installed-name) to
	S$(static-start-installed-name).
	(+prector): Set to +prectorS.
	(+postctor): Set to +postctorS.

--- libc/Makeconfig
+++ libc/Makeconfig
@@ -447,11 +447,12 @@
 	     $(common-objpfx)libc% $(+postinit),$^) \
 	     $(link-extra-libs) $(link-libc) $(+postctorS) $(+postinit)
 endif
++link = $(+link-pie)
 # Command for statically linking programs with the C library.
 ifndef +link-static
 +link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \
 	      $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F))  \
-	      $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
+	      $(addprefix $(csu-objpfx),S$(static-start-installed-name)) \
 	      $(+preinit) $(+prector) \
 	      $(filter-out $(addprefix $(csu-objpfx),start.o \
 						     $(start-installed-name))\
@@ -549,11 +550,10 @@
 ifeq ($(elf),yes)
 +preinit = $(addprefix $(csu-objpfx),crti.o)
 +postinit = $(addprefix $(csu-objpfx),crtn.o)
-+prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbegin.o`
-+postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
-# Variants of the two previous definitions for linking PIE programs.
 +prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginS.o`
 +postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtendS.o`
++prector = $(+prectorS)
++postctor = $(+postctorS)
 +interp = $(addprefix $(elf-objpfx),interp.os)
 endif
 csu-objpfx = $(common-objpfx)csu/