aboutsummaryrefslogtreecommitdiffstats
path: root/main/s390-tools/0100-zipl-no-pie.patch
blob: 50e983e0a8373d80094a6426ae8b27f2095ebfa7 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff --git a/zipl/boot/Makefile b/zipl/boot/Makefile
index 6474aad..83771f1 100644
--- a/zipl/boot/Makefile
+++ b/zipl/boot/Makefile
@@ -1,7 +1,7 @@
 # Common definitions
 include ../../common.mak
 
-CFLAGS_BOOT = -Os -g -I../include -D__ASSEMBLY__ \
+CFLAGS_BOOT = -fno-pie -Os -g -I../include -D__ASSEMBLY__ \
 	  -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
 	  -fno-builtin -ffreestanding -fno-asynchronous-unwind-tables \
 	  -fno-delete-null-pointer-checks -fno-strict-aliasing \
@@ -54,11 +54,11 @@ stage3.exec: head.o stage3.o kdump3.o libc.o sclp.o sclp_stage3.o \
 			}' \
 	); \
 	case $$STAGE in \
-		0) SFLAGS="-nostdlib -Wl,-Ttext,0";; \
-		1) SFLAGS="-nostdlib -Wl,-Ttext,0x18";; \
-		1b) SFLAGS="-nostdlib -Wl,-Ttext,0xE000";; \
-		2) SFLAGS="-nostdlib -Wl,-T,stage2.lds";; \
-		3) SFLAGS="-nostdlib -Wl,-T,stage3.lds";; \
+		0) SFLAGS="-no-pie -nostdlib -Wl,-Ttext,0";; \
+		1) SFLAGS="-no-pie -nostdlib -Wl,-Ttext,0x18";; \
+		1b) SFLAGS="-no-pie -nostdlib -Wl,-Ttext,0xE000";; \
+		2) SFLAGS="-no-pie -nostdlib -Wl,-T,stage2.lds";; \
+		3) SFLAGS="-no-pie -nostdlib -Wl,-T,stage3.lds";; \
 	esac; \
 	$(LINK) $$SFLAGS -m64 $^ -o $@
 
@@ -77,7 +77,7 @@ stage3.exec: head.o stage3.o kdump3.o libc.o sclp.o sclp_stage3.o \
 		$< $@
 
 data.o: $(FILES)
-	$(LD) -r -b binary -o data.o $(FILES)
+	$(LD) -no-pie -r -b binary -o data.o $(FILES)
 
 data.h: data.o
 	rm -f data.h
diff --git a/zipl/src/Makefile b/zipl/src/Makefile
index 0ea0077..c526a46 100644
--- a/zipl/src/Makefile
+++ b/zipl/src/Makefile
@@ -7,8 +7,8 @@ ALL_CPPFLAGS += -I../include -I../boot -I../../include \
 	    -DZFCPDUMP_FS_RD=$(ZFCPDUMP_FS_RD) \
 	    -DZFCPDUMP_PART_IMAGE=$(ZFCPDUMP_PART_IMAGE) \
 	    -DZFCPDUMP_PART_RD=$(ZFCPDUMP_PART_RD) \
-	    -D_FILE_OFFSET_BITS=64
-ALL_LDFLAGS += -Wl,-z,noexecstack
+	    -D_FILE_OFFSET_BITS=64 -fno-pie
+ALL_LDFLAGS += -Wl,-z,noexecstack -no-pie
 
 libs =	$(rootdir)/libutil/libutil.a \
 	$(rootdir)/libu2s/libu2s.a