summaryrefslogtreecommitdiff
path: root/ld/emulparams/elf64loongarch-defs.sh
blob: c793f5d8388a934f1ed08a1ef12ba23c712bc007 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# This is an ELF platform.
SCRIPT_NAME=elf
ARCH=loongarch
NO_REL_RELOCS=yes

TEMPLATE_NAME=elf
EXTRA_EM_FILE=loongarchelf

ELFSIZE=64

if test `echo "$host" | sed -e s/64//` = `echo "$target" | sed -e s/64//`; then
  case " $EMULATION_LIBPATH " in
    *" ${EMULATION_NAME} "*)
      NATIVE=yes
      ;;
  esac
fi

# Enable shared library support for everything except an embedded elf target.
case "$target" in
  loongarch*-elf)
    ;;
  *)
    GENERATE_SHLIB_SCRIPT=yes
    GENERATE_PIE_SCRIPT=yes
    ;;
esac

# In all cases, the number is big-endian.
# LoongArch nop is 'andi $r0,$r0,0'.
NOP=0x00004003

TEXT_START_ADDR=0x120000000
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"

SEPARATE_GOTPLT=0
INITIAL_READONLY_SECTIONS=".interp         : { *(.interp) } ${CREATE_PIE-${INITIAL_READONLY_SECTIONS}}"
INITIAL_READONLY_SECTIONS="${RELOCATING+${CREATE_SHLIB-${INITIAL_READONLY_SECTIONS}}}"