From 6ff98094710c0cddb2a47e3ac55611babd7c26e0 Mon Sep 17 00:00:00 2001 From: Honggang Li Date: Thu, 27 Sep 2018 01:52:50 -0400 Subject: [PATCH 1/3] Link executables with '-pie' Signed-off-by: Honggang Li --- Esm/ib/src/linux/startup/fm_config/Makefile | 4 ++-- Makerules/Maketargets.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Esm/ib/src/linux/startup/fm_config/Makefile b/Esm/ib/src/linux/startup/fm_config/Makefile index cbf277f..99b3635 100644 --- a/Esm/ib/src/linux/startup/fm_config/Makefile +++ b/Esm/ib/src/linux/startup/fm_config/Makefile @@ -150,10 +150,10 @@ include $(TL_DIR)/Makerules/Maketargets.build include $(TL_DIR)/Makerules/Maketargets.install $(BUILDDIR)/config_check: $(BUILDDIR)/config_check.o - $(VS)$(CC) $(LDFLAGS)$@ $(BUILDDIR)/config_check.o $(LDLIBS) + $(VS)$(CC) -pie $(LDFLAGS)$@ $(BUILDDIR)/config_check.o $(LDLIBS) $(BUILDDIR)/config_convert: $(BUILDDIR)/config_convert.o - $(VS)$(CC) $(LDFLAGS)$@ $(BUILDDIR)/config_convert.o $(LDLIBS) + $(VS)$(CC) -pie $(LDFLAGS)$@ $(BUILDDIR)/config_convert.o $(LDLIBS) # install for stage phase #include $(TL_DIR)/Makerules/Maketargets.stage diff --git a/Makerules/Maketargets.build b/Makerules/Maketargets.build index ebf9fdf..9cd7844 100755 --- a/Makerules/Maketargets.build +++ b/Makerules/Maketargets.build @@ -127,7 +127,7 @@ else # BUILD_TARGET_OS is not VXWORKS $(CMD_TARGETS_EXE) : $(CT_OBJECTS) $(RSCOBJECTS) $(DEPLIBS_TARGETS) @echo Linking executable... @mkdir -p $(dir $@) - $(VS)$(CC) $(LDFLAGS)$@ $(CT_OBJECTS) $(LDLIBS) + $(VS)$(CC) -pie $(LDFLAGS)$@ $(CT_OBJECTS) $(LDLIBS) endif # BUILD_TARGET_OS is VXWORKS endif # CMD_TARGETS_EXE non-null -- 2.18.0