From 6d29ad44f751a6fc9495491faa36611ed72bbc91 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 30 Aug 2015 15:25:44 +0000 Subject: [PATCH] * always use a minimal linker script when we are not using -T, so that the chance of conflicts with the built-in linkerscript is minimised o removed special case for AArch64 which that already o check the diff without whitespace changes, most is indentation git-svn-id: trunk@31459 - --- compiler/systems/t_linux.pas | 930 +++++++++++++++++------------------ 1 file changed, 464 insertions(+), 466 deletions(-) diff --git a/compiler/systems/t_linux.pas b/compiler/systems/t_linux.pas index 6c30f869e5..b9fd3f31eb 100644 --- a/compiler/systems/t_linux.pas +++ b/compiler/systems/t_linux.pas @@ -598,161 +598,159 @@ begin else add('ENTRY(_start)'); -{$ifdef x86_64} -{$define LINKERSCRIPT_INCLUDED} - add('SECTIONS'); - add('{'); - {Read-only sections, merged into text segment:} - if current_module.islibrary then - add(' . = 0 + SIZEOF_HEADERS;') - else - add(' PROVIDE (__executable_start = 0x0400000); . = 0x0400000 + SIZEOF_HEADERS;'); - add(' . = 0 + SIZEOF_HEADERS;'); - add(' .interp : { *(.interp) }'); - add(' .hash : { *(.hash) }'); - add(' .dynsym : { *(.dynsym) }'); - add(' .dynstr : { *(.dynstr) }'); - add(' .gnu.version : { *(.gnu.version) }'); - add(' .gnu.version_d : { *(.gnu.version_d) }'); - add(' .gnu.version_r : { *(.gnu.version_r) }'); - add(' .rel.dyn :'); - add(' {'); - add(' *(.rel.init)'); - add(' *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)'); - add(' *(.rel.fini)'); - add(' *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)'); - add(' *(.rel.data.rel.ro*)'); - add(' *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)'); - add(' *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)'); - add(' *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)'); - add(' *(.rel.got)'); - add(' *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)'); - add(' }'); - add(' .rela.dyn :'); - add(' {'); - add(' *(.rela.init)'); - add(' *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)'); - add(' *(.rela.fini)'); - add(' *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)'); - add(' *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)'); - add(' *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)'); - add(' *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)'); - add(' *(.rela.got)'); - add(' *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)'); - add(' }'); - add(' .rel.plt : { *(.rel.plt) }'); - add(' .rela.plt : { *(.rela.plt) }'); - add(' .init :'); - add(' {'); - add(' KEEP (*(.init))'); - add(' } =0x90909090'); - add(' .plt : { *(.plt) }'); - add(' .text :'); - add(' {'); - add(' *(.text .stub .text.* .gnu.linkonce.t.*)'); - add(' KEEP (*(.text.*personality*))'); - {.gnu.warning sections are handled specially by elf32.em.} - add(' *(.gnu.warning)'); - add(' } =0x90909090'); - add(' .fini :'); - add(' {'); - add(' KEEP (*(.fini))'); - add(' } =0x90909090'); - add(' PROVIDE (_etext = .);'); - add(' .rodata :'); - add(' {'); - add(' *(.rodata .rodata.* .gnu.linkonce.r.*)'); - add(' }'); - {Adjust the address for the data segment. We want to adjust up to - the same address within the page on the next page up.} - add(' . = ALIGN (0x1000) - ((0x1000 - .) & (0x1000 - 1));'); - add(' .dynamic : { *(.dynamic) }'); - add(' .got : { *(.got .toc) }'); - add(' .got.plt : { *(.got.plt .toc.plt) }'); - add(' .data :'); - add(' {'); - add(' *(.data .data.* .gnu.linkonce.d.*)'); - add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))'); - add(' KEEP (*(.gnu.linkonce.d.*personality*))'); - add(' }'); - add(' PROVIDE (_edata = .);'); - add(' PROVIDE (edata = .);'); - {$ifdef zsegment_threadvars} - add(' _z = .;'); - add(' .threadvar 0 : AT (_z) { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }'); - add(' PROVIDE (_threadvar_size = SIZEOF(.threadvar));'); - add(' . = _z + SIZEOF (.threadvar);'); - {$else} - add(' .threadvar : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }'); - {$endif} - add(' __bss_start = .;'); - add(' .bss :'); - add(' {'); - add(' *(.dynbss)'); - add(' *(.bss .bss.* .gnu.linkonce.b.*)'); - add(' *(COMMON)'); - {Align here to ensure that the .bss section occupies space up to - _end. Align after .bss to ensure correct alignment even if the - .bss section disappears because there are no input sections.} - add(' . = ALIGN(32 / 8);'); - add('}'); - add(' . = ALIGN(32 / 8);'); - add(' PROVIDE (_end = .);'); - add(' PROVIDE (end = .);'); - {Stabs debugging sections.} - add(' .stab 0 : { *(.stab) }'); - add(' .stabstr 0 : { *(.stabstr) }'); - add(' /* DWARF debug sections.'); - add(' Symbols in the DWARF debugging sections are relative to the beginning'); - add(' of the section so we begin them at 0. */'); - add(' /* DWARF 1 */'); - add(' .debug 0 : { *(.debug) }'); - add(' .line 0 : { *(.line) }'); - add(' /* GNU DWARF 1 extensions */'); - add(' .debug_srcinfo 0 : { *(.debug_srcinfo) }'); - add(' .debug_sfnames 0 : { *(.debug_sfnames) }'); - add(' /* DWARF 1.1 and DWARF 2 */'); - add(' .debug_aranges 0 : { *(.debug_aranges) }'); - add(' .debug_pubnames 0 : { *(.debug_pubnames) }'); - add(' /* DWARF 2 */'); - add(' .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }'); - add(' .debug_abbrev 0 : { *(.debug_abbrev) }'); - add(' .debug_line 0 : { *(.debug_line) }'); - add(' .debug_frame 0 : { *(.debug_frame) }'); - add(' .debug_str 0 : { *(.debug_str) }'); - add(' .debug_loc 0 : { *(.debug_loc) }'); - add(' .debug_macinfo 0 : { *(.debug_macinfo) }'); - add(' /* SGI/MIPS DWARF 2 extensions */'); - add(' .debug_weaknames 0 : { *(.debug_weaknames) }'); - add(' .debug_funcnames 0 : { *(.debug_funcnames) }'); - add(' .debug_typenames 0 : { *(.debug_typenames) }'); - add(' .debug_varnames 0 : { *(.debug_varnames) }'); - add(' /DISCARD/ : { *(.note.GNU-stack) }'); - add('}'); -{$endif x86_64} - -{$ifdef AArch64} -{$define LINKERSCRIPT_INCLUDED} + { If we are using the default sysroot, use the default linker script and + just augment it with the FPC-specific parts. Ideally, we should add + "INSERT AFTER" at the end to explicitly tell ld to just augment the + built-in linker script, but that's only supported by ld 2.19 and later. + } if sysrootpath='' then begin - { On other architectures, supplying a complete linker script - without the -T option just results in: - warning: link.res contains output sections; did you forget -T? - However, with a recent aarch64 linker the result is: - /usr/bin/ld: internal error ../../ld/ldlang.c 5221 - So in these cases, where -T will not be used, we supply a - minimal linker script with just the FPC-specific part: } add('SECTIONS'); add('{'); add(' .data :'); add(' {'); - { extra by FPC } add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))'); add(' }'); + add(' .threadvar _edata: { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }'); add('}'); end else begin +{$ifdef x86_64} +{$define LINKERSCRIPT_INCLUDED} + add('SECTIONS'); + add('{'); + {Read-only sections, merged into text segment:} + if current_module.islibrary then + add(' . = 0 + SIZEOF_HEADERS;') + else + add(' PROVIDE (__executable_start = 0x0400000); . = 0x0400000 + SIZEOF_HEADERS;'); + add(' . = 0 + SIZEOF_HEADERS;'); + add(' .interp : { *(.interp) }'); + add(' .hash : { *(.hash) }'); + add(' .dynsym : { *(.dynsym) }'); + add(' .dynstr : { *(.dynstr) }'); + add(' .gnu.version : { *(.gnu.version) }'); + add(' .gnu.version_d : { *(.gnu.version_d) }'); + add(' .gnu.version_r : { *(.gnu.version_r) }'); + add(' .rel.dyn :'); + add(' {'); + add(' *(.rel.init)'); + add(' *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)'); + add(' *(.rel.fini)'); + add(' *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)'); + add(' *(.rel.data.rel.ro*)'); + add(' *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)'); + add(' *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)'); + add(' *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)'); + add(' *(.rel.got)'); + add(' *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)'); + add(' }'); + add(' .rela.dyn :'); + add(' {'); + add(' *(.rela.init)'); + add(' *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)'); + add(' *(.rela.fini)'); + add(' *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)'); + add(' *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)'); + add(' *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)'); + add(' *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)'); + add(' *(.rela.got)'); + add(' *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)'); + add(' }'); + add(' .rel.plt : { *(.rel.plt) }'); + add(' .rela.plt : { *(.rela.plt) }'); + add(' .init :'); + add(' {'); + add(' KEEP (*(.init))'); + add(' } =0x90909090'); + add(' .plt : { *(.plt) }'); + add(' .text :'); + add(' {'); + add(' *(.text .stub .text.* .gnu.linkonce.t.*)'); + add(' KEEP (*(.text.*personality*))'); + {.gnu.warning sections are handled specially by elf32.em.} + add(' *(.gnu.warning)'); + add(' } =0x90909090'); + add(' .fini :'); + add(' {'); + add(' KEEP (*(.fini))'); + add(' } =0x90909090'); + add(' PROVIDE (_etext = .);'); + add(' .rodata :'); + add(' {'); + add(' *(.rodata .rodata.* .gnu.linkonce.r.*)'); + add(' }'); + {Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up.} + add(' . = ALIGN (0x1000) - ((0x1000 - .) & (0x1000 - 1));'); + add(' .dynamic : { *(.dynamic) }'); + add(' .got : { *(.got .toc) }'); + add(' .got.plt : { *(.got.plt .toc.plt) }'); + add(' .data :'); + add(' {'); + add(' *(.data .data.* .gnu.linkonce.d.*)'); + add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))'); + add(' KEEP (*(.gnu.linkonce.d.*personality*))'); + add(' }'); + add(' PROVIDE (_edata = .);'); + add(' PROVIDE (edata = .);'); + {$ifdef zsegment_threadvars} + add(' _z = .;'); + add(' .threadvar 0 : AT (_z) { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }'); + add(' PROVIDE (_threadvar_size = SIZEOF(.threadvar));'); + add(' . = _z + SIZEOF (.threadvar);'); + {$else} + add(' .threadvar : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }'); + {$endif} + add(' __bss_start = .;'); + add(' .bss :'); + add(' {'); + add(' *(.dynbss)'); + add(' *(.bss .bss.* .gnu.linkonce.b.*)'); + add(' *(COMMON)'); + {Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections.} + add(' . = ALIGN(32 / 8);'); + add('}'); + add(' . = ALIGN(32 / 8);'); + add(' PROVIDE (_end = .);'); + add(' PROVIDE (end = .);'); + {Stabs debugging sections.} + add(' .stab 0 : { *(.stab) }'); + add(' .stabstr 0 : { *(.stabstr) }'); + add(' /* DWARF debug sections.'); + add(' Symbols in the DWARF debugging sections are relative to the beginning'); + add(' of the section so we begin them at 0. */'); + add(' /* DWARF 1 */'); + add(' .debug 0 : { *(.debug) }'); + add(' .line 0 : { *(.line) }'); + add(' /* GNU DWARF 1 extensions */'); + add(' .debug_srcinfo 0 : { *(.debug_srcinfo) }'); + add(' .debug_sfnames 0 : { *(.debug_sfnames) }'); + add(' /* DWARF 1.1 and DWARF 2 */'); + add(' .debug_aranges 0 : { *(.debug_aranges) }'); + add(' .debug_pubnames 0 : { *(.debug_pubnames) }'); + add(' /* DWARF 2 */'); + add(' .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }'); + add(' .debug_abbrev 0 : { *(.debug_abbrev) }'); + add(' .debug_line 0 : { *(.debug_line) }'); + add(' .debug_frame 0 : { *(.debug_frame) }'); + add(' .debug_str 0 : { *(.debug_str) }'); + add(' .debug_loc 0 : { *(.debug_loc) }'); + add(' .debug_macinfo 0 : { *(.debug_macinfo) }'); + add(' /* SGI/MIPS DWARF 2 extensions */'); + add(' .debug_weaknames 0 : { *(.debug_weaknames) }'); + add(' .debug_funcnames 0 : { *(.debug_funcnames) }'); + add(' .debug_typenames 0 : { *(.debug_typenames) }'); + add(' .debug_varnames 0 : { *(.debug_varnames) }'); + add(' /DISCARD/ : { *(.note.GNU-stack) }'); + add('}'); +{$endif x86_64} + +{$ifdef AArch64} +{$define LINKERSCRIPT_INCLUDED} { Complete linker script for aarch64-linux: } add('SECTIONS'); add('{'); @@ -961,338 +959,338 @@ begin add(' .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'); add(' /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }'); add('}'); - end; {$endif AArch64} {$ifdef ARM} - if target_info.abi in [abi_eabi,abi_eabihf] then - begin - { from GNU ld (CodeSourcery Sourcery G++ Lite 2007q3-53) 2.18.50.20070820 } - add('/* Script for -z combreloc: combine and sort reloc sections */'); - add('OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",'); - add(' "elf32-littlearm")'); - add('OUTPUT_ARCH(arm)'); - add('SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");'); - add('SECTIONS'); - add('{'); - add(' /* Read-only sections, merged into text segment: */'); - add(' PROVIDE (__executable_start = 0x8000); . = 0x8000 + SIZEOF_HEADERS;'); - add(' .interp : { *(.interp) }'); - add(' .note.gnu.build-id : { *(.note.gnu.build-id) }'); - add(' .hash : { *(.hash) }'); - add(' .gnu.hash : { *(.gnu.hash) }'); - add(' .dynsym : { *(.dynsym) }'); - add(' .dynstr : { *(.dynstr) }'); - add(' .gnu.version : { *(.gnu.version) }'); - add(' .gnu.version_d : { *(.gnu.version_d) }'); - add(' .gnu.version_r : { *(.gnu.version_r) }'); - add(' .rel.dyn :'); - add(' {'); - add(' *(.rel.init)'); - add(' *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)'); - add(' *(.rel.fini)'); - add(' *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)'); - add(' *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)'); - add(' *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)'); - add(' *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)'); - add(' *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)'); - add(' *(.rel.ctors)'); - add(' *(.rel.dtors)'); - add(' *(.rel.got)'); - add(' *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)'); - add(' }'); - add(' .rela.dyn :'); - add(' {'); - add(' *(.rela.init)'); - add(' *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)'); - add(' *(.rela.fini)'); - add(' *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)'); - add(' *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)'); - add(' *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)'); - add(' *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)'); - add(' *(.rela.ctors)'); - add(' *(.rela.dtors)'); - add(' *(.rela.got)'); - add(' *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)'); - add(' }'); - add(' .rel.plt : { *(.rel.plt) }'); - add(' .rela.plt : { *(.rela.plt) }'); - add(' .init :'); - add(' {'); - add(' KEEP (*(.init))'); - add(' } =0'); - add(' .plt : { *(.plt) }'); - add(' .text :'); - add(' {'); - add(' *(.text .stub .text.* .gnu.linkonce.t.*)'); - add(' KEEP (*(.text.*personality*))'); - add(' /* .gnu.warning sections are handled specially by elf32.em. */'); - add(' *(.gnu.warning)'); - add(' *(.glue_7t) *(.glue_7) *(.vfp11_veneer)'); - add(' } =0'); - add(' .fini :'); - add(' {'); - add(' KEEP (*(.fini))'); - add(' } =0'); - add(' PROVIDE (__etext = .);'); - add(' PROVIDE (_etext = .);'); - add(' PROVIDE (etext = .);'); - add(' .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }'); - add(' .rodata1 : { *(.rodata1) }'); - add(' .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) }'); - add(' __exidx_start = .;'); - add(' .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }'); - add(' __exidx_end = .;'); - add(' .eh_frame_hdr : { *(.eh_frame_hdr) }'); - add(' .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }'); - add(' .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }'); - add(' /* Adjust the address for the data segment. We want to adjust up to'); - add(' the same address within the page on the next page up. */'); - add(' . = ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1));'); - add(' /* Exception handling */'); - add(' .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }'); - add(' .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }'); - add(' /* Thread Local Storage sections */'); - add(' .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }'); - add(' .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }'); - add(' .preinit_array :'); - add(' {'); - add(' PROVIDE_HIDDEN (__preinit_array_start = .);'); - add(' KEEP (*(.preinit_array))'); - add(' PROVIDE_HIDDEN (__preinit_array_end = .);'); - add(' }'); - add(' .init_array :'); - add(' {'); - add(' PROVIDE_HIDDEN (__init_array_start = .);'); - add(' KEEP (*(SORT(.init_array.*)))'); - add(' KEEP (*(.init_array))'); - add(' PROVIDE_HIDDEN (__init_array_end = .);'); - add(' }'); - add(' .fini_array :'); - add(' {'); - add(' PROVIDE_HIDDEN (__fini_array_start = .);'); - add(' KEEP (*(.fini_array))'); - add(' KEEP (*(SORT(.fini_array.*)))'); - add(' PROVIDE_HIDDEN (__fini_array_end = .);'); - add(' }'); - add(' .ctors :'); - add(' {'); - add(' /* gcc uses crtbegin.o to find the start of'); - add(' the constructors, so we make sure it is'); - add(' first. Because this is a wildcard, it'); - add(' doesn''t matter if the user does not'); - add(' actually link against crtbegin.o; the'); - add(' linker won''t look for a file to match a'); - add(' wildcard. The wildcard also means that it'); - add(' doesn''t matter which directory crtbegin.o'); - add(' is in. */'); - add(' KEEP (*crtbegin.o(.ctors))'); - add(' KEEP (*crtbegin?.o(.ctors))'); - add(' /* We don''t want to include the .ctor section from'); - add(' the crtend.o file until after the sorted ctors.'); - add(' The .ctor section from the crtend file contains the'); - add(' end of ctors marker and it must be last */'); - add(' KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))'); - add(' KEEP (*(SORT(.ctors.*)))'); - add(' KEEP (*(.ctors))'); - add(' }'); - add(' .dtors :'); - add(' {'); - add(' KEEP (*crtbegin.o(.dtors))'); - add(' KEEP (*crtbegin?.o(.dtors))'); - add(' KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))'); - add(' KEEP (*(SORT(.dtors.*)))'); - add(' KEEP (*(.dtors))'); - add(' }'); - add(' .jcr : { KEEP (*(.jcr)) }'); - add(' .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }'); - add(' .dynamic : { *(.dynamic) }'); - add(' .got : { *(.got.plt) *(.got) }'); - add(' .data :'); - add(' {'); - add(' __data_start = . ;'); - add(' *(.data .data.* .gnu.linkonce.d.*)'); + if target_info.abi in [abi_eabi,abi_eabihf] then + begin + { from GNU ld (CodeSourcery Sourcery G++ Lite 2007q3-53) 2.18.50.20070820 } + add('/* Script for -z combreloc: combine and sort reloc sections */'); + add('OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",'); + add(' "elf32-littlearm")'); + add('OUTPUT_ARCH(arm)'); + add('SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");'); + add('SECTIONS'); + add('{'); + add(' /* Read-only sections, merged into text segment: */'); + add(' PROVIDE (__executable_start = 0x8000); . = 0x8000 + SIZEOF_HEADERS;'); + add(' .interp : { *(.interp) }'); + add(' .note.gnu.build-id : { *(.note.gnu.build-id) }'); + add(' .hash : { *(.hash) }'); + add(' .gnu.hash : { *(.gnu.hash) }'); + add(' .dynsym : { *(.dynsym) }'); + add(' .dynstr : { *(.dynstr) }'); + add(' .gnu.version : { *(.gnu.version) }'); + add(' .gnu.version_d : { *(.gnu.version_d) }'); + add(' .gnu.version_r : { *(.gnu.version_r) }'); + add(' .rel.dyn :'); + add(' {'); + add(' *(.rel.init)'); + add(' *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)'); + add(' *(.rel.fini)'); + add(' *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)'); + add(' *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)'); + add(' *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)'); + add(' *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)'); + add(' *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)'); + add(' *(.rel.ctors)'); + add(' *(.rel.dtors)'); + add(' *(.rel.got)'); + add(' *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)'); + add(' }'); + add(' .rela.dyn :'); + add(' {'); + add(' *(.rela.init)'); + add(' *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)'); + add(' *(.rela.fini)'); + add(' *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)'); + add(' *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)'); + add(' *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)'); + add(' *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)'); + add(' *(.rela.ctors)'); + add(' *(.rela.dtors)'); + add(' *(.rela.got)'); + add(' *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)'); + add(' }'); + add(' .rel.plt : { *(.rel.plt) }'); + add(' .rela.plt : { *(.rela.plt) }'); + add(' .init :'); + add(' {'); + add(' KEEP (*(.init))'); + add(' } =0'); + add(' .plt : { *(.plt) }'); + add(' .text :'); + add(' {'); + add(' *(.text .stub .text.* .gnu.linkonce.t.*)'); + add(' KEEP (*(.text.*personality*))'); + add(' /* .gnu.warning sections are handled specially by elf32.em. */'); + add(' *(.gnu.warning)'); + add(' *(.glue_7t) *(.glue_7) *(.vfp11_veneer)'); + add(' } =0'); + add(' .fini :'); + add(' {'); + add(' KEEP (*(.fini))'); + add(' } =0'); + add(' PROVIDE (__etext = .);'); + add(' PROVIDE (_etext = .);'); + add(' PROVIDE (etext = .);'); + add(' .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }'); + add(' .rodata1 : { *(.rodata1) }'); + add(' .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) }'); + add(' __exidx_start = .;'); + add(' .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }'); + add(' __exidx_end = .;'); + add(' .eh_frame_hdr : { *(.eh_frame_hdr) }'); + add(' .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }'); + add(' .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }'); + add(' /* Adjust the address for the data segment. We want to adjust up to'); + add(' the same address within the page on the next page up. */'); + add(' . = ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1));'); + add(' /* Exception handling */'); + add(' .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }'); + add(' .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }'); + add(' /* Thread Local Storage sections */'); + add(' .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }'); + add(' .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }'); + add(' .preinit_array :'); + add(' {'); + add(' PROVIDE_HIDDEN (__preinit_array_start = .);'); + add(' KEEP (*(.preinit_array))'); + add(' PROVIDE_HIDDEN (__preinit_array_end = .);'); + add(' }'); + add(' .init_array :'); + add(' {'); + add(' PROVIDE_HIDDEN (__init_array_start = .);'); + add(' KEEP (*(SORT(.init_array.*)))'); + add(' KEEP (*(.init_array))'); + add(' PROVIDE_HIDDEN (__init_array_end = .);'); + add(' }'); + add(' .fini_array :'); + add(' {'); + add(' PROVIDE_HIDDEN (__fini_array_start = .);'); + add(' KEEP (*(.fini_array))'); + add(' KEEP (*(SORT(.fini_array.*)))'); + add(' PROVIDE_HIDDEN (__fini_array_end = .);'); + add(' }'); + add(' .ctors :'); + add(' {'); + add(' /* gcc uses crtbegin.o to find the start of'); + add(' the constructors, so we make sure it is'); + add(' first. Because this is a wildcard, it'); + add(' doesn''t matter if the user does not'); + add(' actually link against crtbegin.o; the'); + add(' linker won''t look for a file to match a'); + add(' wildcard. The wildcard also means that it'); + add(' doesn''t matter which directory crtbegin.o'); + add(' is in. */'); + add(' KEEP (*crtbegin.o(.ctors))'); + add(' KEEP (*crtbegin?.o(.ctors))'); + add(' /* We don''t want to include the .ctor section from'); + add(' the crtend.o file until after the sorted ctors.'); + add(' The .ctor section from the crtend file contains the'); + add(' end of ctors marker and it must be last */'); + add(' KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))'); + add(' KEEP (*(SORT(.ctors.*)))'); + add(' KEEP (*(.ctors))'); + add(' }'); + add(' .dtors :'); + add(' {'); + add(' KEEP (*crtbegin.o(.dtors))'); + add(' KEEP (*crtbegin?.o(.dtors))'); + add(' KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))'); + add(' KEEP (*(SORT(.dtors.*)))'); + add(' KEEP (*(.dtors))'); + add(' }'); + add(' .jcr : { KEEP (*(.jcr)) }'); + add(' .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }'); + add(' .dynamic : { *(.dynamic) }'); + add(' .got : { *(.got.plt) *(.got) }'); + add(' .data :'); + add(' {'); + add(' __data_start = . ;'); + add(' *(.data .data.* .gnu.linkonce.d.*)'); - { extra by FPC } - add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))'); + { extra by FPC } + add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))'); - add(' KEEP (*(.gnu.linkonce.d.*personality*))'); - add(' SORT(CONSTRUCTORS)'); - add(' }'); - add(' .data1 : { *(.data1) }'); - add(' _edata = .; PROVIDE (edata = .);'); - add(' __bss_start = .;'); - add(' __bss_start__ = .;'); - add(' .bss :'); - add(' {'); - add(' *(.dynbss)'); - add(' *(.bss .bss.* .gnu.linkonce.b.*)'); - add(' *(COMMON)'); - add(' /* Align here to ensure that the .bss section occupies space up to'); - add(' _end. Align after .bss to ensure correct alignment even if the'); - add(' .bss section disappears because there are no input sections.'); - add(' FIXME: Why do we need it? When there is no .bss section, we don''t'); - add(' pad the .data section. */'); - add(' . = ALIGN(. != 0 ? 32 / 8 : 1);'); - add(' }'); - add(' _bss_end__ = . ; __bss_end__ = . ;'); - add(' . = ALIGN(32 / 8);'); - add(' . = ALIGN(32 / 8);'); - add(' __end__ = . ;'); - add(' _end = .; PROVIDE (end = .);'); - add(' /* Stabs debugging sections. */'); - add(' .stab 0 : { *(.stab) }'); - add(' .stabstr 0 : { *(.stabstr) }'); - add(' .stab.excl 0 : { *(.stab.excl) }'); - add(' .stab.exclstr 0 : { *(.stab.exclstr) }'); - add(' .stab.index 0 : { *(.stab.index) }'); - add(' .stab.indexstr 0 : { *(.stab.indexstr) }'); - add(' .comment 0 : { *(.comment) }'); - add(' /* DWARF debug sections.'); - add(' Symbols in the DWARF debugging sections are relative to the beginning'); - add(' of the section so we begin them at 0. */'); - add(' /* DWARF 1 */'); - add(' .debug 0 : { *(.debug) }'); - add(' .line 0 : { *(.line) }'); - add(' /* GNU DWARF 1 extensions */'); - add(' .debug_srcinfo 0 : { *(.debug_srcinfo) }'); - add(' .debug_sfnames 0 : { *(.debug_sfnames) }'); - add(' /* DWARF 1.1 and DWARF 2 */'); - add(' .debug_aranges 0 : { *(.debug_aranges) }'); - add(' .debug_pubnames 0 : { *(.debug_pubnames) }'); - add(' /* DWARF 2 */'); - add(' .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }'); - add(' .debug_abbrev 0 : { *(.debug_abbrev) }'); - add(' .debug_line 0 : { *(.debug_line) }'); - add(' .debug_frame 0 : { *(.debug_frame) }'); - add(' .debug_str 0 : { *(.debug_str) }'); - add(' .debug_loc 0 : { *(.debug_loc) }'); - add(' .debug_macinfo 0 : { *(.debug_macinfo) }'); - add(' /* SGI/MIPS DWARF 2 extensions */'); - add(' .debug_weaknames 0 : { *(.debug_weaknames) }'); - add(' .debug_funcnames 0 : { *(.debug_funcnames) }'); - add(' .debug_typenames 0 : { *(.debug_typenames) }'); - add(' .debug_varnames 0 : { *(.debug_varnames) }'); - add(' /* DWARF 3 */'); - add(' .debug_pubtypes 0 : { *(.debug_pubtypes) }'); - add(' .debug_ranges 0 : { *(.debug_ranges) }'); - add(' .stack 0x80000 :'); - add(' {'); - add(' _stack = .;'); - add(' *(.stack)'); - add(' }'); - add(' .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'); - add(' .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'); - add(' /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }'); - add('}'); - end - else + add(' KEEP (*(.gnu.linkonce.d.*personality*))'); + add(' SORT(CONSTRUCTORS)'); + add(' }'); + add(' .data1 : { *(.data1) }'); + add(' _edata = .; PROVIDE (edata = .);'); + add(' __bss_start = .;'); + add(' __bss_start__ = .;'); + add(' .bss :'); + add(' {'); + add(' *(.dynbss)'); + add(' *(.bss .bss.* .gnu.linkonce.b.*)'); + add(' *(COMMON)'); + add(' /* Align here to ensure that the .bss section occupies space up to'); + add(' _end. Align after .bss to ensure correct alignment even if the'); + add(' .bss section disappears because there are no input sections.'); + add(' FIXME: Why do we need it? When there is no .bss section, we don''t'); + add(' pad the .data section. */'); + add(' . = ALIGN(. != 0 ? 32 / 8 : 1);'); + add(' }'); + add(' _bss_end__ = . ; __bss_end__ = . ;'); + add(' . = ALIGN(32 / 8);'); + add(' . = ALIGN(32 / 8);'); + add(' __end__ = . ;'); + add(' _end = .; PROVIDE (end = .);'); + add(' /* Stabs debugging sections. */'); + add(' .stab 0 : { *(.stab) }'); + add(' .stabstr 0 : { *(.stabstr) }'); + add(' .stab.excl 0 : { *(.stab.excl) }'); + add(' .stab.exclstr 0 : { *(.stab.exclstr) }'); + add(' .stab.index 0 : { *(.stab.index) }'); + add(' .stab.indexstr 0 : { *(.stab.indexstr) }'); + add(' .comment 0 : { *(.comment) }'); + add(' /* DWARF debug sections.'); + add(' Symbols in the DWARF debugging sections are relative to the beginning'); + add(' of the section so we begin them at 0. */'); + add(' /* DWARF 1 */'); + add(' .debug 0 : { *(.debug) }'); + add(' .line 0 : { *(.line) }'); + add(' /* GNU DWARF 1 extensions */'); + add(' .debug_srcinfo 0 : { *(.debug_srcinfo) }'); + add(' .debug_sfnames 0 : { *(.debug_sfnames) }'); + add(' /* DWARF 1.1 and DWARF 2 */'); + add(' .debug_aranges 0 : { *(.debug_aranges) }'); + add(' .debug_pubnames 0 : { *(.debug_pubnames) }'); + add(' /* DWARF 2 */'); + add(' .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }'); + add(' .debug_abbrev 0 : { *(.debug_abbrev) }'); + add(' .debug_line 0 : { *(.debug_line) }'); + add(' .debug_frame 0 : { *(.debug_frame) }'); + add(' .debug_str 0 : { *(.debug_str) }'); + add(' .debug_loc 0 : { *(.debug_loc) }'); + add(' .debug_macinfo 0 : { *(.debug_macinfo) }'); + add(' /* SGI/MIPS DWARF 2 extensions */'); + add(' .debug_weaknames 0 : { *(.debug_weaknames) }'); + add(' .debug_funcnames 0 : { *(.debug_funcnames) }'); + add(' .debug_typenames 0 : { *(.debug_typenames) }'); + add(' .debug_varnames 0 : { *(.debug_varnames) }'); + add(' /* DWARF 3 */'); + add(' .debug_pubtypes 0 : { *(.debug_pubtypes) }'); + add(' .debug_ranges 0 : { *(.debug_ranges) }'); + add(' .stack 0x80000 :'); + add(' {'); + add(' _stack = .;'); + add(' *(.stack)'); + add(' }'); + add(' .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'); + add(' .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'); + add(' /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }'); + add('}'); + end + else {$endif ARM} {$ifndef LINKERSCRIPT_INCLUDED} - begin - {Sections.} - add('SECTIONS'); - add('{'); - {Read-only sections, merged into text segment:} - add(' PROVIDE (__executable_start = 0x010000); . = 0x010000 + SIZEOF_HEADERS;'); - add(' .interp : { *(.interp) }'); - add(' .hash : { *(.hash) }'); - add(' .dynsym : { *(.dynsym) }'); - add(' .dynstr : { *(.dynstr) }'); - add(' .gnu.version : { *(.gnu.version) }'); - add(' .gnu.version_d : { *(.gnu.version_d) }'); - add(' .gnu.version_r : { *(.gnu.version_r) }'); - add(' .rel.dyn :'); - add(' {'); - add(' *(.rel.init)'); - add(' *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)'); - add(' *(.rel.fini)'); - add(' *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)'); - add(' *(.rel.data.rel.ro*)'); - add(' *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)'); - add(' *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)'); - add(' *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)'); - add(' *(.rel.got)'); - add(' *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)'); - add(' }'); - add(' .rela.dyn :'); - add(' {'); - add(' *(.rela.init)'); - add(' *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)'); - add(' *(.rela.fini)'); - add(' *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)'); - add(' *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)'); - add(' *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)'); - add(' *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)'); - add(' *(.rela.got)'); - add(' *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)'); - add(' }'); - add(' .rel.plt : { *(.rel.plt) }'); - add(' .rela.plt : { *(.rela.plt) }'); - add(' .init :'); - add(' {'); - add(' KEEP (*(.init))'); - add(' } =0x90909090'); - add(' .plt : { *(.plt) }'); - add(' .text :'); - add(' {'); - add(' *(.text .stub .text.* .gnu.linkonce.t.*)'); - add(' KEEP (*(.text.*personality*))'); - {.gnu.warning sections are handled specially by elf32.em.} - add(' *(.gnu.warning)'); - add(' } =0x90909090'); - add(' .fini :'); - add(' {'); - add(' KEEP (*(.fini))'); - add(' } =0x90909090'); - add(' PROVIDE (_etext = .);'); - add(' .rodata :'); - add(' {'); - add(' *(.rodata .rodata.* .gnu.linkonce.r.*)'); - add(' }'); - {Adjust the address for the data segment. We want to adjust up to - the same address within the page on the next page up.} - add(' . = ALIGN (0x1000) - ((0x1000 - .) & (0x1000 - 1));'); - add(' .dynamic : { *(.dynamic) }'); - add(' .got : { *(.got) }'); - add(' .got.plt : { *(.got.plt) }'); - add(' .data :'); - add(' {'); - add(' *(.data .data.* .gnu.linkonce.d.*)'); - add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))'); - add(' KEEP (*(.gnu.linkonce.d.*personality*))'); - add(' }'); - add(' PROVIDE (_edata = .);'); - add(' PROVIDE (edata = .);'); - {$ifdef zsegment_threadvars} - add(' _z = .;'); - add(' .threadvar 0 : AT (_z) { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }'); - add(' PROVIDE (_threadvar_size = SIZEOF(.threadvar));'); - add(' . = _z + SIZEOF (.threadvar);'); - {$else} - add(' .threadvar : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }'); - {$endif} - add(' __bss_start = .;'); - add(' .bss :'); - add(' {'); - add(' *(.dynbss)'); - add(' *(.bss .bss.* .gnu.linkonce.b.*)'); - add(' *(COMMON)'); - {Align here to ensure that the .bss section occupies space up to - _end. Align after .bss to ensure correct alignment even if the - .bss section disappears because there are no input sections.} - add(' . = ALIGN(32 / 8);'); - add(' }'); - add(' . = ALIGN(32 / 8);'); - add(' PROVIDE (_end = .);'); - add(' PROVIDE (end = .);'); - {Stabs debugging sections.} - add(' .stab 0 : { *(.stab) }'); - add(' .stabstr 0 : { *(.stabstr) }'); - add('}'); - end; + begin + {Sections.} + add('SECTIONS'); + add('{'); + {Read-only sections, merged into text segment:} + add(' PROVIDE (__executable_start = 0x010000); . = 0x010000 + SIZEOF_HEADERS;'); + add(' .interp : { *(.interp) }'); + add(' .hash : { *(.hash) }'); + add(' .dynsym : { *(.dynsym) }'); + add(' .dynstr : { *(.dynstr) }'); + add(' .gnu.version : { *(.gnu.version) }'); + add(' .gnu.version_d : { *(.gnu.version_d) }'); + add(' .gnu.version_r : { *(.gnu.version_r) }'); + add(' .rel.dyn :'); + add(' {'); + add(' *(.rel.init)'); + add(' *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)'); + add(' *(.rel.fini)'); + add(' *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)'); + add(' *(.rel.data.rel.ro*)'); + add(' *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)'); + add(' *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)'); + add(' *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)'); + add(' *(.rel.got)'); + add(' *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)'); + add(' }'); + add(' .rela.dyn :'); + add(' {'); + add(' *(.rela.init)'); + add(' *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)'); + add(' *(.rela.fini)'); + add(' *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)'); + add(' *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)'); + add(' *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)'); + add(' *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)'); + add(' *(.rela.got)'); + add(' *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)'); + add(' }'); + add(' .rel.plt : { *(.rel.plt) }'); + add(' .rela.plt : { *(.rela.plt) }'); + add(' .init :'); + add(' {'); + add(' KEEP (*(.init))'); + add(' } =0x90909090'); + add(' .plt : { *(.plt) }'); + add(' .text :'); + add(' {'); + add(' *(.text .stub .text.* .gnu.linkonce.t.*)'); + add(' KEEP (*(.text.*personality*))'); + {.gnu.warning sections are handled specially by elf32.em.} + add(' *(.gnu.warning)'); + add(' } =0x90909090'); + add(' .fini :'); + add(' {'); + add(' KEEP (*(.fini))'); + add(' } =0x90909090'); + add(' PROVIDE (_etext = .);'); + add(' .rodata :'); + add(' {'); + add(' *(.rodata .rodata.* .gnu.linkonce.r.*)'); + add(' }'); + {Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up.} + add(' . = ALIGN (0x1000) - ((0x1000 - .) & (0x1000 - 1));'); + add(' .dynamic : { *(.dynamic) }'); + add(' .got : { *(.got) }'); + add(' .got.plt : { *(.got.plt) }'); + add(' .data :'); + add(' {'); + add(' *(.data .data.* .gnu.linkonce.d.*)'); + add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))'); + add(' KEEP (*(.gnu.linkonce.d.*personality*))'); + add(' }'); + add(' PROVIDE (_edata = .);'); + add(' PROVIDE (edata = .);'); + {$ifdef zsegment_threadvars} + add(' _z = .;'); + add(' .threadvar 0 : AT (_z) { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }'); + add(' PROVIDE (_threadvar_size = SIZEOF(.threadvar));'); + add(' . = _z + SIZEOF (.threadvar);'); + {$else} + add(' .threadvar : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }'); + {$endif} + add(' __bss_start = .;'); + add(' .bss :'); + add(' {'); + add(' *(.dynbss)'); + add(' *(.bss .bss.* .gnu.linkonce.b.*)'); + add(' *(COMMON)'); + {Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections.} + add(' . = ALIGN(32 / 8);'); + add(' }'); + add(' . = ALIGN(32 / 8);'); + add(' PROVIDE (_end = .);'); + add(' PROVIDE (end = .);'); + {Stabs debugging sections.} + add(' .stab 0 : { *(.stab) }'); + add(' .stabstr 0 : { *(.stabstr) }'); + add('}'); + end; {$endif LINKERSCRIPT_INCLUDED} + end; { Write and Close response } writetodisk; Free;