diff options
author | midipix <writeonce@midipix.org> | 2017-02-03 01:13:26 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2017-02-03 01:13:26 -0500 |
commit | af228071b80d528ff67b7fd8736573994f594f87 (patch) | |
tree | 5b035222a378c4d4bb0fcd207878df4e7a53db7d /src/logic | |
parent | 95a9547d60251ead96dd241b8ee9b6c7c31df2c6 (diff) | |
download | mdso-af228071b80d528ff67b7fd8736573994f594f87.tar.bz2 mdso-af228071b80d528ff67b7fd8736573994f594f87.tar.xz |
mdso_generate_symfn(): prepend an underscore to the symbol name as needed.
Diffstat (limited to 'src/logic')
-rw-r--r-- | src/logic/mdso_generate_symfn.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/logic/mdso_generate_symfn.c b/src/logic/mdso_generate_symfn.c index 7b3b295..166d38e 100644 --- a/src/logic/mdso_generate_symfn.c +++ b/src/logic/mdso_generate_symfn.c @@ -11,13 +11,12 @@ #include "mdso_errinfo_impl.h" static const char * const asm_lines[] = { - "\t.file \"__%s_sym_fn.s\"\n", "\t.section .text\n", - "\t.globl %s\n", - "\t.def %s; .scl 2; .type 32; .endef\n\n", + "\t.globl %s%s\n", + "\t.def %s%s; .scl 2; .type 32; .endef\n\n", - "%s:\n", - "\tjmp *__imp_%s\n\n", + "%s%s:\n", + "\tjmp *__imp_%s%s\n\n", 0 }; @@ -27,9 +26,16 @@ int mdso_generate_symfn( FILE * fout) { const char * const * line; + const char * uscore; + + if (fprintf(fout,"\t.file \"__%s_sym_fn.s\"\n",sym) < 0) + return MDSO_FILE_ERROR(dctx); + + uscore = (dctx->cctx->drvflags & MDSO_DRIVER_QUAD_PTR) + ? "" : "_"; for (line=asm_lines; *line; line++) - if ((fprintf(fout,*line,sym)) < 0) + if (fprintf(fout,*line,uscore,sym) < 0) return MDSO_FILE_ERROR(dctx); return 0; |