diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2021-02-18 16:27:09 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2021-02-18 16:27:09 +0000 |
commit | c4a53b6d562a630fbd8c8262e40eea04f0aec3c9 (patch) | |
tree | 351223c210a49e6dd2e8ac94a55f5490f7556410 /sys/arch | |
parent | bb43b48767169674e9c8d337d5bd582cc9134e58 (diff) |
Make kernel ld.script similar to octeon's on loongson and sgi.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/loongson/conf/ld.script | 44 | ||||
-rw-r--r-- | sys/arch/sgi/conf/ld.script | 44 |
2 files changed, 74 insertions, 14 deletions
diff --git a/sys/arch/loongson/conf/ld.script b/sys/arch/loongson/conf/ld.script index d529e3df319..49adf31254b 100644 --- a/sys/arch/loongson/conf/ld.script +++ b/sys/arch/loongson/conf/ld.script @@ -1,27 +1,57 @@ +/* $OpenBSD: ld.script,v 1.5 2021/02/18 16:27:07 visa Exp $ */ + OUTPUT_FORMAT("elf64-tradlittlemips") OUTPUT_ARCH(mips) ENTRY(__start) +PHDRS +{ + text PT_LOAD; + openbsd_randomize PT_OPENBSD_RANDOMIZE; +} + SECTIONS { - .text : { *(.text .text.* .gnu.linkonce.t.*) } + .text : + { + *(.text .text.* .gnu.linkonce.t.*) + } :text PROVIDE (etext = .); - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } - .data : { *(.data .data.* .gnu.linkonce.d.*) } + .rodata : + { + *(.rodata .rodata.* .gnu.linkonce.r.*) + } :text + + . = ALIGN(8); + PROVIDE (__kernel_randomdata = .); .openbsd.randomdata : { - /* XXX shouldn't this be placed next to rodata? */ __retguard_start = ABSOLUTE(.); *(.openbsd.randomdata.retguard .openbsd.randomdata.retguard.*) /* XXX . = ALIGN(0x1000); */ __retguard_end = ABSOLUTE(.); *(.openbsd.randomdata .openbsd.randomdata.*) - } + } :text :openbsd_randomize + . = ALIGN(8); + PROVIDE (__kernel_randomdata_end = .); + + .data : + { + *(.data .data.* .gnu.linkonce.d.*) + } :text PROVIDE (edata = .); - .sbss : { *(.sbss .sbss.* .gnu.linkonce.sb.* .scommon) } - .bss : { *(.bss .bss.* .gnu.linkonce.b.* COMMON) } + .sbss : + { + *(.sbss .sbss.* .gnu.linkonce.sb.* .scommon) + } + .bss : + { + *(.bss .bss.* .gnu.linkonce.b.* COMMON) + } + . = ALIGN(8); PROVIDE (_end = .); PROVIDE (end = .); + /DISCARD/ : { *(.pdr) diff --git a/sys/arch/sgi/conf/ld.script b/sys/arch/sgi/conf/ld.script index 99134c0ea6e..85a74ec1049 100644 --- a/sys/arch/sgi/conf/ld.script +++ b/sys/arch/sgi/conf/ld.script @@ -1,27 +1,57 @@ +/* $OpenBSD: ld.script,v 1.10 2021/02/18 16:27:08 visa Exp $ */ + OUTPUT_FORMAT("elf64-tradbigmips") OUTPUT_ARCH(mips) ENTRY(__start) +PHDRS +{ + text PT_LOAD; + openbsd_randomize PT_OPENBSD_RANDOMIZE; +} + SECTIONS { - .text : { *(.text .text.* .gnu.linkonce.t.*) } + .text : + { + *(.text .text.* .gnu.linkonce.t.*) + } :text PROVIDE (etext = .); - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } - .data : { *(.data .data.* .gnu.linkonce.d.*) } + .rodata : + { + *(.rodata .rodata.* .gnu.linkonce.r.*) + } :text + + . = ALIGN(8); + PROVIDE (__kernel_randomdata = .); .openbsd.randomdata : { - /* XXX shouldn't this be placed next to rodata? */ __retguard_start = ABSOLUTE(.); *(.openbsd.randomdata.retguard .openbsd.randomdata.retguard.*) /* XXX . = ALIGN(0x1000); */ __retguard_end = ABSOLUTE(.); *(.openbsd.randomdata .openbsd.randomdata.*) - } + } :text :openbsd_randomize + . = ALIGN(8); + PROVIDE (__kernel_randomdata_end = .); + + .data : + { + *(.data .data.* .gnu.linkonce.d.*) + } :text PROVIDE (edata = .); - .sbss : { *(.sbss .sbss.* .gnu.linkonce.sb.* .scommon) } - .bss : { *(.bss .bss.* .gnu.linkonce.b.* COMMON) } + .sbss : + { + *(.sbss .sbss.* .gnu.linkonce.sb.* .scommon) + } + .bss : + { + *(.bss .bss.* .gnu.linkonce.b.* COMMON) + } + . = ALIGN(8); PROVIDE (_end = .); PROVIDE (end = .); + /DISCARD/ : { *(.pdr) |