programs: Link to tests common code

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/programs/hash/CMakeLists.txt b/programs/hash/CMakeLists.txt
index 0b4a1c5..ae29479 100644
--- a/programs/hash/CMakeLists.txt
+++ b/programs/hash/CMakeLists.txt
@@ -4,7 +4,7 @@
 )
 
 foreach(exe IN LISTS executables)
-    add_executable(${exe} ${exe}.c)
+    add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
     target_link_libraries(${exe} mbedcrypto)
 endforeach()