libcrash-service: Do not export unneeded symbols 54/255054/1
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 11 Mar 2021 11:23:33 +0000 (12:23 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 11 Mar 2021 11:23:33 +0000 (12:23 +0100)
Change-Id: I5584761b83f386568b869be921f667d18c6cfd3e

src/crash-manager/CMakeLists.txt
src/crash-manager/crash-manager.c
src/crash-manager/crash-manager.h

index 2c08cdb..70930cd 100644 (file)
@@ -36,7 +36,7 @@ FOREACH(flag ${crash-manager_pkgs_CFLAGS} ${helper_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE -fvisibility=hidden")
 
 ADD_LIBRARY(libcrash-manager SHARED ${LIB_CRASH_MANAGER_SRCS})
 SET_TARGET_PROPERTIES(libcrash-manager PROPERTIES SOVERSION 1)
index 1554f34..1db35b9 100644 (file)
@@ -1252,7 +1252,7 @@ static int wait_for_opt(unsigned int timeout)
        return 1;
 }
 
-static void free_crash_info(struct crash_info *cinfo)
+EXPORT void free_crash_info(struct crash_info *cinfo)
 {
        free(cinfo->cmd_line);
        free(cinfo->cmd_path);
@@ -1273,7 +1273,7 @@ static void free_crash_info(struct crash_info *cinfo)
        free(cinfo->call_stack_hash);
 }
 
-void crash_info_init(struct crash_info *cinfo)
+EXPORT void crash_info_init(struct crash_info *cinfo)
 {
        cinfo->prstatus_fd = -1;
        cinfo->livedump = false;
@@ -1453,7 +1453,7 @@ static void crash_manager_cleanup(struct crash_info *cinfo)
        clean_temp(crash_temp_path);
 }
 
-void crash_manager_free(struct crash_info *cinfo)
+EXPORT void crash_manager_free(struct crash_info *cinfo)
 {
        if (cinfo->prstatus_fd >= 0)
                close(cinfo->prstatus_fd);
@@ -1464,7 +1464,7 @@ void crash_manager_free(struct crash_info *cinfo)
        free_crash_info(cinfo);
 }
 
-bool crash_manager_direct(struct crash_info *cinfo)
+EXPORT bool crash_manager_direct(struct crash_info *cinfo)
 {
        if (!crash_manager_prepare(cinfo))
                return false;
@@ -1475,7 +1475,7 @@ bool crash_manager_direct(struct crash_info *cinfo)
        return result;
 }
 
-bool crash_manager_livedump_pid(pid_t pid, const char *dump_reason, char *report_path, size_t report_path_len)
+EXPORT bool crash_manager_livedump_pid(pid_t pid, const char *dump_reason, char *report_path, size_t report_path_len)
 {
        bool result = false;
        struct crash_info cinfo;
index c511043..a12f03e 100644 (file)
@@ -23,6 +23,8 @@
 #include <unistd.h>
 #include <stdbool.h>
 
+#define EXPORT __attribute__ ((visibility ("default")))
+
 /* Paths and variables */
 struct crash_info {
        bool livedump;
@@ -58,7 +60,8 @@ struct crash_info {
 
 bool crash_manager_direct(struct crash_info *cinfo);
 bool crash_manager_livedump_pid(pid_t pid, const char *dump_reason, char *report_path, size_t report_path_len);
-void crash_info_init(struct crash_info *cinfo);
 void crash_manager_free(struct crash_info *cinfo);
+void crash_info_init(struct crash_info *cinfo);
+void free_crash_info(struct crash_info *cinfo);
 
 #endif