How to using 'LD' to align on my AMD64?

[email protected]
Newsgroups gmane.comp.gnu.utils
Organization http://groups.google.com
Message-ID <[email protected]>
Hello,

On my AMD64 machine, I'd like to link my object file to a image,
the image is flat, code is from 0x0000, and contains debug symbol.

I wrote a ld script file, but the output file is over 1MB !!
(I guess because the align is 0x0100000, so the ELF header is from 0x0,
 the next program: .text is on 0x0100000)

So how to modify the ld script file?
Thanks in advance!!

This is my ld script file:

SECTIONS
{
. = 0x000000;

.text : { *(.text) }

. = ADDR(.text)+SIZEOF(.text);

.data : {*(.data)}

.rodata : {*(.rodata)}

.bss : {*(.bss)}

.eh_frame : {*(.eh_frame)}

 _edata = ADDR(.bss)+SIZEOF(.bss)+0x04000;

}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.