<commit_before>/* Copyright lowRISC contributors. */
/* Licensed under the Apache License, Version 2.0, see LICENSE for details. */
/* SPDX-License-Identifier: Apache-2.0 */
/*

  OTBN has a pure Harvard architecture, with instruction and data
  memory both starting at address 0.

  This linker script template is interpolated by otbn-ld after it gets
  the LMAs and memory sizes from otbn.hjson.

*/
MEMORY
{
    imem (x)  : ORIGIN = 0, LENGTH = ${imem_length}
    dmem (rw) : ORIGIN = 0, LENGTH = ${dmem_bus_length}
    dmem_scratch (rw) : ORIGIN = ${dmem_bus_length}, LENGTH = ${dmem_length - dmem_bus_length}

    /*
      LMA addresses (for VMAs in imem/dmem, respectively)

      Note that the DMEM load region is half the size of DMEM itself,
      to model the fact that OTBN can write to the whole region but
      only the first ${dmem_length // 2} bytes are bus-accessible.
    */
    imem_load (rw) : ORIGIN = ${imem_lma}, LENGTH = ${imem_length}
    dmem_load (rw) : ORIGIN = ${dmem_lma}, LENGTH = ${dmem_bus_length}
}

SECTIONS
{
    .start ORIGIN(imem) : ALIGN(4)
    {
        _imem_start = .;
        KEEP(*(.text.start*))
    } >imem AT>imem_load

    .text : ALIGN(4)
    {
        *(.text*)

        /* Align section end. Shouldn't really matter, but might make binary
           blobs a bit easier to work with. */
        . = ALIGN(4);

        _imem_end = .;
    } >imem AT>imem_load

    .data ORIGIN(dmem) : ALIGN(32)
    {
        _dmem_data_start = .;
        *(.data*)

        /* Align section end (see note in .text section) */<commit_msg>[otbn] Move .start into .text section in OTBN linker script.<commit_after>/* Copyright lowRISC contributors. */
/* Licensed under the Apache License, Version 2.0, see LICENSE for details. */
/* SPDX-License-Identifier: Apache-2.0 */
/*

  OTBN has a pure Harvard architecture, with instruction and data
  memory both starting at address 0.

  This linker script template is interpolated by otbn-ld after it gets
  the LMAs and memory sizes from otbn.hjson.

*/
MEMORY
{
    imem (x)  : ORIGIN = 0, LENGTH = ${imem_length}
    dmem (rw) : ORIGIN = 0, LENGTH = ${dmem_bus_length}
    dmem_scratch (rw) : ORIGIN = ${dmem_bus_length}, LENGTH = ${dmem_length - dmem_bus_length}

    /*
      LMA addresses (for VMAs in imem/dmem, respectively)

      Note that the DMEM load region is half the size of DMEM itself,
      to model the fact that OTBN can write to the whole region but
      only the first ${dmem_length // 2} bytes are bus-accessible.
    */
    imem_load (rw) : ORIGIN = ${imem_lma}, LENGTH = ${imem_length}
    dmem_load (rw) : ORIGIN = ${dmem_lma}, LENGTH = ${dmem_bus_length}
}

SECTIONS
{
    .text ORIGIN(imem) : ALIGN(4)
    {
        _imem_start = .;
        KEEP(*(.text.start*))
        *(.text*)

        /* Align section end. Shouldn't really matter, but might make binary
           blobs a bit easier to work with. */
        . = ALIGN(4);

        _imem_end = .;
    } >imem AT>imem_load

    .data ORIGIN(dmem) : ALIGN(32)
    {
        _dmem_data_start = .;
        *(.data*)

        /* Align section end (see note in .text section) */
{'fraction_non_alphanumeric': 0.11394829237152888, 'fraction_numerical': 0.007979572294924991, 'mean_word_length': 2.5213483146067417, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2238079', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1071, 'n_words': 343}