summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-02-03 19:01:32 -0500
committermidipix <writeonce@midipix.org>2017-02-03 19:01:32 -0500
commit99263f7eaf3435eb542ddf5046ed2c2adc596e62 (patch)
tree5d04391ed07921bcbc6b00cf1009568c29610179
parent260511cf41481ecf20a73410b7e0d1ca5efcfa8a (diff)
downloadmdso-99263f7eaf3435eb542ddf5046ed2c2adc596e62.tar.bz2
mdso-99263f7eaf3435eb542ddf5046ed2c2adc596e62.tar.xz
struct mdso_meta_table: added .name struct member and related support.
-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;
}