5d31da1ba1bdbb716b57c67274653039fa1e4e5d
[external/binutils.git] / ld / emulparams / elf_x86_64.sh
1 . ${srcdir}/emulparams/plt_unwind.sh
2 . ${srcdir}/emulparams/extern_protected_data.sh
3 . ${srcdir}/emulparams/call_nop.sh
4 SCRIPT_NAME=elf
5 ELFSIZE=64
6 OUTPUT_FORMAT="elf64-x86-64"
7 NO_REL_RELOCS=yes
8 TEXT_START_ADDR=0x400000
9 MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
10 COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
11 ARCH="i386:x86-64"
12 MACHINE=
13 TEMPLATE_NAME=elf32
14 GENERATE_SHLIB_SCRIPT=yes
15 GENERATE_PIE_SCRIPT=yes
16 NO_SMALL_DATA=yes
17 LARGE_SECTIONS=yes
18 LARGE_BSS_AFTER_BSS=
19 SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 24 ? 24 : 0"
20 IREL_IN_PLT=
21 # Reuse TINY_READONLY_SECTION which is placed right after .plt section.
22 TINY_READONLY_SECTION="
23 .plt.got      ${RELOCATING-0} : { *(.plt.got) }
24 .plt.bnd      ${RELOCATING-0} : { *(.plt.bnd) }
25 "
26
27 if [ "x${host}" = "x${target}" ]; then
28   case " $EMULATION_LIBPATH " in
29     *" ${EMULATION_NAME} "*)
30       NATIVE=yes
31   esac
32 fi
33
34 # Linux/Solaris modify the default library search path to first include
35 # a 64-bit specific directory.
36 case "$target" in
37   x86_64*-linux*|i[3-7]86-*-linux-*)
38     case "$EMULATION_NAME" in
39       *64*)
40         LIBPATH_SUFFIX=64
41         PARSE_AND_LIST_OPTIONS_BNDPLT='
42   fprintf (file, _("\
43   -z bndplt                   Always generate BND prefix in PLT entries\n"));
44 '
45         PARSE_AND_LIST_ARGS_CASE_Z_BNDPLT='
46       else if (strcmp (optarg, "bndplt") == 0)
47         link_info.bndplt = TRUE;
48 '
49         PARSE_AND_LIST_OPTIONS="$PARSE_AND_LIST_OPTIONS $PARSE_AND_LIST_OPTIONS_BNDPLT"
50         PARSE_AND_LIST_ARGS_CASE_Z="$PARSE_AND_LIST_ARGS_CASE_Z $PARSE_AND_LIST_ARGS_CASE_Z_BNDPLT"
51         ;;
52     esac
53     ;;
54   *-*-solaris2*)
55     LIBPATH_SUFFIX=/amd64
56     ELF_INTERPRETER_NAME=\"/lib/amd64/ld.so.1\"
57   ;;
58 esac