Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/embryo
Dir : e17/libs/embryo/src/bin
Modified Files:
embryo_cc_sc1.c embryo_cc_sc6.c
Log Message:
and fix this to work on PPC (big endian)
still have to check for 64bit... that is borken, i think...
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/bin/embryo_cc_sc1.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- embryo_cc_sc1.c 25 Mar 2004 02:07:28 -0000 1.3
+++ embryo_cc_sc1.c 25 Mar 2004 09:29:15 -0000 1.4
@@ -20,7 +20,7 @@
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
- * Version: $Id: embryo_cc_sc1.c,v 1.3 2004/03/25 02:07:28 raster Exp $
+ * Version: $Id: embryo_cc_sc1.c,v 1.4 2004/03/25 09:29:15 raster Exp $
*/
#include <assert.h>
#include <ctype.h>
@@ -458,7 +458,8 @@
assemble(binf,outf); /* assembler file is now input */
} /* if */
if (outf!=NULL)
- sc_closeasm(outf,!(sc_asmfile || sc_listing));
+// sc_closeasm(outf,!(sc_asmfile || sc_listing));
+ sc_closeasm(outf, 0);
if (binf!=NULL)
sc_closebin(binf,errnum!=0);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/bin/embryo_cc_sc6.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- embryo_cc_sc6.c 25 Mar 2004 02:07:28 -0000 1.2
+++ embryo_cc_sc6.c 25 Mar 2004 09:29:16 -0000 1.3
@@ -18,7 +18,7 @@
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
- * Version: $Id: embryo_cc_sc6.c,v 1.2 2004/03/25 02:07:28 raster Exp $
+ * Version: $Id: embryo_cc_sc6.c,v 1.3 2004/03/25 09:29:16 raster Exp $
*/
#include <assert.h>
#include <stdio.h>
@@ -601,6 +601,8 @@
symbol *sym, **nativelist;
constvalue *constptr;
cell mainaddr;
+ int nametable, tags, libraries, publics, natives, pubvars;
+ int cod, dat, hea, stp, cip, size, defsize;
#if !defined NDEBUG
/* verify that the opcode list is sorted (skip entry 1; it is reserved
@@ -693,46 +695,46 @@
hdr.flags|=AMX_FLAG_COMPACT;
if (sc_debug==0)
hdr.flags|=AMX_FLAG_NOCHECKS;
- #if BYTE_ORDER==BIG_ENDIAN
- hdr.flags|=AMX_FLAG_BIGENDIAN;
- #endif
- hdr.defsize=sizeof(FUNCSTUB);
+// #if BYTE_ORDER==BIG_ENDIAN
+// hdr.flags|=AMX_FLAG_BIGENDIAN;
+// #endif
+ defsize = hdr.defsize=sizeof(FUNCSTUB);
assert((hdr.defsize % sizeof(cell))==0);
- hdr.publics=sizeof hdr; /* public table starts right after the header */
- hdr.natives=hdr.publics + numpublics*sizeof(FUNCSTUB);
- hdr.libraries=hdr.natives + numnatives*sizeof(FUNCSTUB);
- hdr.pubvars=hdr.libraries + numlibraries*sizeof(FUNCSTUB);
- hdr.tags=hdr.pubvars + numpubvars*sizeof(FUNCSTUB);
- hdr.nametable=hdr.tags + numtags*sizeof(FUNCSTUB);
- hdr.cod=hdr.nametable + nametablesize + padding;
- hdr.dat=hdr.cod + code_idx;
- hdr.hea=hdr.dat + glb_declared*sizeof(cell);
- hdr.stp=hdr.hea + sc_stksize*sizeof(cell);
- hdr.cip=mainaddr;
- hdr.size=hdr.hea; /* preset, this is incorrect in case of compressed output */
+ publics = hdr.publics=sizeof hdr; /* public table starts right after the header */
+ natives = hdr.natives=hdr.publics + numpublics*sizeof(FUNCSTUB);
+ libraries = hdr.libraries=hdr.natives + numnatives*sizeof(FUNCSTUB);
+ pubvars = hdr.pubvars=hdr.libraries + numlibraries*sizeof(FUNCSTUB);
+ tags = hdr.tags=hdr.pubvars + numpubvars*sizeof(FUNCSTUB);
+ nametable = hdr.nametable=hdr.tags + numtags*sizeof(FUNCSTUB);
+ cod = hdr.cod=hdr.nametable + nametablesize + padding;
+ dat = hdr.dat=hdr.cod + code_idx;
+ hea = hdr.hea=hdr.dat + glb_declared*sizeof(cell);
+ stp = hdr.stp=hdr.hea + sc_stksize*sizeof(cell);
+ cip = hdr.cip=mainaddr;
+ size = hdr.size=hdr.hea; /* preset, this is incorrect in case of compressed output
*/
#if BYTE_ORDER==BIG_ENDIAN
align32(&hdr.size);
align16(&hdr.magic);
align16(&hdr.flags);
align16(&hdr.defsize);
+ align32(&hdr.cod);
+ align32(&hdr.dat);
+ align32(&hdr.hea);
+ align32(&hdr.stp);
+ align32(&hdr.cip);
align32(&hdr.publics);
align32(&hdr.natives);
align32(&hdr.libraries);
align32(&hdr.pubvars);
align32(&hdr.tags);
align32(&hdr.nametable);
- align32(&hdr.cod);
- align32(&hdr.dat);
- align32(&hdr.hea);
- align32(&hdr.stp);
- align32(&hdr.cip);
#endif
sc_writebin(fout,&hdr,sizeof hdr);
/* dump zeros up to the rest of the header, so that we can easily "seek" */
- for (nameofs=sizeof hdr; nameofs<hdr.cod; nameofs++)
- putc(0,fout);
- nameofs=hdr.nametable+sizeof(int16_t);
+ for (nameofs=sizeof hdr; nameofs<cod; nameofs++)
+ putc(0,fout);
+ nameofs=nametable+sizeof(int16_t);
/* write the public functions table */
count=0;
@@ -747,9 +749,9 @@
align32(&func.address);
align32(&func.nameofs);
#endif
- fseek(fout,hdr.publics+count*sizeof(FUNCSTUB),SEEK_SET);
+ fseek(fout,publics+count*sizeof(FUNCSTUB),SEEK_SET);
sc_writebin(fout,&func,sizeof func);
- fseek(fout,func.nameofs,SEEK_SET);
+ fseek(fout,nameofs,SEEK_SET);
sc_writebin(fout,sym->name,strlen(sym->name)+1);
nameofs+=strlen(sym->name)+1;
count++;
@@ -796,9 +798,9 @@
align32(&func.address);
align32(&func.nameofs);
#endif
- fseek(fout,hdr.natives+count*sizeof(FUNCSTUB),SEEK_SET);
+ fseek(fout,natives+count*sizeof(FUNCSTUB),SEEK_SET);
sc_writebin(fout,&func,sizeof func);
- fseek(fout,func.nameofs,SEEK_SET);
+ fseek(fout,nameofs,SEEK_SET);
sc_writebin(fout,alias,strlen(alias)+1);
nameofs+=strlen(alias)+1;
count++;
@@ -817,9 +819,9 @@
align32(&func.address);
align32(&func.nameofs);
#endif
- fseek(fout,hdr.libraries+count*sizeof(FUNCSTUB),SEEK_SET);
+ fseek(fout,libraries+count*sizeof(FUNCSTUB),SEEK_SET);
sc_writebin(fout,&func,sizeof func);
- fseek(fout,func.nameofs,SEEK_SET);
+ fseek(fout,nameofs,SEEK_SET);
sc_writebin(fout,constptr->name,strlen(constptr->name)+1);
nameofs+=strlen(constptr->name)+1;
count++;
@@ -838,9 +840,9 @@
align32(&func.address);
align32(&func.nameofs);
#endif
- fseek(fout,hdr.pubvars+count*sizeof(FUNCSTUB),SEEK_SET);
+ fseek(fout,pubvars+count*sizeof(FUNCSTUB),SEEK_SET);
sc_writebin(fout,&func,sizeof func);
- fseek(fout,func.nameofs,SEEK_SET);
+ fseek(fout,nameofs,SEEK_SET);
sc_writebin(fout,sym->name,strlen(sym->name)+1);
nameofs+=strlen(sym->name)+1;
count++;
@@ -858,9 +860,9 @@
align32(&func.address);
align32(&func.nameofs);
#endif
- fseek(fout,hdr.tags+count*sizeof(FUNCSTUB),SEEK_SET);
+ fseek(fout,tags+count*sizeof(FUNCSTUB),SEEK_SET);
sc_writebin(fout,&func,sizeof func);
- fseek(fout,func.nameofs,SEEK_SET);
+ fseek(fout,nameofs,SEEK_SET);
sc_writebin(fout,constptr->name,strlen(constptr->name)+1);
nameofs+=strlen(constptr->name)+1;
count++;
@@ -868,14 +870,14 @@
} /* for */
/* write the "maximum name length" field in the name table */
- assert(nameofs==hdr.nametable+nametablesize);
- fseek(fout,hdr.nametable,SEEK_SET);
+ assert(nameofs==nametable+nametablesize);
+ fseek(fout,nametable,SEEK_SET);
count=sNAMEMAX;
#if BYTE_ORDER==BIG_ENDIAN
align16(&count);
#endif
sc_writebin(fout,&count,sizeof count);
- fseek(fout,hdr.cod,SEEK_SET);
+ fseek(fout,cod,SEEK_SET);
/* First pass: relocate all labels */
/* This pass is necessary because the code addresses of labels is only known
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs