mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
1c9c9b9b55
This makes it possible to build ld without any compiled-in scripts, by setting COMPILE_IN=no in the environment. pe, beos and pdp11 targets didn't support scripts from the file system, with pdp11 nastily editing the ld/ldscripts file so that the built-in script didn't match. PR 27226 * emulparams/alphavms.sh: Don't set COMPILE_IN. * emulparams/elf64_ia64_vms.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_iamcu.sh: Likewise. * emulparams/elf_k1om.sh: Likewise. * emulparams/elf_l1om.sh: Likewise. * emulparams/mmo.sh: Likewise. * emulparams/pdp11.sh: Set DATA_SEG_ADDR. * scripttempl/pdp11.sc: Use it. * emultempl/pdp11.em: Don't edit .xn script for separate_code, instead use .xe script. Support scripts from file system. * emultempl/beos.em: Support scripts from file system. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * testsuite/ld-bootstrap/bootstrap.exp: Make tmpdir/ldscripts link.
65 lines
2.3 KiB
Bash
65 lines
2.3 KiB
Bash
TEMPLATE_NAME=elf
|
|
GENERATE_SHLIB_SCRIPT=yes
|
|
ELFSIZE=64
|
|
SCRIPT_NAME=elf
|
|
OUTPUT_FORMAT="elf64-mmix"
|
|
NO_REL_RELOCS=yes
|
|
ENTRY=_start.
|
|
|
|
# Default to 0 as mmixal does.
|
|
TEXT_START_ADDR='DEFINED (__.MMIX.start..text) ? __.MMIX.start..text : 0'
|
|
# Don't add SIZEOF_HEADERS.
|
|
# Don't set EMBEDDED, that would be misleading; it's not that kind of system.
|
|
TEXT_BASE_ADDRESS=$TEXT_START_ADDR
|
|
DATA_ADDR='DEFINED (__.MMIX.start..data) ? __.MMIX.start..data : 0x2000000000000000'
|
|
|
|
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
|
|
ARCH=mmix
|
|
MACHINE=
|
|
EXTRA_EM_FILE=mmixelf
|
|
|
|
# The existence of a symbol __start (or _start) should overrule Main, so
|
|
# it can be a user symbol without the associated mmixal magic. We
|
|
# also want to provide Main as a synonym for _start, if Main wasn't
|
|
# defined but is referred to, and _start was defined.
|
|
#
|
|
# The reason we use a symbol "_start." as a mediator is to avoid
|
|
# causing ld to force the type of _start to object rather than no
|
|
# type, which confuses disassembly; we also make it alphanumerically
|
|
# a successor of _start for similar reasons. Perhaps it's a linker
|
|
# bug that linker-defined symbols set the symbol-type.
|
|
#
|
|
# Note that we smuggle this into OTHER_TEXT_SECTIONS (at the end
|
|
# of .text) rather than TEXT_START_SYMBOLS. This is necessary, as
|
|
# DEFINED wouldn't find the symbol if it was at the top; presumably
|
|
# before the definition, if the definition is not in the first file.
|
|
# FIXME: Arguably a linker bug.
|
|
# Only do this for a final link, or else we'll mess up e.g. error
|
|
# messages.
|
|
OTHER_TEXT_SECTIONS="
|
|
${RELOCATING+
|
|
_start. = (DEFINED (_start) ? _start
|
|
: (DEFINED (Main) ? Main : (DEFINED (.text) ? .text : 0)));
|
|
PROVIDE (Main = DEFINED (Main) ? Main : (DEFINED (_start) ? _start : _start.));
|
|
}"
|
|
|
|
# We need a symbol at the end of the read-only data, which is
|
|
# colocated with the code. We make __etext fit.
|
|
ETEXT_LAST_IN_RODATA_SEGMENT=" "
|
|
|
|
OTHER_SECTIONS='
|
|
.MMIX.reg_contents :
|
|
{
|
|
/* Note that this section always has a fixed VMA - that of its
|
|
first register * 8. */
|
|
*(.MMIX.reg_contents.linker_allocated);
|
|
*(.MMIX.reg_contents);
|
|
}
|
|
'
|
|
|
|
# FIXME: Also bit by the PROVIDE bug? If not, this could be
|
|
# EXECUTABLE_SYMBOLS.
|
|
# By default, put the high end of the stack where the register stack
|
|
# begins. They grow in opposite directions. */
|
|
OTHER_SYMBOLS="PROVIDE (__Stack_start = 0x6000000000000000);"
|