> A coworker suggested the following code to handle the situation where the number of symbols is greater than 65535.
The number of symbols is not restricted to 65535, it's a 32-bit counter.
From the snipped you supplied I guess that you meant the linenumber count in the section header?
The problem with line numbers is that the counter in IMAGE_SECTION_HEADER is 16-bit only. I can't see how to "fix" this restriction - that's probably why MS "deprecated" COFF line number info and added it to CV8.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I noticed it takes Jwasm 43 secs to build a project while M$ takes 5 secs:
make.txt: 81 lines, 38 passes, 43832 ms, 0 warnings, 0 errors
Perhaps there's a way to speed things up? Is there an option that might increase speed?
Thanks.
> Perhaps there's a way to speed things up? Is there an option that might increase speed?
Not exactly. However, 38 passes for just 81 lines is an indication that there's something very strange going on.
In many cases, jwasm is faster than masm - but jwasm also has a few weak points, no doubt about that.
The project build is quite large and complex…it has 8 custom OBJs and 3 custom LIBs.
The company I work for is looking to replace MASM with JWASM. :)
Bug:
A coworker suggested the following code to handle the situation where the number of symbols is greater than 65535.
/* write COFF section table */
ret_code coff_write_section_table( struct module_info *modinfo )
…
/* set linenumber pos+count in section header */
if ( curr->e.seginfo->LinnumQueue ) {
ish.PointerToLinenumbers = offset;
//since ish.NumberOfLinenumbers=WORD can't be > 65535
//ish.NumberOfLinenumbers = GetLinnumItems( curr->e.seginfo->LinnumQueue );
//offset += ish.NumberOfLinenumbers * sizeof( IMAGE_LINENUMBER );
ish.NumberOfLinenumbers = 0;
offset += GetLinnumItems( curr->e.seginfo->LinnumQueue ) * sizeof( IMAGE_LINENUMBER );
} else {
ish.PointerToLinenumbers = 0;
ish.NumberOfLinenumbers = 0;
}
Nice work! Thanks.
> A coworker suggested the following code to handle the situation where the number of symbols is greater than 65535.
The number of symbols is not restricted to 65535, it's a 32-bit counter.
From the snipped you supplied I guess that you meant the linenumber count in the section header?
The problem with line numbers is that the counter in IMAGE_SECTION_HEADER is 16-bit only. I can't see how to "fix" this restriction - that's probably why MS "deprecated" COFF line number info and added it to CV8.
at least if the code were changed it wouldn't generate a corrupt OBJ
possible change
ret_code coff_write_section_table( struct module_info *modinfo )
/**************************************************************/
{
…
uint size_relocs = 0;
//added for LineNumber >65535 bug fix
uint NumberOfLinenumbers;
…
/* set linenumber pos+count in section header */
if ( curr->e.seginfo->LinnumQueue ) {
ish.PointerToLinenumbers = offset;
//since ish.NumberOfLinenumbers=WORD can't be > 65535
//original code
//ish.NumberOfLinenumbers = GetLinnumItems( curr->e.seginfo->LinnumQueue );
//offset += ish.NumberOfLinenumbers * sizeof( IMAGE_LINENUMBER );
NumberOfLinenumbers = GetLinnumItems( curr->e.seginfo->LinnumQueue );
offset += NumberOfLinenumbers * sizeof( IMAGE_LINENUMBER );
if ( NumberOfLinenumbers > 65535 ) ish.NumberOfLinenumbers = 65535;
else ish.NumberOfLinenumbers = NumberOfLinenumbers;
} else {
ish.PointerToLinenumbers = 0;
ish.NumberOfLinenumbers = 0;
}