summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorAllen Webb <allenwebb@google.com>2018-11-07 16:12:58 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-11-09 07:19:48 -0800
commit145ffc6c6ab33a49c2e41a581ad2116c61c43f67 (patch)
tree7e87b41f84f57c11565e3193ef2bccf1016b83bc /core
parentfccbafda7b10444502f83de8fe7022a59fd2d0a4 (diff)
downloadchrome-ec-145ffc6c6ab33a49c2e41a581ad2116c61c43f67.tar.gz
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 <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1325169 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/host/main.c2
-rw-r--r--core/host/task.c4
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);