Hi Pelle,
There is a bug (I suppose) in the linker using the /ALIGN option. Setting a value of 512 the first section of the PE executable (usually .text) is always aligned on a page boundary (4096 bytes), the RVA of first section is always 0x1000, the following sections are aligned on the correct boundary (i.e. .data @ 0x1200, .rdata @ 0x1400, etc).
This option enable the use of your compiler to produce an executable with file/memory sections alignment wich allows direct loading as kernel modules loaded from bootstrap code.
Using the Microsoft linker I obtain the correct alignment, but with a limitation in the maximum base address (MSLINK : fatal error LNK1249: image exceeds maximum extent with base address FFFFFF0000000 and size 0x1000) that your linker doesn't have.
Please could you correct this and, if you think this could be of any use, add another switch to choose file alignment (i.e. file sections layout aligned on a boundary other than 512). The last could be used for the reverse adjustment so file layout is the same as memory layout on page boundary.
Thank for your support and your compiling system
Regards
F.