Added flag to give stack size

This commit is contained in:
ceriel 1988-07-15 15:29:44 +00:00
parent bfaff9d0ee
commit 5c508b566f
2 changed files with 20 additions and 3 deletions

View file

@ -55,6 +55,7 @@ name cv
from .out
to .cv
program {EM}/lib/{M}/cv
args < >
mapflag -F* CVFLAG=-F*
args {CVFLAG?} < >
outfile a.out
end

View file

@ -120,11 +120,27 @@ main(argc, argv)
long datasize ;
long bsssize;
long symstart;
long stacksize = 0x1000;
output = 1;
program= argv[0] ;
if ( argc>1 && argv[1][0]=='-' ) {
flag=argv[1][1] ;
if (argv[1][1] == 'F') {
register char *p = &argv[1][2];
stacksize = 0;
while (*p) {
stacksize <<= 4;
if (*p >= '0' && *p <= '9')
stacksize += *p - '0';
else if (*p >= 'a' && *p <= 'f')
stacksize += 10 + *p - 'a';
else if (*p >= 'A' && *p <= 'F')
stacksize += 10 + *p - 'A';
else fatal("Illegal -F option\n");
p++;
}
}
argc-- ; argv++ ;
}
switch (argc) {
@ -200,7 +216,7 @@ main(argc, argv)
if ( outsect[LSECT].os_size != 0 )
fatal("end segment must be empty\n") ;
}
ext.xe_stksize = 0x1000;
ext.xe_stksize = stacksize;
/* Not too big, because "brk" and "sbrk"-allocated memory resides
above the stack!
*/