From 9e90beda5fd3fd4f93eac229e41bb5f3b9f86982 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 30 Mar 2025 23:27:59 +0000 Subject: driver: --prefer-sltdl: implementation and link-mode integration. --- src/logic/linkcmd/slbt_linkcmd_argv.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/logic/linkcmd') diff --git a/src/logic/linkcmd/slbt_linkcmd_argv.c b/src/logic/linkcmd/slbt_linkcmd_argv.c index 013317f..546c8d5 100644 --- a/src/logic/linkcmd/slbt_linkcmd_argv.c +++ b/src/logic/linkcmd/slbt_linkcmd_argv.c @@ -1027,6 +1027,22 @@ slbt_hidden int slbt_exec_link_finalize_argument_vector( } } + /* replace -lltdl with -lsltdl as needed */ + if (dctx->cctx->drvflags & SLBT_DRIVER_PREFER_SLTDL) { + struct slbt_exec_ctx_impl * ictx; + + ictx = slbt_get_exec_ictx(ectx); + + for (src=ectx->argv; *src; src++) + if ((src[0][0] == '-') && (src[0][1] == 'l')) + if ((src[0][2] == 'l') + && (src[0][3] == 't') + && (src[0][4] == 'd') + && (src[0][5] == 'l')) + if (!src[0][6]) + *src = ictx->lsltdl; + } + /* properly null-terminate argv, accounting for redundant -l arguments */ *dst = 0; -- cgit v1.2.3