The header scan (Captain Bob, 2026-11-10): 788 source files -- 351 with the
SL-1.0 header, 12 with the old name (docs/working/experiments, kept by
ruling), 31 under someone else's licence (tools/kconfig, Linux's, GPL-2.0:
kept), and 394 with none. Ruled: the SPDX form; capsules (.4th, .f18) and
proofs (.thy) left for a ruling of their own (mkcapsule's 64x16 block format,
content-addressed capsules).
253 files now begin
SPDX-License-Identifier: LicenseRef-Starship-1.0
Copyright (c) 2023-2026 Robert A. James
as a /* */ block (C, headers, assembly, linker scripts) or # lines (scripts,
Makefiles, Kconfig; below a shebang or a coding line); tools/mkcapsule.c,
which had the copyright line, gets the SPDX line only.
Not touched: docs/working/ (archive and old campaign material, as the
ruling kept the experiments); v4/system/post_cases.c (generated by
v4/tools/mkpost.py, "do not edit" -- the generator has the header).
Comments only: the kernel builds on amd64, aarch64, riscv64; make -C v4
test-32: 39 programs, 0 failures; every changed script parses.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
78 lines
2.0 KiB
Plaintext
78 lines
2.0 KiB
Plaintext
/* SPDX-License-Identifier: LicenseRef-Starship-1.0
|
|
* Copyright (c) 2023-2026 Robert A. James
|
|
*/
|
|
/* Linker script for StarKernel UEFI Loader (riscv64) - ELF64 intermediate */
|
|
/* Linked as shared ELF, then converted to PE via objcopy -O pei-riscv64-little */
|
|
/*
|
|
* Section layout:
|
|
* .text/.rodata/.data — code and initialized data
|
|
* .bss — uninitialized data (right after .data, VMA-only, no file data)
|
|
* .reloc at 0x700000 — PE base relocation table injected post-link
|
|
* (large fixed gap avoids overlap with ~6MB BSS)
|
|
* .rela.dyn / ELF dyn — ELF dynamic sections, stripped before PE conversion
|
|
*/
|
|
|
|
OUTPUT_FORMAT("elf64-littleriscv")
|
|
OUTPUT_ARCH(riscv:rv64)
|
|
ENTRY(efi_main)
|
|
|
|
SECTIONS
|
|
{
|
|
. = 0x1000;
|
|
|
|
__loader_start = .;
|
|
|
|
.text : {
|
|
__text_start = .;
|
|
*(.text.entry)
|
|
*(.text .text.*)
|
|
__text_end = .;
|
|
}
|
|
|
|
.rodata : ALIGN(4K) {
|
|
__rodata_start = .;
|
|
*(.rodata .rodata.*)
|
|
__rodata_end = .;
|
|
}
|
|
|
|
.data : ALIGN(4K) {
|
|
__data_start = .;
|
|
*(.data .data.*)
|
|
*(.got .got.*)
|
|
*(.got.plt)
|
|
__data_end = .;
|
|
}
|
|
|
|
/* BSS immediately after .data — no gap, no section overlap */
|
|
.bss : ALIGN(4K) {
|
|
__bss_start = .;
|
|
*(.bss .bss.*)
|
|
*(COMMON)
|
|
__bss_end = .;
|
|
}
|
|
|
|
__loader_end = .;
|
|
|
|
/* PE base relocation table — immediately after BSS (self-adjusting).
|
|
* gen_pe_reloc.py replaces this stub with IMAGE_REL_BASED_DIR64 entries.
|
|
* ALIGN(4K) avoids the old fixed-address overlap when BSS grows. */
|
|
.reloc : ALIGN(4K) {
|
|
KEEP(*(.reloc))
|
|
}
|
|
|
|
/* ELF dynamic sections — stripped by objcopy before PE conversion */
|
|
.rela.dyn : ALIGN(4K) { *(.rela .rela.*) }
|
|
.dynsym : { *(.dynsym) }
|
|
.dynamic : { *(.dynamic) }
|
|
|
|
/DISCARD/ : {
|
|
*(.comment)
|
|
*(.note*)
|
|
*(.eh_frame)
|
|
*(.gnu.hash)
|
|
*(.hash)
|
|
*(.dynstr)
|
|
*(.riscv.attributes)
|
|
}
|
|
}
|