[coreboot-gerrit] New patch to review for coreboot: b0ae649 timestamp: fix incremental linking error for !HAVE_MONOTONIC_TIMER

Aaron Durbin (adurbin@chromium.org) gerrit at coreboot.org
Thu May 7 18:49:17 CEST 2015


Aaron Durbin (adurbin at chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10138

-gerrit

commit b0ae64971b9be8bebe3e47a2ce0f9b4e8db7d7a3
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Thu May 7 11:32:30 2015 -0500

    timestamp: fix incremental linking error for !HAVE_MONOTONIC_TIMER
    
    In linking ramstage a single object file is created before linking
    with the linker script. Though there is a weak timestamp_get() symbol
    in timestamp.c any of its dependent symbols need to be available
    during the incremental link. As not all platforms have
    HAVE_MONOTONIC_TIMER enabled this will create a linking error.
    Fix this by providing a hint to the compiler to remove dead code
    and thus the dependent symbols causing linking errors in the presence
    of !HAVE_MONOTONIC_TIMER.
    
    Change-Id: Ib8a5dca2c12c2edac7605f403ed91b793823c8a3
    Signed-off-by: Aaron Durbin <adurbin at chromium.org>
---
 src/lib/timestamp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index 0c9c884..4b5f4d4 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -180,6 +180,9 @@ uint64_t  __attribute__((weak)) timestamp_get(void)
 {
 	struct mono_time t1, t2;
 
+	if (!IS_ENABLED(CONFIG_HAVE_MONOTONIC_TIMER))
+		return 0;
+
 	mono_time_set_usecs(&t1, 0);
 	timer_monotonic_get(&t2);
 



More information about the coreboot-gerrit mailing list