diff options
author | midipix <writeonce@midipix.org> | 2019-02-03 23:21:54 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-02-04 00:43:59 -0500 |
commit | 8535b67a7dbd5bb2e8c4e529c20ec8076b5cc27c (patch) | |
tree | 013eeed4634f35720499814c14fbbc6f9e353a5b /src/driver | |
parent | 6612c3842b872a13291962e4744a8bffd0695d1a (diff) | |
download | mdso-8535b67a7dbd5bb2e8c4e529c20ec8076b5cc27c.tar.bz2 mdso-8535b67a7dbd5bb2e8c4e529c20ec8076b5cc27c.tar.xz |
Remove all bits pertaining to the obsolete distinction between code and data.
Diffstat (limited to 'src/driver')
-rw-r--r-- | src/driver/mdso_unit_ctx.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/driver/mdso_unit_ctx.c b/src/driver/mdso_unit_ctx.c index f7c4f83..d14beed 100644 --- a/src/driver/mdso_unit_ctx.c +++ b/src/driver/mdso_unit_ctx.c @@ -22,9 +22,6 @@ static int mdso_free_unit_ctx_impl(struct mdso_unit_ctx_impl * ctx, int status) if (ctx->expsyms && ctx->expsyms->buffer) free(ctx->expsyms->buffer); - if (ctx->expsyms && ctx->expsyms->stype) - free(ctx->expsyms->stype); - if (ctx->expsyms) free(ctx->expsyms); @@ -103,10 +100,8 @@ static int mdso_create_symbol_vector(struct mdso_unit_ctx_impl * ctx) size_t nbytes; size_t size; char * dst; - const char * base; const char * ch; const char ** sym; - int stype; const char exphdr[] = "EXPORTS\n"; const char imphdr[] = "IMPORTS\n"; @@ -126,10 +121,6 @@ static int mdso_create_symbol_vector(struct mdso_unit_ctx_impl * ctx) if (!(ctx->expsyms->buffer = calloc(1,ctx->map.size))) return -1; - if (!(ctx->expsyms->stype = calloc(nsyms,sizeof(int)))) - return -1; - - base = ctx->map.addr; ch = ctx->map.addr; nbytes = ctx->map.size; sym = ctx->expsyms->syms; @@ -154,7 +145,7 @@ static int mdso_create_symbol_vector(struct mdso_unit_ctx_impl * ctx) while (nbytes && ((nbytes < size) || (strncmp(ch,imphdr,size)))) { /* vector */ - *sym = dst; + *sym++ = dst; /* symbol */ for (; nbytes && ((*ch!=' ') @@ -169,22 +160,6 @@ static int mdso_create_symbol_vector(struct mdso_unit_ctx_impl * ctx) for (; nbytes && (*ch!='\n'); nbytes--) ch++; - /* stype */ - stype = ((*ch=='\n') - && ((ch-base) >= 6) - && !strncmp(&ch[-5]," DATA\n",6)) - ? MDSO_SYMBOL_TYPE_DATA - : MDSO_SYMBOL_TYPE_CODE; - - /* code vs. data: pending changes to the midipix gcc target */ - /* bits will remove the need to create .text thunks; in the */ - /* meantime, however, treat everything as code to compensate */ - /* for ld's incorrectly generated .def files. */ - stype = MDSO_SYMBOL_TYPE_CODE; - - ctx->expsyms->stype[sym - ctx->expsyms->syms] = stype; - sym++; - /* advance to next symbol */ for (; nbytes && ((*ch==' ') || (*ch=='\t') @@ -240,7 +215,6 @@ int mdso_get_unit_ctx( ctx->uctx.map = &ctx->map; ctx->uctx.cctx = &ctx->cctx; ctx->uctx.syms = ctx->expsyms->syms; - ctx->uctx.stype = ctx->expsyms->stype; *pctx = &ctx->uctx; |