From be0d58b12eef0a43cf1e906d96177eb3747446fa Mon Sep 17 00:00:00 2001 From: Andrei Lascu Date: Thu, 19 Sep 2024 12:59:54 +0100 Subject: [PATCH] fixup! Introduce a symbols API Improve warning suppression --- src/compartment.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compartment.c b/src/compartment.c index dba270c..be882ff 100644 --- a/src/compartment.c +++ b/src/compartment.c @@ -989,7 +989,11 @@ resolve_rela_syms(struct Compartment *new_comp) if (curr_rela_map->rela_sym_bind == STB_WEAK) { // TODO Hack to suppress weak `libc` relocations - if (strcmp(new_comp->libs[i]->lib_name, "libc.so.7")) + const char *lib_to_suppress = "libc.so"; + if (strlen(new_comp->libs[i]->lib_name) + > strlen(lib_to_suppress) + && strncmp(new_comp->libs[i]->lib_name, lib_to_suppress, + strlen(lib_to_suppress))) { warnx("Did not find WEAK symbol %s of type %hu (idx " "%zu in library %s (idx %zu)) - execution "