summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/logic/mdso_generate_dsometa.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/logic/mdso_generate_dsometa.c b/src/logic/mdso_generate_dsometa.c
index 676f040..483a05c 100644
--- a/src/logic/mdso_generate_dsometa.c
+++ b/src/logic/mdso_generate_dsometa.c
@@ -32,6 +32,13 @@ static const char * const asm_meta_lines[] = {
0
};
+static const char * const asm_libname_fmt =
+ "\n\n"
+ "\t.section " MDSO_STRS_SECTION ",\"r\"\n"
+ "\t.balign 2\n\n"
+ "._name:\n"
+ "\t.ascii\t\"%s\\0\"\n\n";
+
int mdso_generate_dsometa(
const struct mdso_driver_ctx * dctx,
FILE * fout)
@@ -61,6 +68,9 @@ int mdso_generate_dsometa(
if ((fprintf(fout,"\t%s\t%d\t# base\n",ptrsize,0)) < 0)
return MDSO_FILE_ERROR(dctx);
+ if ((fprintf(fout,"\t%s\t%s\t# name\n",ptrsize,"._name")) < 0)
+ return MDSO_FILE_ERROR(dctx);
+
if ((fprintf(fout,"\t%s\t%u\t# flags\n",".long",dctx->cctx->dsoflags)) < 0)
return MDSO_FILE_ERROR(dctx);
@@ -68,5 +78,8 @@ int mdso_generate_dsometa(
if ((fprintf(fout,*line,ptrsize)) < 0)
return MDSO_FILE_ERROR(dctx);
+ if (fprintf(fout,asm_libname_fmt,dctx->cctx->libname) < 0)
+ return MDSO_FILE_ERROR(dctx);
+
return 0;
}