build: support multiple shared symbol lists

Allows `target_share_symbols` macro to accept a list of symbol files

Signed-off-by: Anubhav Raina <anubhav.raina@arm.com>
Change-Id: I2402aaa4be15def1d837ab58cfddb5682f651a9a
diff --git a/toolchain_GNUARM.cmake b/toolchain_GNUARM.cmake
index ef58d69..217e36f 100644
--- a/toolchain_GNUARM.cmake
+++ b/toolchain_GNUARM.cmake
@@ -276,15 +276,19 @@
     )
 endmacro()
 
-macro(target_share_symbols target symbol_name_file)
+macro(target_share_symbols target)
     get_target_property(TARGET_TYPE ${target} TYPE)
     if (NOT TARGET_TYPE STREQUAL "EXECUTABLE")
         message(FATAL_ERROR "${target} is not an executable. Symbols cannot be shared from libraries.")
     endif()
 
-    FILE(STRINGS ${symbol_name_file} KEEP_SYMBOL_LIST
-        LENGTH_MINIMUM 1
-    )
+    foreach(symbol_file ${ARGN})
+        FILE(STRINGS ${symbol_file} SYMBOLS
+            LENGTH_MINIMUM 1
+        )
+        list(APPEND KEEP_SYMBOL_LIST ${SYMBOLS})
+    endforeach()
+
     set(STRIP_SYMBOL_KEEP_LIST ${KEEP_SYMBOL_LIST})
 
     # Force the target to not remove the symbols if they're unused.