Linking to the elf32-i386 format using the following linker script gives me an error "non constant expression for load base". Changing the OUTPUT_FORMAT to binary however makes the script work fine. Here is the linker script used. OUTPUT_FORMAT("elf32-i386") ENTRY(start) FourKB = 0x1000; physical = 0x100000; /* 1 meg */ virtual = 0xC0000000; /* 3 gig */ SECTIONS { . = physical; .setup : { *(.setup) } . += virtual; .text : AT( ADDR(.text) - virtual ) { *(.text) *(.rodata*) } . = ALIGN(FourKB); .data : AT( LOADADDR(.text) + SIZEOF(.text) ) { start_ctors = .; *(.ctors*) end_ctors = .; start_dtors = .; *(.dtors) end_dtors = .; *(.data) } . = ALIGN(FourKB); .bss : AT( LOADADDR(.data) + SIZEOF(.data) ) { *(.bss) *(COMMON) } . = ALIGN(FourKB); }
Please try a recent binutils, either current mainline, 2.17 branch, or one of HJ Lu's releases. I think you'll find that this has been fixed.