diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-14 18:08:02 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-14 18:08:02 -0400 |
| commit | e71ef191dc966fc80f1f47ebae2ac19ba30448a8 (patch) | |
| tree | 7f6ebefc7d7d1a79ce6eebeb36314d192a0a3c8a | |
| parent | 41d0e70eba4e5155746552e8a98ee1b599e0c8a5 (diff) | |
More flexible symbol renaming that doesn't rely on advanced flags from
`nm`
| -rw-r--r-- | src/tomo.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |
