Blame ld/emulparams/elf64mmix.sh

Packit ba3681
TEMPLATE_NAME=elf32
Packit ba3681
GENERATE_SHLIB_SCRIPT=yes
Packit ba3681
ELFSIZE=64
Packit ba3681
SCRIPT_NAME=elf
Packit ba3681
OUTPUT_FORMAT="elf64-mmix"
Packit ba3681
NO_REL_RELOCS=yes
Packit ba3681
ENTRY=_start.
Packit ba3681
Packit ba3681
# Default to 0 as mmixal does.
Packit ba3681
TEXT_START_ADDR='DEFINED (__.MMIX.start..text) ? __.MMIX.start..text : 0'
Packit ba3681
# Don't add SIZEOF_HEADERS.
Packit ba3681
# Don't set EMBEDDED, that would be misleading; it's not that kind of system.
Packit ba3681
TEXT_BASE_ADDRESS=$TEXT_START_ADDR
Packit ba3681
DATA_ADDR='DEFINED (__.MMIX.start..data) ? __.MMIX.start..data : 0x2000000000000000'
Packit ba3681
Packit ba3681
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
Packit ba3681
ARCH=mmix
Packit ba3681
MACHINE=
Packit ba3681
COMPILE_IN=yes
Packit ba3681
EXTRA_EM_FILE=mmixelf
Packit ba3681
Packit ba3681
# The existence of a symbol __start (or _start) should overrule Main, so
Packit ba3681
# it can be a user symbol without the associated mmixal magic.  We
Packit ba3681
# also want to provide Main as a synonym for _start, if Main wasn't
Packit ba3681
# defined but is referred to, and _start was defined.
Packit ba3681
#
Packit ba3681
# The reason we use a symbol "_start." as a mediator is to avoid
Packit ba3681
# causing ld to force the type of _start to object rather than no
Packit ba3681
# type, which confuses disassembly; we also make it alphanumerically
Packit ba3681
# a successor of _start for similar reasons.  Perhaps it's a linker
Packit ba3681
# bug that linker-defined symbols set the symbol-type.
Packit ba3681
#
Packit ba3681
# Note that we smuggle this into OTHER_TEXT_SECTIONS (at the end
Packit ba3681
# of .text) rather than TEXT_START_SYMBOLS.  This is necessary, as
Packit ba3681
# DEFINED wouldn't find the symbol if it was at the top; presumably
Packit ba3681
# before the definition, if the definition is not in the first file.
Packit ba3681
# FIXME: Arguably a linker bug.
Packit ba3681
# Only do this for a final link, or else we'll mess up e.g. error
Packit ba3681
# messages.
Packit ba3681
OTHER_TEXT_SECTIONS="
Packit ba3681
${RELOCATING+
Packit ba3681
 _start. = (DEFINED (_start) ? _start
Packit ba3681
	    : (DEFINED (Main) ? Main : (DEFINED (.text) ? .text : 0)));
Packit ba3681
 PROVIDE (Main = DEFINED (Main) ? Main : (DEFINED (_start) ? _start : _start.));
Packit ba3681
}"
Packit ba3681
Packit ba3681
OTHER_SECTIONS='
Packit ba3681
 .MMIX.reg_contents :
Packit ba3681
 {
Packit ba3681
   /* Note that this section always has a fixed VMA - that of its
Packit ba3681
      first register * 8.  */
Packit ba3681
   *(.MMIX.reg_contents.linker_allocated);
Packit ba3681
   *(.MMIX.reg_contents);
Packit ba3681
 }
Packit ba3681
'
Packit ba3681
Packit ba3681
# FIXME: Also bit by the PROVIDE bug?  If not, this could be
Packit ba3681
# EXECUTABLE_SYMBOLS.
Packit ba3681
# By default, put the high end of the stack where the register stack
Packit ba3681
# begins.  They grow in opposite directions.  */
Packit ba3681
OTHER_SYMBOLS="PROVIDE (__Stack_start = 0x6000000000000000);"