From 4a22e7a0ed614cd7e65555b249520012a12a7418 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 16 Apr 1999 18:08:27 +0000 Subject: Corrected to reflect new way of doing mips constructors. --- c/src/lib/libbsp/mips/p4000/startup/linkcmds | 53 +++++++++++++++++++--- .../lib/libbsp/mips64orion/p4000/startup/linkcmds | 53 +++++++++++++++++++--- 2 files changed, 94 insertions(+), 12 deletions(-) diff --git a/c/src/lib/libbsp/mips/p4000/startup/linkcmds b/c/src/lib/libbsp/mips/p4000/startup/linkcmds index 47e0ba1162..18637fee44 100644 --- a/c/src/lib/libbsp/mips/p4000/startup/linkcmds +++ b/c/src/lib/libbsp/mips/p4000/startup/linkcmds @@ -7,6 +7,7 @@ OUTPUT_ARCH(mips) /* Do we need any of these for elf? __DYNAMIC = 0; */ _DYNAMIC_LINK = 0; + SECTIONS { /* Read-only sections, merged into text segment: */ @@ -15,14 +16,54 @@ SECTIONS /* .text 0x00020000 : /* */ { _ftext = . ; + *(.init) + eprol = .; *(.text) - CREATE_OBJECT_SYMBOLS - _etext = .; + *(.text.*) + *(.gnu.linkonce.t*) + *(.mips16.fn.*) + *(.mips16.call.*) + PROVIDE (__runtime_reloc_start = .); + *(.rel.sdata) + PROVIDE (__runtime_reloc_stop = .); + *(.fini) + /* CREATE_OBJECT_SYMBOLS */ + etext = .; + _etext = .; } - .init ALIGN(8) : { *(.init) } =0 - .fini ALIGN(8) : { *(.fini) } =0 - .ctors ALIGN(8) : { *(.ctors) } - .dtors ALIGN(8) : { *(.dtors) } + .ctors : + { + ___ctors = .; +/* + * This version is preferable but requires a very late + * model binutils (post 2.9.1). + KEEP(*crtbegin.o(.ctors)); + KEEP(*(SORT(.ctors.*))); + KEEP(*(.ctors)); +*/ + *crtbegin.o(.ctors); + *(.ctors.*); + *(.ctors); + ___ctors_end = .; + } + .dtors : + { + ___dtors = .; +/* + * This version is preferable but requires a very late + * model binutils (post 2.9.1). + KEEP(*crtbegin.o(.dtors)); + KEEP(*(SORT(.dtors.*))); + KEEP(*(.dtors)); +*/ + *crtbegin.o(.dtors); + *(.dtors.*); + *(.dtors); + ___dtors_end = .; + } + . = .; + + .rodata ALIGN(8) : { *(.rodata) *(.gnu.linkonce.r*) } .rodata1 ALIGN(8) : { diff --git a/c/src/lib/libbsp/mips64orion/p4000/startup/linkcmds b/c/src/lib/libbsp/mips64orion/p4000/startup/linkcmds index 47e0ba1162..18637fee44 100644 --- a/c/src/lib/libbsp/mips64orion/p4000/startup/linkcmds +++ b/c/src/lib/libbsp/mips64orion/p4000/startup/linkcmds @@ -7,6 +7,7 @@ OUTPUT_ARCH(mips) /* Do we need any of these for elf? __DYNAMIC = 0; */ _DYNAMIC_LINK = 0; + SECTIONS { /* Read-only sections, merged into text segment: */ @@ -15,14 +16,54 @@ SECTIONS /* .text 0x00020000 : /* */ { _ftext = . ; + *(.init) + eprol = .; *(.text) - CREATE_OBJECT_SYMBOLS - _etext = .; + *(.text.*) + *(.gnu.linkonce.t*) + *(.mips16.fn.*) + *(.mips16.call.*) + PROVIDE (__runtime_reloc_start = .); + *(.rel.sdata) + PROVIDE (__runtime_reloc_stop = .); + *(.fini) + /* CREATE_OBJECT_SYMBOLS */ + etext = .; + _etext = .; } - .init ALIGN(8) : { *(.init) } =0 - .fini ALIGN(8) : { *(.fini) } =0 - .ctors ALIGN(8) : { *(.ctors) } - .dtors ALIGN(8) : { *(.dtors) } + .ctors : + { + ___ctors = .; +/* + * This version is preferable but requires a very late + * model binutils (post 2.9.1). + KEEP(*crtbegin.o(.ctors)); + KEEP(*(SORT(.ctors.*))); + KEEP(*(.ctors)); +*/ + *crtbegin.o(.ctors); + *(.ctors.*); + *(.ctors); + ___ctors_end = .; + } + .dtors : + { + ___dtors = .; +/* + * This version is preferable but requires a very late + * model binutils (post 2.9.1). + KEEP(*crtbegin.o(.dtors)); + KEEP(*(SORT(.dtors.*))); + KEEP(*(.dtors)); +*/ + *crtbegin.o(.dtors); + *(.dtors.*); + *(.dtors); + ___dtors_end = .; + } + . = .; + + .rodata ALIGN(8) : { *(.rodata) *(.gnu.linkonce.r*) } .rodata1 ALIGN(8) : { -- cgit v1.2.3