[CRIU] [PATCH 01/13] make: Squash parasite.lds.S and restorer.lds.S into pie.lds.S

Cyrill Gorcunov gorcunov at openvz.org
Tue Apr 17 17:55:36 EDT 2012


They are identical, no need to carry two copies.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 Makefile       |   12 ++++++------
 parasite.lds.S |   18 ------------------
 pie.lds.S      |   18 ++++++++++++++++++
 restorer.lds.S |   18 ------------------
 4 files changed, 24 insertions(+), 42 deletions(-)
 delete mode 100644 parasite.lds.S
 create mode 100644 pie.lds.S
 delete mode 100644 restorer.lds.S

diff --git a/Makefile b/Makefile
index 019623e..72505a0 100644
--- a/Makefile
+++ b/Makefile
@@ -52,9 +52,10 @@ OBJS		+= ipc_ns.o
 OBJS-BLOB	+= parasite.o
 SRCS-BLOB	+= $(patsubst %.o,%.c,$(OBJS-BLOB))
 
+PIE-LDS		:= pie.lds.S
+
 HEAD-BLOB-GEN	:= $(patsubst %.o,%-blob.h,$(OBJS-BLOB))
 HEAD-BIN	:= $(patsubst %.o,%.bin,$(OBJS-BLOB))
-HEAD-LDS	:= $(patsubst %.o,%.lds.S,$(OBJS-BLOB))
 
 ROBJS-BLOB	:= restorer.o
 #
@@ -69,7 +70,6 @@ RSRCS-BLOB	+= $(patsubst %.o,%.c,$(ROBJS-BLOB))
 
 RHEAD-BLOB-GEN	:= $(patsubst %.o,%-blob.h,$(ROBJS-BLOB))
 RHEAD-BIN	:= $(patsubst %.o,%.bin,$(ROBJS-BLOB))
-RHEAD-LDS	:= $(patsubst %.o,%.lds.S,$(ROBJS-BLOB))
 
 DEPS		:= $(patsubst %.o,%.d,$(OBJS))		\
        		   $(patsubst %.o,%.d,$(OBJS-BLOB))	\
@@ -87,9 +87,9 @@ parasite-util-net.o: util-net.c
 	$(E) "  CC      " $@
 	$(Q) $(CC) -c $(CFLAGS) -fpic $< -o $@
 
-$(HEAD-BIN): $(HEAD-LDS) $(OBJS-BLOB) parasite-util-net.o
+$(HEAD-BIN): $(PIE-LDS) $(OBJS-BLOB) parasite-util-net.o
 	$(E) "  GEN     " $@
-	$(Q) $(LD) -T $^ -o $@
+	$(Q) $(LD) -T $(PIE-LDS) $(OBJS-BLOB) parasite-util-net.o -o $@
 
 $(HEAD-BLOB-GEN): $(HEAD-BIN) $(GEN-OFFSETS)
 	$(E) "  GEN     " $@
@@ -100,9 +100,9 @@ $(ROBJS): $(RSRCS-BLOB)
 	$(E) "  CC      " $@
 	$(Q) $(CC) -c $(CFLAGS) -fpic $(patsubst %.o,%.c,$@) -o $@
 
-$(RHEAD-BIN): $(ROBJS) $(RHEAD-LDS)
+$(RHEAD-BIN): $(ROBJS) $(PIE-LDS)
 	$(E) "  GEN     " $@
-	$(Q) $(LD) -T $(patsubst %.bin,%.lds.S,$@) -o $@ $(ROBJS)
+	$(Q) $(LD) -T $(PIE-LDS) $(ROBJS) -o $@
 
 $(RHEAD-BLOB-GEN): $(RHEAD-BIN) $(GEN-OFFSETS)
 	$(E) "  GEN     " $@
diff --git a/parasite.lds.S b/parasite.lds.S
deleted file mode 100644
index 74d9d9e..0000000
--- a/parasite.lds.S
+++ /dev/null
@@ -1,18 +0,0 @@
-OUTPUT_FORMAT("binary")
-OUTPUT_ARCH(i386:x86-64)
-
-SECTIONS
-{
-	. = 0;
-	.text : {
-		*(.head.text)
-		*(.text)
-		. = ALIGN(8);
-	}
-	.data : {
-		*(.data)
-		*(.rodata)
-		*(.bss)
-		. = ALIGN(8);
-	}
-}
diff --git a/pie.lds.S b/pie.lds.S
new file mode 100644
index 0000000..74d9d9e
--- /dev/null
+++ b/pie.lds.S
@@ -0,0 +1,18 @@
+OUTPUT_FORMAT("binary")
+OUTPUT_ARCH(i386:x86-64)
+
+SECTIONS
+{
+	. = 0;
+	.text : {
+		*(.head.text)
+		*(.text)
+		. = ALIGN(8);
+	}
+	.data : {
+		*(.data)
+		*(.rodata)
+		*(.bss)
+		. = ALIGN(8);
+	}
+}
diff --git a/restorer.lds.S b/restorer.lds.S
deleted file mode 100644
index 74d9d9e..0000000
--- a/restorer.lds.S
+++ /dev/null
@@ -1,18 +0,0 @@
-OUTPUT_FORMAT("binary")
-OUTPUT_ARCH(i386:x86-64)
-
-SECTIONS
-{
-	. = 0;
-	.text : {
-		*(.head.text)
-		*(.text)
-		. = ALIGN(8);
-	}
-	.data : {
-		*(.data)
-		*(.rodata)
-		*(.bss)
-		. = ALIGN(8);
-	}
-}
-- 
1.7.7.6



More information about the CRIU mailing list