summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mdso/mdso_specs.h1
-rw-r--r--src/logic/mdso_generate_dsometa.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/include/mdso/mdso_specs.h b/include/mdso/mdso_specs.h
index c53756a..3eed952 100644
--- a/include/mdso/mdso_specs.h
+++ b/include/mdso/mdso_specs.h
@@ -32,6 +32,7 @@ struct mdso_sym_entry {
struct mdso_meta_table {
void * base;
+ const char * name;
uint32_t flags;
uint32_t priority;
uint32_t nsyms;
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;
}