I have recently built a cross-compiler from Llinux to my OS, with the canonical name i686-pc-glider.
It produces executables for my OS almost perfectly. The loading address is as it should be (0x00601000). However, there are 2 program headers, and the second one seems to not be aligned properly:
Code: Select all
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0x00601000 0x00601000 0x01138 0x01138 R E 0x1000
LOAD 0x001138 0x00603138 0x00603138 0x00018 0x0003c RW 0x1000
If I am actually loading the executable correctly, but the linker is produceing broken executables, how do I modify the source code of ld to make sure that the second program header's VirtAddr is aligned on a page boundary?
Thank you.