From 145ffc6c6ab33a49c2e41a581ad2116c61c43f67 Mon Sep 17 00:00:00 2001 From: Allen Webb Date: Wed, 7 Nov 2018 16:12:58 -0800 Subject: core/host: Fix __prog_name and make task struct const. This fixes the error: "addr2line: 'ec-fuzz': No such file" when executing a fuzzing target within the $PWD. Note that a similar error will still appear when executing from another path. BRANCH=None BUG=None TEST=make -j buildfuzztests Change-Id: Id0257e05a937374c3340c7b276ca7dea1981704a Signed-off-by: Allen Webb Reviewed-on: https://chromium-review.googlesource.com/1325169 Reviewed-by: Nicolas Boichat --- core/host/main.c | 2 +- core/host/task.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/host/main.c b/core/host/main.c index fa92b996c5..45cfbfdfb4 100644 --- a/core/host/main.c +++ b/core/host/main.c @@ -85,7 +85,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) * We lose the program name as LLVM fuzzer takes over main function: * make up one. */ - static const char *name = "ec-fuzz"; + static const char *name = STRINGIFY(PROJECT)".exe"; if (!initialized) { __prog_name = name; diff --git a/core/host/task.c b/core/host/task.c index f75456cbb0..5ec77d689e 100644 --- a/core/host/task.c +++ b/core/host/task.c @@ -78,7 +78,7 @@ void _run_test(void *d) } #define TASK(n, r, d, s) {r, d}, -struct task_args task_info[TASK_ID_COUNT] = { +const struct task_args task_info[TASK_ID_COUNT] = { {__idle, NULL}, CONFIG_TASK_LIST CONFIG_TEST_TASK_LIST @@ -402,7 +402,7 @@ void task_scheduler(void) void *_task_start_impl(void *a) { long tid = (long)a; - struct task_args *arg = task_info + tid; + const struct task_args *arg = task_info + tid; my_task_id = tid; pthread_mutex_lock(&run_lock); -- cgit v1.2.1