section alignment problem (visual c++)

Programming, for all ages and all languages.
Post Reply
mordak
Posts: 6
Joined: Fri Aug 17, 2012 2:15 am

section alignment problem (visual c++)

Post by mordak »

hi!
i develop my kernel and now want to enable pagin for it.when i set section alignment
from 512 to 4096 size of kernel reduce from 9kb to 5kb and when browse it with hex editor its not page aligned and aligned as 1024
mordak
Posts: 6
Joined: Fri Aug 17, 2012 2:15 am

Re: section alignment problem (visual c++)

Post by mordak »

hi! :)
this answer that i found hopeful to useful
in visual stdio section alignment effect file alignment.
i quote its from [url]thishttp://www.catch22.net/tuts/reducing-executable-size[/url]
/Align
Specifies the alignment of each section in the executable, when it is mapped into memory. Has no relation to file-alignment (above), but an apparent bug in visual studio causes this option to also effect file-section alignment, as well as the intended image-section alignment, under certain circumstances
in this state you must set FileAlignment with Undocumented linker options
/FILEALIGN
Undocumented (VC 6 only). Specified the alignment of each section in the executable, as it is stored on disk
its work for me.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: section alignment problem (visual c++)

Post by JAAman »

what do you mean its undocumented?

the official visual studio reference:
http://msdn.microsoft.com/en-us/library ... 10%29.aspx


and seriously, quoting a document that considers VC6 to be the latest...even VC6's replacement's replacement's replacement has been replaced by now
Post Reply