New linkscript including stuff from supplied AArch64 scripts

This commit is contained in:
fincs 2017-09-20 19:52:16 +02:00
parent dff4704b6f
commit e31c140ca8

View File

@ -11,92 +11,99 @@ PHDRS
SECTIONS SECTIONS
{ {
/* =========== CODE section =========== */ /* =========== CODE section =========== */
PROVIDE(__start__ = 0x0); PROVIDE(__start__ = 0x0);
. = __start__; . = __start__;
.text ALIGN(0x1000) : .crt0 :
{ {
/* .init */
KEEP (*(.crt0)) KEEP (*(.crt0))
. = ALIGN(8);
} :code
.init :
{
KEEP( *(.init) ) KEEP( *(.init) )
. = ALIGN(4); . = ALIGN(8);
} :code
/* .text */ .plt :
*(.text) {
*(.text.*) *(.plt)
*(.glue_7) *(.iplt)
*(.glue_7t) . = ALIGN(8);
*(.stub) } :code
*(.gnu.warning)
*(.gnu.linkonce.t*)
. = ALIGN(4);
/* .fini */ .text :
{
*(.text.unlikely .text.*_unlikely .text.unlikely.*)
*(.text.exit .text.exit.*)
*(.text.startup .text.startup.*)
*(.text.hot .text.hot.*)
*(.text .stub .text.* .gnu.linkonce.t.*)
. = ALIGN(8);
} :code
.fini :
{
KEEP( *(.fini) ) KEEP( *(.fini) )
. = ALIGN(4); . = ALIGN(8);
} :code } :code
/* =========== RODATA section =========== */ /* =========== RODATA section =========== */
. = ALIGN(0x1000);
.rodata ALIGN(0x1000) : .rodata :
{ {
*(.rodata) *(.rodata .rodata.* .gnu.linkonce.r.*)
*(.roda) . = ALIGN(8);
*(.rodata.*)
*all.rodata*(*)
*(.gnu.linkonce.r*)
SORT(CONSTRUCTORS)
. = ALIGN(4);
} :rodata } :rodata
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } : rodata .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } :rodata
__exidx_start = .; .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } :rodata
ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } : rodata .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } :rodata
__exidx_end = .; .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } : rodata
.interp : { *(.interp) } :rodata
.note.gnu.build-id : { *(.note.gnu.build-id) } :rodata
.hash : { *(.hash) } :rodata
.gnu.hash : { *(.gnu.hash) } :rodata
.gnu.version : { *(.gnu.version) } :rodata
.gnu.version_d : { *(.gnu.version_d) } :rodata
.gnu.version_r : { *(.gnu.version_r) } :rodata
.dynsym : { *(.dynsym) } :rodata
.dynstr : { *(.dynstr) } :rodata
.rela.dyn : { *(.rela.*) } :rodata
/* =========== DATA section =========== */ /* =========== DATA section =========== */
. = ALIGN(0x1000);
.data ALIGN(0x1000) : .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) } :data
{ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } :data
*(.data) .gnu_extab : ONLY_IF_RW { *(.gnu_extab*) } : data
*(.data.*) .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } :data
*(.gnu.linkonce.d*)
CONSTRUCTORS
. = ALIGN(4);
__got_start__ = .;
*(.got)
__got_end__ = .;
} : data
.tdata ALIGN(8) :
.tdata ALIGN(4) :
{ {
__tdata_lma = .; __tdata_lma = .;
*(.tdata) *(.tdata .tdata.* .gnu.linkonce.td.*)
*(.tdata.*) . = ALIGN(8);
*(.gnu.linkonce.td.*)
. = ALIGN(4);
__tdata_lma_end = .; __tdata_lma_end = .;
} :data } :data
.tbss ALIGN(4) : .tbss ALIGN(8) :
{ {
*(.tbss) *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
*(.tbss.*) . = ALIGN(8);
*(.gnu.linkonce.tb.*)
*(.tcommon)
. = ALIGN(4);
} :data } :data
.preinit_array ALIGN(4) : .preinit_array ALIGN(8) :
{ {
PROVIDE (__preinit_array_start = .); PROVIDE (__preinit_array_start = .);
KEEP (*(.preinit_array)) KEEP (*(.preinit_array))
PROVIDE (__preinit_array_end = .); PROVIDE (__preinit_array_end = .);
} :data } :data
.init_array ALIGN(4) : .init_array ALIGN(8) :
{ {
PROVIDE (__init_array_start = .); PROVIDE (__init_array_start = .);
KEEP (*(SORT(.init_array.*))) KEEP (*(SORT(.init_array.*)))
@ -104,7 +111,7 @@ SECTIONS
PROVIDE (__init_array_end = .); PROVIDE (__init_array_end = .);
} :data } :data
.fini_array ALIGN(4) : .fini_array ALIGN(8) :
{ {
PROVIDE (__fini_array_start = .); PROVIDE (__fini_array_start = .);
KEEP (*(.fini_array)) KEEP (*(.fini_array))
@ -112,7 +119,7 @@ SECTIONS
PROVIDE (__fini_array_end = .); PROVIDE (__fini_array_end = .);
} :data } :data
.ctors ALIGN(4) : .ctors ALIGN(8) :
{ {
KEEP (*crtbegin.o(.ctors)) /* MUST be first -- GCC requires it */ KEEP (*crtbegin.o(.ctors)) /* MUST be first -- GCC requires it */
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
@ -120,7 +127,7 @@ SECTIONS
KEEP (*(.ctors)) KEEP (*(.ctors))
} :data } :data
.dtors ALIGN(4) : .dtors ALIGN(8) :
{ {
KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
@ -128,15 +135,31 @@ SECTIONS
KEEP (*(.dtors)) KEEP (*(.dtors))
} :data } :data
__got_start__ = .;
.got : { *(.got) *(.igot) } :data
.got.plt : { *(.got.plt) *(.igot.plt) } :data
__got_end__ = .;
.data ALIGN(8) :
{
*(.data .data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
} :data
.dynamic ALIGN(8) :
{
*(.dynamic)
} :data
__bss_start__ = .; __bss_start__ = .;
.bss ALIGN(4) : .bss ALIGN(8) :
{ {
*(.dynbss) *(.dynbss)
*(.bss) *(.bss .bss.* .gnu.linkonce.b.*)
*(.bss.*)
*(.gnu.linkonce.b*)
*(COMMON) *(COMMON)
. = ALIGN(4); . = ALIGN(8);
/* Reserve space for the TLS segment of the main thread */ /* Reserve space for the TLS segment of the main thread */
__tls_start = .; __tls_start = .;