Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I am trying to build dummy executables to test my loader. I can get 32-bit executables to link with the specified text segment start address, but 64-bit ones always seem to be linked with a text segment start address of 0, with the specified address only affecting the start of the text section within the segment rather than the start of the segment itself (i.e. there is a large amount of padding between the ELF header and the start of the text section). How do I prevent the text segment from being padded to start at 0 (and why does this only happen to 64-bit executables)?
Here is the linker script that I am using (the only difference between 32- and 64-bit versions are the OUTPUT_FORMAT and OUTPUT_ARCH lines). It is based on the libpayload linker script from coreboot. I am building my executables with GNU ld on Linux.