summaryrefslogtreecommitdiff
path: root/src/logic
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-02-17 11:03:53 -0500
committermidipix <writeonce@midipix.org>2019-02-17 11:25:35 -0500
commitc2623283de6d87f02307e14bc4176826115e5f44 (patch)
tree33b80e37c26e9d33b395617ae45a42a5b6259312 /src/logic
parenta646dd9c97bf149d8ad1b15576b8873409abd8df (diff)
downloadmdso-c2623283de6d87f02307e14bc4176826115e5f44.tar.bz2
mdso-c2623283de6d87f02307e14bc4176826115e5f44.tar.xz
mdso_{asmgen|objgen}_symentry: support compiler-generated .gotrefs.
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/mdso_asmgen_symentry.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/logic/mdso_asmgen_symentry.c b/src/logic/mdso_asmgen_symentry.c
index 67ea686..cba360d 100644
--- a/src/logic/mdso_asmgen_symentry.c
+++ b/src/logic/mdso_asmgen_symentry.c
@@ -13,10 +13,11 @@
#include "mdso_errinfo_impl.h"
static const char * const asm_lines[] = {
- "\t.section " MDSO_STRS_SECTION ",\"r0\"\n\n",
- ".symstr:\n",
- "\t.ascii\t\"%s\\0\"\n\n"
- "\t.section " MDSO_SYMS_SECTION ",\"r\"\n",
+ "\t.section " MDSO_STRS_SECTION "$%s,\"r0\"\n\n",
+ ".symstr_%s:\n",
+ "\t.ascii\t\"%s\\0\"\n"
+ "\t.linkonce discard\n\n",
+ "\t.section " MDSO_SYMS_SECTION "$%s,\"r\"\n",
0
};
@@ -56,11 +57,14 @@ int mdso_asmgen_symentry(
if ((mdso_dprintf(fdout,"__imp_%s%s:\n",uscore,sym)) < 0)
return MDSO_FILE_ERROR(dctx);
- if ((mdso_dprintf(fdout,"\t%s\t.symstr\n",ptrsize)) < 0)
+ if ((mdso_dprintf(fdout,"\t%s\t.symstr_%s\n",ptrsize,sym)) < 0)
return MDSO_FILE_ERROR(dctx);
if ((mdso_dprintf(fdout,"\t%s\t.dsometa_%s\n",ptrsize,dctx->cctx->libname)) < 0)
return MDSO_FILE_ERROR(dctx);
+ if ((mdso_dprintf(fdout,"\t.linkonce discard\n")) < 0)
+ return MDSO_FILE_ERROR(dctx);
+
return 0;
}