update linker scripts

git-svn-id: svn://kolibrios.org@6529 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2016-09-22 10:46:28 +00:00
parent d9edf80214
commit 1a080f99fa
4 changed files with 148 additions and 5 deletions

View File

@ -0,0 +1,138 @@
/*OUTPUT_FORMAT("binary")*/
SEARCH_DIR("=/lib")
SEARCH_DIR("=/mingw32/lib")
ENTRY(__start)
SECTIONS
{
.text 0x000000:
{
LONG(0x554e454D);
LONG(0x32305445);
LONG(1);
LONG(__start);
LONG(___iend);
LONG(___memsize);
LONG(___stacktop);
LONG(___cmdline);
LONG(___pgmname); /* full path */
LONG(__subsystem__);
LONG(__idata_start)
LONG(__idata_end)
LONG(_main)
*(.init)
*(.text)
*(SORT(.text$*))
*(.text.*)
*(.glue_7t)
*(.glue_7)
___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*)); LONG (0);
___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*)); LONG (0);
*(.fini)
/* ??? Why is .gcc_exc here? */
*(.gcc_exc)
PROVIDE (etext = .);
*(.gcc_except_table)
}
.rdata ALIGN(16) :
{
*(.rdata)
*(SORT(.rdata$*))
___RUNTIME_PSEUDO_RELOC_LIST__ = .;
__RUNTIME_PSEUDO_RELOC_LIST__ = .;
*(.rdata_runtime_pseudo_reloc)
___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
}
.CRT ALIGN(16) :
{
___crt_xc_start__ = . ;
*(SORT(.CRT$XC*)) /* C initialization */
___crt_xc_end__ = . ;
___crt_xi_start__ = . ;
*(SORT(.CRT$XI*)) /* C++ initialization */
___crt_xi_end__ = . ;
___crt_xl_start__ = . ;
*(SORT(.CRT$XL*)) /* TLS callbacks */
/* ___crt_xl_end__ is defined in the TLS Directory support code */
___crt_xp_start__ = . ;
*(SORT(.CRT$XP*)) /* Pre-termination */
___crt_xp_end__ = . ;
___crt_xt_start__ = . ;
*(SORT(.CRT$XT*)) /* Termination */
___crt_xt_end__ = . ;
}
.data ALIGN(16) :
{
PROVIDE ( __data_start__ = .) ;
*(.data)
*(.data2)
*(SORT(.data$*))
*(.jcr)
__CRT_MT = .;
LONG(1);
PROVIDE ( __data_end__ = .) ;
*(.data_cygwin_nocopy)
___iend = . ;
}
.eh_frame BLOCK(16) :
{
PROVIDE (___EH_FRAME_BEGIN__ = .) ;
*(.eh_frame*)
___FRAME_END__ = . ;
LONG(0);
}
.idata ALIGN(16):
{
__idata_start = .;
SORT(*)(.idata$2)
SORT(*)(.idata$3)
/* These zeroes mark the end of the import list. */
LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
SORT(*)(.idata$4)
SORT(*)(.idata$5)
SORT(*)(.idata$6)
SORT(*)(.idata$7)
__idata_end = . ;
}
bss ALIGN(16):
{
*(.bss)
*(COMMON)
. = ALIGN(16);
___cmdline = .;
. = . + 256;
___pgmname = .;
. = . + 1024 + 16;
___stacktop = .;
___memsize = . ;
}
/DISCARD/ :
{
*(.debug$S)
*(.debug$T)
*(.debug$F)
*(.drectve)
*(.note.GNU-stack)
*(.comment)
/* *(.eh_frame) */
*(.debug_abbrev)
*(.debug_info)
*(.debug_line)
*(.debug_frame)
*(.debug_loc)
*(.debug_pubnames)
*(.debug_aranges)
*(.debug_ranges)
}
}

View File

@ -1,5 +1,6 @@
/*OUTPUT_FORMAT("binary")*/ /*OUTPUT_FORMAT("binary")*/
SEARCH_DIR("=/mingw32/lib")
SEARCH_DIR("=/lib")
ENTRY(__start) ENTRY(__start)
SECTIONS SECTIONS
{ {
@ -73,7 +74,7 @@ SECTIONS
*(SORT(.data$*)) *(SORT(.data$*))
*(.jcr) *(.jcr)
__CRT_MT = .; __CRT_MT = .;
LONG(0); LONG(1);
PROVIDE ( __data_end__ = .) ; PROVIDE ( __data_end__ = .) ;
*(.data_cygwin_nocopy) *(.data_cygwin_nocopy)
___iend = . ; ___iend = . ;
@ -83,6 +84,8 @@ SECTIONS
{ {
PROVIDE (___EH_FRAME_BEGIN__ = .) ; PROVIDE (___EH_FRAME_BEGIN__ = .) ;
*(.eh_frame*) *(.eh_frame*)
___FRAME_END__ = . ;
LONG(0);
} }
.idata ALIGN(16): .idata ALIGN(16):
@ -120,6 +123,7 @@ SECTIONS
*(.drectve) *(.drectve)
*(.note.GNU-stack) *(.note.GNU-stack)
*(.comment) *(.comment)
/* *(.eh_frame) */
*(.debug_abbrev) *(.debug_abbrev)
*(.debug_info) *(.debug_info)
*(.debug_line) *(.debug_line)
@ -131,3 +135,4 @@ SECTIONS
} }
} }

View File

@ -60,7 +60,7 @@ SECTIONS
*(SORT(.data$*)) *(SORT(.data$*))
*(.jcr) *(.jcr)
__CRT_MT = .; __CRT_MT = .;
LONG(0); LONG(1);
PROVIDE ( __data_end__ = .) ; PROVIDE ( __data_end__ = .) ;
*(.data_cygwin_nocopy) *(.data_cygwin_nocopy)
} }

View File

@ -70,7 +70,7 @@ SECTIONS
*(SORT(.data$*)) *(SORT(.data$*))
*(.jcr) *(.jcr)
__CRT_MT = .; __CRT_MT = .;
LONG(0); LONG(1);
PROVIDE ( __data_end__ = .) ; PROVIDE ( __data_end__ = .) ;
*(.data_cygwin_nocopy) *(.data_cygwin_nocopy)
___iend = . ; ___iend = . ;