Add support for RISC-V architecture.
[deliverable/binutils-gdb.git] / ld / emulparams / elf32lriscv-defs.sh
1 # This is an ELF platform.
2 SCRIPT_NAME=elf
3 ARCH=riscv
4 NO_REL_RELOCS=yes
5
6 TEMPLATE_NAME=elf32
7 EXTRA_EM_FILE=riscvelf
8
9 ELFSIZE=32
10
11 if test `echo "$host" | sed -e s/64//` = `echo "$target" | sed -e s/64//`; then
12 case " $EMULATION_LIBPATH " in
13 *" ${EMULATION_NAME} "*)
14 NATIVE=yes
15 ;;
16 esac
17 fi
18
19 GENERATE_SHLIB_SCRIPT=yes
20 GENERATE_PIE_SCRIPT=yes
21
22 TEXT_START_ADDR=0x10000
23 MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
24 COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
25
26 SDATA_START_SYMBOLS="_gp = . + 0x800;
27 *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*)"
28
29 # Place the data section before text section. This enables more compact
30 # global variable access for RVC code via linker relaxation.
31 INITIAL_READONLY_SECTIONS="
32 .data : { *(.data) *(.data.*) *(.gnu.linkonce.d.*) }
33 .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) }
34 .srodata : { ${SDATA_START_SYMBOLS} }
35 .sdata : { *(.sdata .sdata.* .gnu.linkonce.s.*) }
36 .sbss : { *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) }
37 .bss : { *(.dynbss) *(.bss .bss.* .gnu.linkonce.b.*) *(COMMON) }
38 . = ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1));"
39 INITIAL_READONLY_SECTIONS=".interp : { *(.interp) } ${CREATE_PIE-${INITIAL_READONLY_SECTIONS}}"
40 INITIAL_READONLY_SECTIONS="${RELOCATING+${CREATE_SHLIB-${INITIAL_READONLY_SECTIONS}}}"
41
42 SDATA_START_SYMBOLS="${CREATE_PIE+${SDATA_START_SYMBOLS}}"
This page took 0.032186 seconds and 4 git commands to generate.