From 00a88c01dc20c33da1936600d46974d460a23cc4 Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 8 Feb 2017 01:08:41 -0500 Subject: project: source tree: tidy up. --- src/object/mdso_create_implib_objects.c | 79 --------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 src/object/mdso_create_implib_objects.c (limited to 'src/object') diff --git a/src/object/mdso_create_implib_objects.c b/src/object/mdso_create_implib_objects.c deleted file mode 100644 index dd681e0..0000000 --- a/src/object/mdso_create_implib_objects.c +++ /dev/null @@ -1,79 +0,0 @@ -/****************************************************************/ -/* mdso: midipix dso scavenger */ -/* Copyright (C) 2015--2017 Z. Gilboa */ -/* Released under GPLv2 and GPLv3; see COPYING.MDSO. */ -/****************************************************************/ - -#include -#include -#include - -#include -#include "mdso_errinfo_impl.h" - -static void mdso_init_objname(char * buf, const char * fmt, const char * str) -{ - char hexstr[24]; - long long unsigned int crc64; - - if (strlen(str) + strlen(fmt) > (PATH_MAX - 1)) { - crc64 = mdso_crc64_mbstr((const unsigned char *)str,0); - sprintf(hexstr,"%llx",crc64); - sprintf(buf,fmt,hexstr); - } else - sprintf(buf,fmt,str); -} - -mdso_api int mdso_create_implib_objects(const struct mdso_driver_ctx * dctx) -{ - struct mdso_unit_ctx * uctx; - const char ** unit; - FILE * fout; - char objname[PATH_MAX]; - const char * const * sym; - int ret; - - mdso_init_objname(objname,".dsometa_%s.o",dctx->cctx->libname); - - if (!(fout = mdso_create_object(dctx,objname))) - return MDSO_NESTED_ERROR(dctx); - - ret = mdso_objgen_dsometa(dctx,fout,0); - fclose(fout); - - if (ret < 0) - return MDSO_NESTED_ERROR(dctx); - - for (unit=dctx->units; *unit; unit++) { - if (mdso_get_unit_ctx(dctx,*unit,&uctx)) - return MDSO_NESTED_ERROR(dctx); - - for (sym=uctx->syms; *sym; sym++) { - mdso_init_objname(objname,".%s_symentry.o",*sym); - - if (!(fout = mdso_create_object(dctx,objname))) - return MDSO_NESTED_ERROR(dctx); - - ret = mdso_objgen_symentry(dctx,*sym,fout,0); - fclose(fout); - - if (ret < 0) - return MDSO_NESTED_ERROR(dctx); - - mdso_init_objname(objname,".%s_symfn.o",*sym); - - if (!(fout = mdso_create_object(dctx,objname))) - return MDSO_NESTED_ERROR(dctx); - - ret = mdso_objgen_symfn(dctx,*sym,fout,0); - fclose(fout); - - if (ret < 0) - return MDSO_NESTED_ERROR(dctx); - } - - mdso_free_unit_ctx(uctx); - } - - return 0; -} -- cgit v1.2.3