From faf4545698fcfe6a8769b9c4642d319278696563 Mon Sep 17 00:00:00 2001 From: Andrei Lascu Date: Fri, 19 Jul 2024 11:26:45 +0100 Subject: [PATCH] fixup! Changes to better handle relocation --- src/compartment.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compartment.c b/src/compartment.c index 54e9199..5672a28 100644 --- a/src/compartment.c +++ b/src/compartment.c @@ -1074,6 +1074,9 @@ find_lib_dep_sym_in_lib(const char *to_find, struct Compartment *comp_to_search, continue; } + // We build up the conditions needed to find a valid symbol to be + // relocated against in `cond` + // // Ignore `LOCAL` bind symbols - they cannot be relocated against bool cond = curr_sym.sym_bind != STB_LOCAL; @@ -1089,6 +1092,7 @@ find_lib_dep_sym_in_lib(const char *to_find, struct Compartment *comp_to_search, cond = cond && curr_sym.sym_offset != 0; } + // If all conditions pass, we found a valid symbol to relocate against if (cond) { res = (struct LibSymSearchResult) {