Fix up armsrc/ldscript (create proper PHDRs, cleanup)

Now explicitly creates PHDRs (to avoid including e.g. ELF headers inside
the first PHDR)
This commit is contained in:
marcansoft 2010-02-26 14:03:21 +00:00
parent 98540684df
commit 98bf65a640

View file

@ -9,42 +9,60 @@
*/ */
INCLUDE ../common/ldscript.common INCLUDE ../common/ldscript.common
PHDRS
{
fpgaimage PT_LOAD FLAGS(4);
text PT_LOAD;
data PT_LOAD;
bss PT_LOAD;
}
ENTRY(Vector) ENTRY(Vector)
SECTIONS SECTIONS
{ {
.fpgaimage : { .fpgaimage : {
*(fpga_bit.data) *(fpga_bit.data)
} >fpgaimage } >fpgaimage :fpgaimage
.start : { *(.startos) } >osimage
.start : {
*(.startos)
} >osimage :text
.text : { .text : {
*(.text) *(.text)
*(.text.*) *(.text.*)
*(.eh_frame) *(.eh_frame)
*(.glue_7) *(.glue_7)
*(.glue_7t) *(.glue_7t)
} >osimage :text
.rodata : {
*(.rodata) *(.rodata)
*(.rodata*) *(.rodata*)
*(.version_information) *(.version_information)
} >osimage } >osimage :text
__end_of_text__ = .;
. = ALIGN(4);
.data : { .data : {
__data_start__ = .;
__data_src_start__ = __end_of_text__;
*(.data) *(.data)
*(.data.*) *(.data.*)
__data_end__ = .; . = ALIGN(4);
} >ram AT>osimage } >ram AT>osimage :data
__data_src_start__ = LOADADDR(.data);
__data_start__ = ADDR(.data);
__data_end__ = __data_start__ + SIZEOF(.data);
.bss : { .bss : {
__bss_start__ = .; __bss_start__ = .;
*(.bss) *(.bss)
*(.bss.*) *(.bss.*)
} >ram . = ALIGN(4);
. = ALIGN(32 / 8);
__bss_end__ = .; __bss_end__ = .;
} >ram :bss
.commonarea (NOLOAD) : { .commonarea (NOLOAD) : {
*(.commonarea) *(.commonarea)
} >commonarea } >commonarea :NONE
} }