aboutsummaryrefslogblamecommitdiff
path: root/stand/efi/loader/arch/riscv/ldscript.riscv
blob: aa736f0d9b2a453f94dabfd2f93987856c6a763b (plain) (tree)



















































































                                                                               
                                


                                
/* $FreeBSD$ */
OUTPUT_FORMAT("elf64-littleriscv", "elf64-littleriscv", "elf64-littleriscv")
OUTPUT_ARCH(riscv64)
ENTRY(_start)
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  . = 0;
  ImageBase = .;
  .text		: {
    *(.peheader)
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em. */
    *(.gnu.warning)
    *(.plt)
  } =0x9090
  . = ALIGN(16);
  .data		: {
    *(.rodata .rodata.* .gnu.linkonce.r.*)
    *(.rodata1)
    *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
    *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
    *(.opd)
    *(.data .data.* .gnu.linkonce.d.*)
    *(.data1)
    *(.plabel)

    . = ALIGN(16);
    __bss_start = .;
    *(.sbss .sbss.* .gnu.linkonce.sb.*)
    *(.scommon)
    *(.dynbss)
    *(.bss *.bss.*)
    *(COMMON)
    . = ALIGN(16);
    __bss_end = .;
  }
  . = ALIGN(16);
  set_Xcommand_set	: {
    __start_set_Xcommand_set = .;
    *(set_Xcommand_set)
    __stop_set_Xcommand_set = .;
  }
  set_Xficl_compile_set	: {
    __start_set_Xficl_compile_set = .;
    *(set_Xficl_compile_set)
    __stop_set_Xficl_compile_set = .;
  }
  . = ALIGN(16);
  .sdata	: {
    /*
     * u-boot expects the gp register to be untouched by the EFI payload, so we
     * can't enable this yet.
     */
    /* __global_pointer$ = . + 0x800; */
    *(.got.plt .got)
    *(.sdata .sdata.* .gnu.linkonce.s.*)
    *(dynsbss)
    *(.scommon)
  }
  . = ALIGN(16);
  .dynamic	: { *(.dynamic) }
  . = ALIGN(16);
  .rela.dyn	: {
    *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
    *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
    *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
    *(.rela.got)
    *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
    *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
    *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
    *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
    *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
    *(.rela.plt)
    *(.relset_*)
    *(.rela.dyn .rela.dyn.*)
  }
  . = ALIGN(16);
  .reloc	: { *(.reloc) }
  . = ALIGN(16);
  .dynsym	: { *(.dynsym) }
  _edata = .;

  /* Unused sections */
  .interp	: { *(.interp) }
  .dynstr	: { *(.dynstr) }
  .hash		: { *(.hash) }
}