From e71ef191dc966fc80f1f47ebae2ac19ba30448a8 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 14 Apr 2025 18:08:02 -0400 Subject: More flexible symbol renaming that doesn't rely on advanced flags from `nm` --- src/tomo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/tomo.c b/src/tomo.c index d26ba73d..c319dda7 100644 --- a/src/tomo.c +++ b/src/tomo.c @@ -446,9 +446,9 @@ void build_library(Text_t lib_dir_name) FILE *prog; for (int64_t i = 0; i < tm_files.length; i++) { Path_t f = *(Path_t*)(tm_files.data + i*tm_files.stride); - prog = run_cmd("nm -Ug -fjust-symbols '", build_file(f, ".o"), "' " - "| sed -n 's/_\\$\\(.*\\)/\\0 _$", CORD_to_const_char_star(env->libname), - "$\\1/p' >>.build/symbol_renames.txt"); + prog = run_cmd("nm -g '", build_file(f, ".o"), "' | awk '$2~/^[DT]$/{print $3 \" _$", + CORD_to_const_char_star(env->libname), "\" substr($3,2)}' " + ">>.build/symbol_renames.txt"); if (!prog) print_err("Could not find symbols!"); int status = pclose(prog); if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) -- cgit v1.2.3