Commit 2cac98fc authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Fix wrapping of modules into squeezed apps

When presented with a module, squeeze will squeeze it and tack on a header which does OS_Module 11 on it when unsqueezed.
However, the header size (bytes) was being added to a pointer (of type int) leading to the header being loaded 4x too high, overwriting the heap - size now adjusted.

Also remove the assumption that clock() counts in cs, so that the times come out right on a cross compiled Unix system.

Version 5.14. Tagged as 'squeeze-5_14'
parent 39c43225
/* (5.13) /* (5.14)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 5.13 #define Module_MajorVersion_CMHG 5.14
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 15 Jul 2013 #define Module_Date_CMHG 26 Mar 2015
#define Module_MajorVersion "5.13" #define Module_MajorVersion "5.14"
#define Module_Version 513 #define Module_Version 514
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "15 Jul 2013" #define Module_Date "26 Mar 2015"
#define Module_ApplicationDate "15-Jul-13" #define Module_ApplicationDate "26-Mar-15"
#define Module_ComponentName "squeeze" #define Module_ComponentName "squeeze"
#define Module_ComponentPath "castle/RiscOS/Tools/Sources/squeeze" #define Module_ComponentPath "castle/RiscOS/Tools/Sources/squeeze"
#define Module_FullVersion "5.13" #define Module_FullVersion "5.14"
#define Module_HelpVersion "5.13 (15 Jul 2013)" #define Module_HelpVersion "5.14 (26 Mar 2015)"
#define Module_LibraryVersionInfo "5:13" #define Module_LibraryVersionInfo "5:14"
...@@ -119,7 +119,8 @@ static clock_t lastticks; ...@@ -119,7 +119,8 @@ static clock_t lastticks;
static int ticks(void) static int ticks(void)
{ int last; { int last;
last = lastticks; lastticks = clock(); return(lastticks-last); last = lastticks; lastticks = clock();
return((100*(lastticks-last))/CLOCKS_PER_SEC);
} }
static int fileinfo(_kernel_osfile_block *info, const char *name) static int fileinfo(_kernel_osfile_block *info, const char *name)
...@@ -816,7 +817,7 @@ static int squeeze(char *in, char *out) ...@@ -816,7 +817,7 @@ static int squeeze(char *in, char *out)
top = ((char *)code) + size+8; top = ((char *)code) + size+8;
for (p = top-8; p < top; *p++ = 0); /* Clear the padding space */ for (p = top-8; p < top; *p++ = 0); /* Clear the padding space */
memcpy(code, &unsqueeze_base, header_size); memcpy(code, &unsqueeze_base, header_size);
load = code + header_size; load = code + (header_size / sizeof(word));
} else { } else {
code = xalloc(size+DATABYTES+8, "code"); /* Pad to even no of words */ code = xalloc(size+DATABYTES+8, "code"); /* Pad to even no of words */
d = (datahdr *)code; code += DATAWORDS; /* Space for data header */ d = (datahdr *)code; code += DATAWORDS; /* Space for data header */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment