binutils-gdb/ld/emulparams/elf64loongarch-defs.sh
liuzhensong 560b3fe208 LoongArch ld support
2021-10-22  Chenghua Xu  <xuchenghua@loongson.cn>
	    Zhensong Liu  <liuzhensong@loongson.cn>
	    Weinan Liu  <liuweinan@loongson.cn>
	    Xiaolin Tang  <tangxiaolin@loongson.cn>

ld/
	* Makefile.am: Add LoongArch.
	* NEWS: Mention LoongArch support.
	* configure.tgt: Add LoongArch.
	* emulparams/elf32loongarch-defs.sh: New.
	* emulparams/elf32loongarch.sh: Likewise.
	* emulparams/elf64loongarch-defs.sh: Likewise.
	* emulparams/elf64loongarch.sh: Likewise.
	* emultempl/loongarchelf.em: Likewise.
	* Makefile.in: Regenerate.
	* po/BLD-POTFILES.in: Regenerate.
ld/testsuite/
	* ld-loongarch-elf/disas-jirl.d: New.
	* ld-loongarch-elf/disas-jirl.s: Likewise.
	* ld-loongarch-elf/jmp_op.d: Likewise.
	* ld-loongarch-elf/jmp_op.s: Likewise.
	* ld-loongarch-elf/ld-loongarch-elf.exp: Likewise.
	* ld-loongarch-elf/macro_op.d: Likewise.
	* ld-loongarch-elf/macro_op.s: Likewise.
	* ld-loongarch-elf/syscall-0.s: Likewise.
	* ld-loongarch-elf/syscall-1.s: Likewise.
	* ld-loongarch-elf/syscall.d: Likewise.
	* ld-srec/srec.exp: Add LoongArch.
	* ld-unique/pr21529.d: Likewise.
2021-10-24 21:36:32 +10:30

40 lines
924 B
Bash

# 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}}}"