faq regarding

Ivan Pulleyn ivan@torpid.com
Fri Sep 15 09:34:00 GMT 2000


Hi,

My apoligies if this is horribly off-topic or a total FAQ.

I'm trying to create an ld script for a mini-kernel for x86. I need
hints on how to control the format of the output. My current script
looks like this:

OUTPUT_FORMAT(binary);

SECTIONS
{
	.text : { *(.text) }
	.data : { *(.data) }
	.bss : { *(.bss) }
}

I found the "binary" output format using objdump -i, but I'm not
really sure it's correct. I want to avoid any kind of fixup at run
time and have the linker write out a image to disk that I can later
just load and run from the boot sector.

My current problem is that if I declare something like:

static int foo[0x10000];

GCC emits:

	.local	foo
	.comm	foo,262144,32

The resulting image produced by LD does not change in size. Does this
mean LD is emiting something I have to fixup before executing? BTW,
info says that the 3rd argument to .comm is ELF specific, is that
true?

Thanks in advance for your help!

Ivan...

---------------------------------------------------------------------------
			     Ivan Pulleyn
		      4942 N. Winchester Ave. #3
			  Chicago, IL 60640

			   ivan@torpid.com
			    (847) 980-1400
---------------------------------------------------------------------------



More information about the Binutils mailing list