summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-23 23:39:15 -0400
committermidipix <writeonce@midipix.org>2016-11-11 00:22:48 -0500
commit7f20b2f02c426c7c671b2c69eb15c6d93fb24401 (patch)
tree65814baca4f2c75f5a72b2577db578025bf2bf3e /src
parent6e477ad14f10cefe6c06ffd9f67e8d351ec17c79 (diff)
downloadmdso-7f20b2f02c426c7c671b2c69eb15c6d93fb24401.tar.bz2
mdso-7f20b2f02c426c7c671b2c69eb15c6d93fb24401.tar.xz
mdso_generate_symentry(): added error trace support.
Diffstat (limited to 'src')
-rw-r--r--src/logic/mdso_create_implib_sources.c2
-rw-r--r--src/logic/mdso_generate_symentry.c18
2 files changed, 11 insertions, 9 deletions
diff --git a/src/logic/mdso_create_implib_sources.c b/src/logic/mdso_create_implib_sources.c
index 8a3a4d0..93c83d5 100644
--- a/src/logic/mdso_create_implib_sources.c
+++ b/src/logic/mdso_create_implib_sources.c
@@ -56,7 +56,7 @@ mdso_api int mdso_create_implib_sources(const struct mdso_driver_ctx * dctx)
if (!(fout = mdso_create_output(dctx,asmname)))
return MDSO_NESTED_ERROR(dctx);
- ret = mdso_generate_symentry(dctx->cctx,*sym,fout);
+ ret = mdso_generate_symentry(dctx,*sym,fout);
if (fout != stdout)
fclose(fout);
diff --git a/src/logic/mdso_generate_symentry.c b/src/logic/mdso_generate_symentry.c
index ae9d1a5..80c297e 100644
--- a/src/logic/mdso_generate_symentry.c
+++ b/src/logic/mdso_generate_symentry.c
@@ -6,8 +6,10 @@
#include <stdint.h>
#include <stdio.h>
+
#include <mdso/mdso.h>
#include <mdso/mdso_specs.h>
+#include "mdso_errinfo_impl.h"
static const char * const asm_lines[] = {
"\t.file \"__%s_sym_entry.s\"\n",
@@ -24,7 +26,7 @@ static const char * const asm_lines[] = {
};
int mdso_generate_symentry(
- const struct mdso_common_ctx * cctx,
+ const struct mdso_driver_ctx * dctx,
const char * sym,
FILE * fout)
{
@@ -32,7 +34,7 @@ int mdso_generate_symentry(
const char * alignstr;
const char * ptrsize;
- if (cctx->drvflags & MDSO_DRIVER_QUAD_PTR) {
+ if (dctx->cctx->drvflags & MDSO_DRIVER_QUAD_PTR) {
alignstr = "\t.balign 16\n\n";
ptrsize = ".quad";
} else {
@@ -42,19 +44,19 @@ int mdso_generate_symentry(
for (line=asm_lines; *line; line++)
if ((fprintf(fout,*line,sym)) < 0)
- return -1;
+ return MDSO_FILE_ERROR(dctx);
if ((fputs(alignstr,fout)) < 0)
- return -1;
+ return MDSO_FILE_ERROR(dctx);
if ((fprintf(fout,"__imp_%s:\n",sym)) < 0)
- return -1;
+ return MDSO_FILE_ERROR(dctx);
if ((fprintf(fout,"\t%s\t.__dsostr_%s\n",ptrsize,sym)) < 0)
- return -1;
+ return MDSO_FILE_ERROR(dctx);
- if ((fprintf(fout,"\t%s\t.__dsometa_%s\n",ptrsize,cctx->libname)) < 0)
- return -1;
+ if ((fprintf(fout,"\t%s\t.__dsometa_%s\n",ptrsize,dctx->cctx->libname)) < 0)
+ return MDSO_FILE_ERROR(dctx);
return 0;
}