here is my linker script:
Code: Select all
SECTIONS
{
. = 0xFFFFFFFFC0000000;
/***************************************************************************
* This block contains the executable code, its information is used by the *
* program loader to allocate and setup executable read-only pages. *
***************************************************************************/
code_base = .;
.text :
{ *(.text*);
}
code_end = .;
. = ALIGN (0x1000); /* align on a 4 KiB page */
/***************************************************************************
* This block contains the non-changeable data, its information is used by *
* the program loader to allocate and setup non-executable read-only pages. *
***************************************************************************/
rodata_base = .;
.rodata :
{ *(.rdata*);
*(.rodata*);
ctors_base = ALIGN (0x08);
*(.ctors*);
ctors_end = ALIGN (0x08);
dtors_base = ALIGN (0x08);
*(.dtors*);
dtors_end = ALIGN (0x08);
}
rodata_end = .;
. = ALIGN (0x1000); /* align on a 4 KiB page */
/***************************************************************************
* This block contains the initialised data, its information is used by the *
* program loader to allocate and setup non-executable read-write pages. *
***************************************************************************/
rwinit_base = .;
.rwinit :
{ *(.data*);
*(.rwdata*);
}
rwinit_end = .;
/***************************************************************************
* This block contains the non-initialised data, its information is used by *
* the program loader to allocate and setup non-executable read-write pages.*
***************************************************************************/
rwdata_base = .;
.rwdata :
{ bss_base = ALIGN (0x08);
*(.bss*);
bss_end = ALIGN (0x08);
*(COMMON*);
}
rwdata_end = ALIGN (0x10); /* align on a realmode segment boundry */
/DISCARD/ : { *(.comment .note .eh_frame) }
}
Oh yeah it all gcc++ based .