From 7b9db347ae24008373a5e2030d7b1971fe8f9d61 Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Tue, 16 Apr 2019 14:54:58 -0700 Subject: [PATCH] Fix linker compilation with timing enabled Test: Build with TIMING set to 1 in linker_debug.h. Change-Id: Ia11021f6221bc985abddb379e813e4e353fd7149 --- linker/linker_main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/linker/linker_main.cpp b/linker/linker_main.cpp index 6c762a92c..f6e4f6774 100644 --- a/linker/linker_main.cpp +++ b/linker/linker_main.cpp @@ -467,9 +467,11 @@ static ElfW(Addr) linker_main(KernelArgumentBlock& args, const char* exe_to_load #if TIMING gettimeofday(&t1, nullptr); - PRINT("LINKER TIME: %s: %d microseconds", g_argv[0], (int) ( - (((long long)t1.tv_sec * 1000000LL) + (long long)t1.tv_usec) - - (((long long)t0.tv_sec * 1000000LL) + (long long)t0.tv_usec))); + PRINT("LINKER TIME: %s: %d microseconds", g_argv[0], + static_cast(((static_cast(t1.tv_sec) * 1000000LL) + + static_cast(t1.tv_usec)) - + ((static_cast(t0.tv_sec) * 1000000LL) + + static_cast(t0.tv_usec)))); #endif #if STATS PRINT("RELO STATS: %s: %d abs, %d rel, %d copy, %d symbol", g_argv[0],