Apply ASLR to badge_init 68/143368/1
authorMyungki Lee <mk5004.lee@samsung.com>
Wed, 9 Aug 2017 11:00:54 +0000 (20:00 +0900)
committerMyungki Lee <mk5004.lee@samsung.com>
Wed, 9 Aug 2017 11:01:43 +0000 (20:01 +0900)
Change-Id: I35cb5a9928cdd5f610135b2f80199cdc0e2eede1
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
CMakeLists.txt

index 9681930..b631c96 100755 (executable)
@@ -61,7 +61,7 @@ ENDFOREACH(flag)
 
 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall -Werror -Wno-error=deprecated-declarations -O2")
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
 
 ADD_DEFINITIONS("-DBADGE_USE_DLOG")
 
@@ -72,7 +72,7 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${FULLVER})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
 
 ADD_EXECUTABLE(badge_init ${INIT-SRCS})
-TARGET_LINK_LIBRARIES(badge_init ${pkgs_LDFLAGS} badge)
+TARGET_LINK_LIBRARIES(badge_init ${pkgs_LDFLAGS} badge "-pie")
 
 MESSAGE(${LIB_INSTALL_DIR} ====)
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})