diff options
author | Alan Modra <amodra@gmail.com> | 2019-04-10 11:35:48 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-04-10 13:30:32 +0930 |
commit | c55b17b8098abde4ae7dfe0ec1f3b22a7fb0a34d (patch) | |
tree | 5e31dbb3f0480cf49ae3084f3d3ff4dbd6357afd /ld/emulparams | |
parent | 6feda62721cd6e288f79b0ee5f1489fee8e570ab (diff) | |
download | gdb-c55b17b8098abde4ae7dfe0ec1f3b22a7fb0a34d.zip gdb-c55b17b8098abde4ae7dfe0ec1f3b22a7fb0a34d.tar.gz gdb-c55b17b8098abde4ae7dfe0ec1f3b22a7fb0a34d.tar.bz2 |
Fix some ld dependencies
In looking at the csky-elf vs. csky-linux differences, the first thing
I compared was csky_elf.sh and cskyelf_linux.sh. Those files are
mostly the same but besides the real differences, annoyingly have some
lines ordered differently. It's better in such cases to have one file
source the other, making differences plain. This patch does that for
csky and microblaze, removes an unused variable defined in a few
places, and fixes ld makefile dependencies.
* Makefile.am (eskyelf.c, eskyelf_linux.c): Depend on cskyelf.em.
(ecskyelf_linux.c): Depend on cskyelf.sh.
(eelf32microblazeel.c): Depend on elf32microblaze.sh.
* Makefile.in: Regenerate.
* emulparams/cskyelf.sh: Comment regarding cskelf_linux.sh.
(PAGE_SIZE): Don't define.
* emulparams/cskyelf_linux.sh: Source sckyelf.sh, leaving just
the differing variable defs/undefs.
* emulparams/elf32mcore.sh (PAGE_SIZE): Don't define.
* emulparams/elf32microblaze.sh: Comment re. elf32microblazeel.sh.
(OUTPUT_FORMAT): Use BIG_OUTPUT_FORMAT.
(PAGE_SIZE): Don't define.
* emulparams/elf32microblazeel.sh: Source elf32microblaze.sh,
leaving just the differing OUTPUT_FORMAT.
Diffstat (limited to 'ld/emulparams')
-rw-r--r-- | ld/emulparams/cskyelf.sh | 3 | ||||
-rw-r--r-- | ld/emulparams/cskyelf_linux.sh | 35 | ||||
-rw-r--r-- | ld/emulparams/elf32mcore.sh | 1 | ||||
-rw-r--r-- | ld/emulparams/elf32microblaze.sh | 5 | ||||
-rw-r--r-- | ld/emulparams/elf32microblazeel.sh | 25 |
5 files changed, 11 insertions, 58 deletions
diff --git a/ld/emulparams/cskyelf.sh b/ld/emulparams/cskyelf.sh index 218951c..c9f7e3f 100644 --- a/ld/emulparams/cskyelf.sh +++ b/ld/emulparams/cskyelf.sh @@ -1,9 +1,10 @@ +# If you change this file, please also look at files which source this one: +# cskyelf_linux.sh SCRIPT_NAME=elf OUTPUT_FORMAT="elf32-csky-little" BIG_OUTPUT_FORMAT="elf32-csky-big" LITTLE_OUTPUT_FORMAT="elf32-csky-little" NO_REL_RELOCS=yes -PAGE_SIZE=0x1000 TARGET_PAGE_SIZE=0x400 MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" TEXT_START_ADDR=0x8000 diff --git a/ld/emulparams/cskyelf_linux.sh b/ld/emulparams/cskyelf_linux.sh index 118be1a..135ea1f 100644 --- a/ld/emulparams/cskyelf_linux.sh +++ b/ld/emulparams/cskyelf_linux.sh @@ -1,36 +1,9 @@ -SCRIPT_NAME=elf -OUTPUT_FORMAT="elf32-csky-little" -BIG_OUTPUT_FORMAT="elf32-csky-big" -LITTLE_OUTPUT_FORMAT="elf32-csky-little" -NO_REL_RELOCS=yes -TARGET_PAGE_SIZE=0x400 -MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" +. ${srcdir}/emulparams/cskyelf.sh + +unset EMBEDDED +unset ENTRY COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" -CHECK_RELOCS_AFTER_OPEN_INPUT=yes -TEXT_START_ADDR=0x8000 -NONPAGED_TEXT_START_ADDR=0 -ARCH=csky GENERATE_SHLIB_SCRIPT=yes GENERATE_PIE_SCRIPT=yes - -# There is a problem with the NOP value - it must work for both -# big endian and little endian systems. Unfortunately there is -# no symmetrical mcore opcode that functions as a noop. The -# chosen solution is to use "tst r0, r14". This is a symmetrical -# value, and apart from the corruption of the C bit, it has no other -# side effects. Since the carry bit is never tested without being -# explicitly set first, and since the NOP code is only used as a -# fill value between independently viable pieces of code, it should -# not matter. -NOP=0 - -OTHER_BSS_SYMBOLS="__bss_start__ = . ;" -OTHER_BSS_END_SYMBOLS="__bss_end__ = . ;" - -# This sets the stack to the top of the simulator memory (2^19 bytes). -# STACK_ADDR=0x80000 - -TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes GENERATE_COMBRELOC_SCRIPT=yes -EXTRA_EM_FILE=cskyelf diff --git a/ld/emulparams/elf32mcore.sh b/ld/emulparams/elf32mcore.sh index 8a09bba..ee98812 100644 --- a/ld/emulparams/elf32mcore.sh +++ b/ld/emulparams/elf32mcore.sh @@ -3,7 +3,6 @@ OUTPUT_FORMAT="elf32-mcore-little" BIG_OUTPUT_FORMAT="elf32-mcore-big" LITTLE_OUTPUT_FORMAT="elf32-mcore-little" NO_REL_RELOCS=yes -PAGE_SIZE=0x1000 TARGET_PAGE_SIZE=0x400 MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" TEXT_START_ADDR=0 diff --git a/ld/emulparams/elf32microblaze.sh b/ld/emulparams/elf32microblaze.sh index 8595e2d..116e37d 100644 --- a/ld/emulparams/elf32microblaze.sh +++ b/ld/emulparams/elf32microblaze.sh @@ -1,7 +1,9 @@ +# If you change this file, please also look at files which source this one: +# elf32microblazeel.sh SCRIPT_NAME=elfmicroblaze -OUTPUT_FORMAT="elf32-microblaze" BIG_OUTPUT_FORMAT="elf32-microblaze" LITTLE_OUTPUT_FORMAT="elf32-microblazeel" +OUTPUT_FORMAT=$BIG_OUTPUT_FORMAT #TEXT_START_ADDR=0 NONPAGED_TEXT_START_ADDR=0x28 ALIGNMENT=4 @@ -13,7 +15,6 @@ NOP=0x80000000 # Hmmm, there's got to be a better way. This sets the stack to the # top of the simulator memory (2^19 bytes). -#PAGE_SIZE=0x1000 #DATA_ADDR=0x10000 #OTHER_RELOCATING_SECTIONS='.stack 0x7000 : { _stack = .; *(.stack) }' #$@{RELOCATING+ PROVIDE (__stack = 0x7000);@} diff --git a/ld/emulparams/elf32microblazeel.sh b/ld/emulparams/elf32microblazeel.sh index 86268b0..14f3b3b 100644 --- a/ld/emulparams/elf32microblazeel.sh +++ b/ld/emulparams/elf32microblazeel.sh @@ -1,23 +1,2 @@ -SCRIPT_NAME=elfmicroblaze -OUTPUT_FORMAT="elf32-microblazeel" -BIG_OUTPUT_FORMAT="elf32-microblaze" -LITTLE_OUTPUT_FORMAT="elf32-microblazeel" -#TEXT_START_ADDR=0 -NONPAGED_TEXT_START_ADDR=0x28 -ALIGNMENT=4 -MAXPAGESIZE=4 -ARCH=microblaze -EMBEDDED=yes - -NOP=0x80000000 - -# Hmmm, there's got to be a better way. This sets the stack to the -# top of the simulator memory (2^19 bytes). -#PAGE_SIZE=0x1000 -#DATA_ADDR=0x10000 -#OTHER_RELOCATING_SECTIONS='.stack 0x7000 : { _stack = .; *(.stack) }' -#$@{RELOCATING+ PROVIDE (__stack = 0x7000);@} -#OTHER_RELOCATING_SECTIONS='PROVIDE (_stack = _end + 0x1000);' - -TEMPLATE_NAME=elf32 -#GENERATE_SHLIB_SCRIPT=yes +. ${srcdir}/emulparams/elf32microblaze.sh +OUTPUT_FORMAT=$LITTLE_OUTPUT_FORMAT |