diff options
author | Sandra Loosemore <sloosemore@baylibre.com> | 2024-11-26 19:13:07 +0000 |
---|---|---|
committer | Sandra Loosemore <sloosemore@baylibre.com> | 2024-11-26 19:13:07 +0000 |
commit | e7a16d9fd65098045ef5959bf98d990f12314111 (patch) | |
tree | e153d6439138061de1da42cadae64f7c1f5fafb9 /ld | |
parent | 7b55df8eff6f750c1226f87db57f2e6546638b12 (diff) | |
download | gdb-e7a16d9fd65098045ef5959bf98d990f12314111.zip gdb-e7a16d9fd65098045ef5959bf98d990f12314111.tar.gz gdb-e7a16d9fd65098045ef5959bf98d990f12314111.tar.bz2 |
nios2: Remove binutils support for Nios II target.
The Nios II architecture has been EOL'ed by the vendor. This patch
removes all binutils, bfd, gas, binutils, and opcodes support for this
target with the exception of the readelf utility. (The ELF EM_*
number remains valid and the relocation definitions from the Nios II
ABI will never change in future, so retaining the readelf support
seems consistent with its purpose as a utility that tries to parse the
headers in any ELF file provided as an argument regardless of target.)
Diffstat (limited to 'ld')
74 files changed, 4 insertions, 1375 deletions
diff --git a/ld/Makefile.am b/ld/Makefile.am index 6a9833e..a7fb6e1 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -333,8 +333,6 @@ ALL_EMULATION_SOURCES = \ ends32elf.c \ ends32elf16m.c \ ends32elf_linux.c \ - enios2elf.c \ - enios2linux.c \ ens32knbsd.c \ epc532macha.c \ epdp11.c \ diff --git a/ld/Makefile.in b/ld/Makefile.in index 8639e78..666e375 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -844,8 +844,6 @@ ALL_EMULATION_SOURCES = \ ends32elf.c \ ends32elf16m.c \ ends32elf_linux.c \ - enios2elf.c \ - enios2linux.c \ ens32knbsd.c \ epc532macha.c \ epdp11.c \ @@ -1543,8 +1541,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ends32elf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ends32elf16m.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ends32elf_linux.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enios2elf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enios2linux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ens32knbsd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epc532macha.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epdp11.Po@am__quote@ @@ -1,5 +1,8 @@ -*- text -*- +* Support for Nios II target has been removed, as this architecture has been + EOL'ed by Intel. + Changes in 2.44: * Add --image-base=<ADDR> option to the ELF linker to behave the same diff --git a/ld/configure.tgt b/ld/configure.tgt index 74ddac4..b5f272e 100644 --- a/ld/configure.tgt +++ b/ld/configure.tgt @@ -670,10 +670,6 @@ nds32*le-*-linux-gnu*) targ_emul=nds32elf_linux ;; nds32*be-*-linux-gnu*) targ_emul=nds32belf_linux ;; -nios2*-*-linux*) targ_emul=nios2linux - ;; -nios2*-*-*) targ_emul=nios2elf - ;; ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha targ_extra_ofiles= ;; diff --git a/ld/emulparams/nios2elf.sh b/ld/emulparams/nios2elf.sh deleted file mode 100644 index 9097944..0000000 --- a/ld/emulparams/nios2elf.sh +++ /dev/null @@ -1,19 +0,0 @@ -SCRIPT_NAME=elf -TEMPLATE_NAME=elf -EXTRA_EM_FILE=nios2elf -OUTPUT_FORMAT="elf32-littlenios2" -LITTLE_OUTPUT_FORMAT="elf32-littlenios2" -BIG_OUTPUT_FORMAT="elf32-bignios2" -TEXT_START_ADDR=0x1000 -OTHER_GOT_SYMBOLS=' - _gp = ALIGN(16) + 0x7ff0; - PROVIDE(gp = _gp); -' -ARCH=nios2 -MACHINE= -MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" -COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" -ENTRY=_start -NOP=0x0001883a - -GENERATE_PIE_SCRIPT=yes diff --git a/ld/emulparams/nios2linux.sh b/ld/emulparams/nios2linux.sh deleted file mode 100644 index 2c04d06..0000000 --- a/ld/emulparams/nios2linux.sh +++ /dev/null @@ -1,20 +0,0 @@ -SCRIPT_NAME=elf -TEMPLATE_NAME=elf -EXTRA_EM_FILE="nios2elf" -OUTPUT_FORMAT="elf32-littlenios2" -LITTLE_OUTPUT_FORMAT="elf32-littlenios2" -BIG_OUTPUT_FORMAT="elf32-bignios2" -TEXT_START_ADDR=0x2000 -OTHER_GOT_SYMBOLS=' - HIDDEN (_gp = ALIGN(16) + 0x7ff0); - PROVIDE_HIDDEN (gp = _gp); -' -ARCH=nios2 -MACHINE= -MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" -COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" -ENTRY=_start -NOP=0x0001883a - -GENERATE_SHLIB_SCRIPT=yes -GENERATE_PIE_SCRIPT=yes diff --git a/ld/emultempl/nios2elf.em b/ld/emultempl/nios2elf.em deleted file mode 100644 index 60c698e..0000000 --- a/ld/emultempl/nios2elf.em +++ /dev/null @@ -1,304 +0,0 @@ -# This shell script emits a C file. -*- C -*- -# Copyright (C) 2013-2024 Free Software Foundation, Inc. -# -# This file is part of GNU Binutils. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -# MA 02110-1301, USA. -# - -# This file is sourced from elf.em, and defines extra Nios II ELF -# specific routines. Taken from metagelf.em. -# -fragment <<EOF - -#include "ldctor.h" -#include "elf32-nios2.h" - - -/* Fake input file for stubs. */ -static lang_input_statement_type *stub_file; - -/* Whether we need to call nios2_layout_sections_again. */ -static int need_laying_out = 0; - - -/* This is called before the input files are opened. We create a new - fake input file to hold the stub sections. */ - -static void -nios2elf_create_output_section_statements (void) -{ - extern const bfd_target nios2_elf32_le_vec, nios2_elf32_be_vec; - - if (link_info.output_bfd->xvec != &nios2_elf32_le_vec - && link_info.output_bfd->xvec != &nios2_elf32_be_vec) - return; - - /* If --no-relax was not explicitly specified by the user, enable - relaxation. If it's not enabled (either explicitly or by default), - we're done, as we won't need to create any stubs. */ - if (!bfd_link_relocatable (&link_info) && RELAXATION_DISABLED_BY_DEFAULT) - ENABLE_RELAXATION; - if (!RELAXATION_ENABLED) - return; - - stub_file = lang_add_input_file ("linker stubs", - lang_input_file_is_fake_enum, - NULL); - stub_file->the_bfd = bfd_create ("linker stubs", link_info.output_bfd); - if (stub_file->the_bfd == NULL - || ! bfd_set_arch_mach (stub_file->the_bfd, - bfd_get_arch (link_info.output_bfd), - bfd_get_mach (link_info.output_bfd))) - { - einfo (_("%F%P: can not create BFD: %E\n")); - return; - } - - stub_file->the_bfd->flags |= BFD_LINKER_CREATED; - ldlang_add_file (stub_file); -} - - -struct hook_stub_info -{ - lang_statement_list_type add; - asection *input_section; -}; - -/* Traverse the linker tree to find the spot where the stub goes. */ - -static bool -hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp, - bool afterp) -{ - lang_statement_union_type *l; - bool ret; - - for (; (l = *lp) != NULL; lp = &l->header.next) - { - switch (l->header.type) - { - case lang_constructors_statement_enum: - ret = hook_in_stub (info, &constructor_list.head, afterp); - if (ret) - return ret; - break; - - case lang_output_section_statement_enum: - ret = hook_in_stub (info, - &l->output_section_statement.children.head, - afterp); - if (ret) - return ret; - break; - - case lang_wild_statement_enum: - ret = hook_in_stub (info, &l->wild_statement.children.head, afterp); - if (ret) - return ret; - break; - - case lang_group_statement_enum: - ret = hook_in_stub (info, &l->group_statement.children.head, afterp); - if (ret) - return ret; - break; - - case lang_input_section_enum: - if (l->input_section.section == info->input_section) - { - /* We've found our section. Insert the stub immediately - before or after its associated input section. */ - if (afterp) - { - *(info->add.tail) = l->header.next; - l->header.next = info->add.head; - } - else - { - *lp = info->add.head; - *(info->add.tail) = l; - } - return true; - } - break; - - case lang_data_statement_enum: - case lang_reloc_statement_enum: - case lang_object_symbols_statement_enum: - case lang_output_statement_enum: - case lang_target_statement_enum: - case lang_input_statement_enum: - case lang_assignment_statement_enum: - case lang_padding_statement_enum: - case lang_address_statement_enum: - case lang_fill_statement_enum: - break; - - default: - FAIL (); - break; - } - } - return false; -} - -/* Call-back for elf32_nios2_size_stubs. */ - -/* Create a new stub section, and arrange for it to be linked - immediately before or after INPUT_SECTION, according to AFTERP. */ - -static asection * -nios2elf_add_stub_section (const char *stub_sec_name, asection *input_section, - bool afterp) -{ - asection *stub_sec; - flagword flags; - asection *output_section; - const char *secname; - lang_output_section_statement_type *os; - struct hook_stub_info info; - - flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE - | SEC_HAS_CONTENTS | SEC_RELOC | SEC_IN_MEMORY | SEC_KEEP); - stub_sec = bfd_make_section_anyway_with_flags (stub_file->the_bfd, - stub_sec_name, flags); - if (stub_sec == NULL) - goto err_ret; - - output_section = input_section->output_section; - secname = bfd_section_name (output_section); - os = lang_output_section_find (secname); - - info.input_section = input_section; - lang_list_init (&info.add); - lang_add_section (&info.add, stub_sec, NULL, NULL, os); - - if (info.add.head == NULL) - goto err_ret; - - if (hook_in_stub (&info, &os->children.head, afterp)) - return stub_sec; - - err_ret: - einfo (_("%X%P: can not make stub section: %E\n")); - return NULL; -} - - -/* Another call-back for elf32_nios2_size_stubs. */ - -static void -nios2elf_layout_sections_again (void) -{ - /* If we have changed sizes of the stub sections, then we need - to recalculate all the section offsets. This may mean we need to - add even more stubs. */ - ldelf_map_segments (true); - need_laying_out = -1; -} - - -static void -build_section_lists (lang_statement_union_type *statement) -{ - if (statement->header.type == lang_input_section_enum) - { - asection *i = statement->input_section.section; - - if (i->sec_info_type != SEC_INFO_TYPE_JUST_SYMS - && (i->flags & SEC_EXCLUDE) == 0 - && i->output_section != NULL - && i->output_section->owner == link_info.output_bfd) - { - nios2_elf32_next_input_section (&link_info, i); - } - } -} - - -/* For Nios II we use this opportunity to build linker stubs. */ - -static void -gld${EMULATION_NAME}_after_allocation (void) -{ - int ret; - - /* bfd_elf_discard_info just plays with data and debugging sections, - ie. doesn't affect code size, so we can delay resizing the - sections. It's likely we'll resize everything in the process of - adding stubs. */ - ret = bfd_elf_discard_info (link_info.output_bfd, &link_info); - if (ret < 0) - { - einfo (_("%X%P: .eh_frame/.stab edit: %E\n")); - return; - } - else if (ret > 0) - need_laying_out = 1; - - /* If generating a relocatable output file, then we don't - have to examine the relocs. */ - if (stub_file != NULL - && !bfd_link_relocatable (&link_info) - && RELAXATION_ENABLED) - { - ret = nios2_elf32_setup_section_lists (link_info.output_bfd, &link_info); - if (ret != 0) - { - if (ret < 0) - { - einfo (_("%X%P: can not size stub section: %E\n")); - return; - } - - lang_for_each_statement (build_section_lists); - - /* Call into the BFD backend to do the real work. */ - if (! nios2_elf32_size_stubs (link_info.output_bfd, - stub_file->the_bfd, - &link_info, - &nios2elf_add_stub_section, - &nios2elf_layout_sections_again)) - { - einfo (_("%X%P: can not size stub section: %E\n")); - return; - } - } - } - - if (need_laying_out != -1) - ldelf_map_segments (need_laying_out); - - if (!bfd_link_relocatable (&link_info) && RELAXATION_ENABLED) - { - /* Now build the linker stubs. */ - if (stub_file != NULL && stub_file->the_bfd->sections != NULL) - { - if (! nios2_elf32_build_stubs (&link_info)) - einfo (_("%X%P: can not build stubs: %E\n")); - } - } -} - -EOF - - -# Put these extra nios2elf routines in ld_${EMULATION_NAME}_emulation -# -LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation -LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=nios2elf_create_output_section_statements diff --git a/ld/gen-doc.texi b/ld/gen-doc.texi index b6ffb9f..6f86530 100644 --- a/ld/gen-doc.texi +++ b/ld/gen-doc.texi @@ -18,7 +18,6 @@ @set MMIX @set MSP430 @set NDS32 -@set NIOSII @set PDP11 @set POWERPC @set POWERPC64 @@ -30,7 +30,6 @@ @set MMIX @set MSP430 @set NDS32 -@set NIOSII @set PDP11 @set POWERPC @set POWERPC64 @@ -2406,9 +2405,6 @@ This option is only supported on a few targets. @ifset M68HC11 @xref{M68HC11/68HC12,,@command{ld} and the 68HC11 and 68HC12}. @end ifset -@ifset NIOSII -@xref{Nios II,,@command{ld} and the Altera Nios II}. -@end ifset @ifset POWERPC @xref{PowerPC ELF32,,@command{ld} and PowerPC 32-bit ELF Support}. @end ifset @@ -7748,9 +7744,6 @@ functionality are not listed. @ifset NDS32 * NDS32:: @command{ld} and NDS32 @end ifset -@ifset NIOSII -* Nios II:: @command{ld} and the Altera Nios II -@end ifset @ifset POWERPC * PowerPC ELF32:: @command{ld} and PowerPC 32-bit ELF Support @end ifset @@ -8456,43 +8449,6 @@ Avoid generating the IFC instruction inside the loop. @end ifclear @end ifset -@ifset NIOSII -@ifclear GENERIC -@raisesections -@end ifclear - -@node Nios II -@section @command{ld} and the Altera Nios II -@cindex Nios II call relaxation -@kindex --relax on Nios II - -Call and immediate jump instructions on Nios II processors are limited to -transferring control to addresses in the same 256MB memory segment, -which may result in @command{ld} giving -@samp{relocation truncated to fit} errors with very large programs. -The command-line option @option{--relax} enables the generation of -trampolines that can access the entire 32-bit address space for calls -outside the normal @code{call} and @code{jmpi} address range. These -trampolines are inserted at section boundaries, so may not themselves -be reachable if an input section and its associated call trampolines are -larger than 256MB. - -The @option{--relax} option is enabled by default unless @option{-r} -is also specified. You can disable trampoline generation by using the -@option{--no-relax} linker option. You can also disable this optimization -locally by using the @samp{set .noat} directive in assembly-language -source files, as the linker-inserted trampolines use the @code{at} -register as a temporary. - -Note that the linker @option{--relax} option is independent of assembler -relaxation options, and that using the GNU assembler's @option{-relax-all} -option interferes with the linker's more selective call instruction relaxation. - -@ifclear GENERIC -@lowersections -@end ifclear -@end ifset - @ifset POWERPC @ifclear GENERIC @raisesections diff --git a/ld/testsuite/ld-elf/binutils.exp b/ld/testsuite/ld-elf/binutils.exp index 578276e..405b9ca 100644 --- a/ld/testsuite/ld-elf/binutils.exp +++ b/ld/testsuite/ld-elf/binutils.exp @@ -93,7 +93,6 @@ proc binutils_test { prog_name ld_options test {test_name ""} {readelf_options " || [istarget "hppa*-*-openbsd*"] \ || [istarget "metag-*-*"] \ || [istarget "mips*-*-*"] \ - || [istarget "nios2*-*-*"] \ || [istarget "or1k-*-*"] \ || [istarget "sh*-*-*"] \ || [istarget "x86_64-*-rdos*"])] diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp index 831dfae..3be2be7 100644 --- a/ld/testsuite/ld-elf/elf.exp +++ b/ld/testsuite/ld-elf/elf.exp @@ -216,7 +216,6 @@ proc target_defaults_to_execstack {} { || [istarget "ia64*-*-*"] || [istarget "kvx*-*-*"] || [istarget "loongarch*-*-*"] - || [istarget "nios2*-*-*"] || [istarget "powerpc64*-*-*"] || [istarget "pru*-*-*"] || [istarget "riscv*-*-*"] diff --git a/ld/testsuite/ld-elf/tls.exp b/ld/testsuite/ld-elf/tls.exp index 63796cc..8bb870f 100644 --- a/ld/testsuite/ld-elf/tls.exp +++ b/ld/testsuite/ld-elf/tls.exp @@ -75,5 +75,5 @@ if [file exists tmpdir/pr22263-1] { "pr22263-1" \ "" \ ] \ - ] ia64-*-* m68*-*-* nios2-*-* s390-*-* sh*-*-* + ] ia64-*-* m68*-*-* s390-*-* sh*-*-* } diff --git a/ld/testsuite/ld-elfcomm/elfcomm.exp b/ld/testsuite/ld-elfcomm/elfcomm.exp index 582991f..ced9a4b 100644 --- a/ld/testsuite/ld-elfcomm/elfcomm.exp +++ b/ld/testsuite/ld-elfcomm/elfcomm.exp @@ -166,9 +166,6 @@ proc stt_common_test { options testname } { # Explicitly use "-fcommon" so that even if $CFLAGS includes # "-fno-common", these tests are compiled as expected. set options "-fcommon $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" -if [istarget nios2*-*-*] { - append options " -G0" -} if { ![ld_compile "$CC_FOR_TARGET $options" $srcdir/$subdir/common1a.c tmpdir/common1a.o] || ![ld_compile "$CC_FOR_TARGET $options" $srcdir/$subdir/common1b.c tmpdir/common1b.o] || ![ld_compile "$CC_FOR_TARGET $options -Wa,--elf-stt-common=yes" $srcdir/$subdir/common1b.c tmpdir/common1c.o] } { diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp index 14d0a87..685b406 100644 --- a/ld/testsuite/ld-ifunc/ifunc.exp +++ b/ld/testsuite/ld-ifunc/ifunc.exp @@ -38,7 +38,6 @@ if { ![is_elf_format] || ![supports_gnu_osabi] || [istarget mips*-*-*] || [istarget mn10300-*-*] || [istarget nds32*-*-*] - || [istarget nios2-*-*] || [istarget or1k-*-*] || [istarget score*-*-*] || [istarget sh*-*-*] diff --git a/ld/testsuite/ld-nios2/emit-relocs-1.d b/ld/testsuite/ld-nios2/emit-relocs-1.d deleted file mode 100644 index 5fee105..0000000 --- a/ld/testsuite/ld-nios2/emit-relocs-1.d +++ /dev/null @@ -1,37 +0,0 @@ -#name: Emit relocs 1 -#source: emit-relocs-1a.s -#source: emit-relocs-1b.s -#ld: -q -T emit-relocs-1.ld -#objdump: -sr - -.*: file format .* - -RELOCATION RECORDS FOR \[\.data\]: -OFFSET +TYPE +VALUE -00000000 R_NIOS2_BFD_RELOC32 \.data -00000004 R_NIOS2_BFD_RELOC32 \.data\+0x00001000 -00000008 R_NIOS2_BFD_RELOC32 \.merge1\+0x00000002 -0000000c R_NIOS2_BFD_RELOC32 \.merge2 -00000010 R_NIOS2_BFD_RELOC32 \.merge3 -00000014 R_NIOS2_BFD_RELOC32 \.merge3\+0x00000004 -00000020 R_NIOS2_BFD_RELOC32 \.data\+0x00000020 -00000024 R_NIOS2_BFD_RELOC32 \.data\+0x00001020 -00000028 R_NIOS2_BFD_RELOC32 \.merge1 -0000002c R_NIOS2_BFD_RELOC32 \.merge2\+0x00000002 -00000030 R_NIOS2_BFD_RELOC32 \.merge3\+0x00000008 -00000034 R_NIOS2_BFD_RELOC32 \.merge3\+0x00000004 - - -Contents of section \.text: - 80000 3a880100 00000000 00000000 00000000 .* -Contents of section \.merge1: - 80400 666c7574 74657200 flutter.* -Contents of section \.merge2: - 80800 74617374 696e6700 tasting.* -Contents of section \.merge3: - 80c00 00010000 00020000 00030000 .* -Contents of section \.data: - 81000 00100800 00200800 02040800 00080800 .* - 81010 000c0800 040c0800 00000000 00000000 .* - 81020 20100800 20200800 00040800 02080800 .* - 81030 080c0800 040c0800 .* diff --git a/ld/testsuite/ld-nios2/emit-relocs-1.ld b/ld/testsuite/ld-nios2/emit-relocs-1.ld deleted file mode 100644 index 1879ef4..0000000 --- a/ld/testsuite/ld-nios2/emit-relocs-1.ld +++ /dev/null @@ -1,20 +0,0 @@ -ENTRY(_start) -SECTIONS -{ - . = 0x80000; - .text : { *(.text) } - - . = ALIGN (0x400); - .merge1 : { *(.merge1) } - - . = ALIGN (0x400); - .merge2 : { *(.merge2) } - - . = ALIGN (0x400); - .merge3 : { *(.merge3) } - - . = ALIGN (0x400); - .data : { *(.data) } - - /DISCARD/ : { *(*) } -} diff --git a/ld/testsuite/ld-nios2/emit-relocs-1a.s b/ld/testsuite/ld-nios2/emit-relocs-1a.s deleted file mode 100644 index bf0a8a1..0000000 --- a/ld/testsuite/ld-nios2/emit-relocs-1a.s +++ /dev/null @@ -1,24 +0,0 @@ - .text - .align 4 - .globl _start -_start: - nop - - .section .merge1,"aMS",@progbits,1 -A: .string "utter" - - .section .merge2,"aMS",@progbits,1 -B: .string "tasting" - - .section .merge3,"aM",@progbits,4 -C: .4byte 0x100 -D: .4byte 0x200 - - .data - .align 4 -E: .4byte E - .4byte E + 0x1000 - .4byte A - .4byte B - .4byte C - .4byte D diff --git a/ld/testsuite/ld-nios2/emit-relocs-1b.s b/ld/testsuite/ld-nios2/emit-relocs-1b.s deleted file mode 100644 index 82229c1..0000000 --- a/ld/testsuite/ld-nios2/emit-relocs-1b.s +++ /dev/null @@ -1,18 +0,0 @@ - .section .merge1,"aMS",@progbits,1 -A: .string "flutter" - - .section .merge2,"aMS",@progbits,1 -B: .string "sting" - - .section .merge3,"aM",@progbits,4 -C: .4byte 0x300 -D: .4byte 0x200 - - .data - .align 4 -E: .4byte E - .4byte E + 0x1000 - .4byte A - .4byte B - .4byte C - .4byte D diff --git a/ld/testsuite/ld-nios2/gprel.d b/ld/testsuite/ld-nios2/gprel.d deleted file mode 100644 index 202aece..0000000 --- a/ld/testsuite/ld-nios2/gprel.d +++ /dev/null @@ -1,17 +0,0 @@ -#name: NIOS2 gp-relative relocations -#source: gprel.s -#ld: -#objdump: -dr --prefix-addresses - -# Test the %gprel macro. - -.*: +file format elf32-littlenios2 - -Disassembly of section .text: -[0-9a-f]+ <[^>]*> movui gp,[0-9]+ -[0-9a-f]+ <[^>]*> ldw at,-[0-9]+\(gp\) -[0-9a-f]+ <[^>]*> ldw r2,-[0-9]+\(gp\) -[0-9a-f]+ <[^>]*> ldb r3,-[0-9]+\(gp\) -[0-9a-f]+ <[^>]*> ldw at,-[0-9]+\(gp\) -[0-9a-f]+ <[^>]*> ldw r2,-[0-9]+\(gp\) -[0-9a-f]+ <[^>]*> ldb r3,-[0-9]+\(gp\) diff --git a/ld/testsuite/ld-nios2/gprel.s b/ld/testsuite/ld-nios2/gprel.s deleted file mode 100644 index 2414722..0000000 --- a/ld/testsuite/ld-nios2/gprel.s +++ /dev/null @@ -1,29 +0,0 @@ -.set noat - -.sdata - -sym1: -.long 0xdead -sym2: -.long 0xbeef -sym3: -.byte 0x7f - -.section .sbss, "w" -sym4: -.long 0 -sym5: -.long 0 -sym6: -.byte 0 - -.text -.global _start -_start: - movui gp, _gp - ldw r1, %gprel(sym1)(gp) - ldw r2, %gprel(sym2)(gp) - ldb r3, %gprel(sym3)(gp) - ldw r1, %gprel(sym4)(gp) - ldw r2, %gprel(sym5)(gp) - ldb r3, %gprel(sym6)(gp) diff --git a/ld/testsuite/ld-nios2/hilo16.d b/ld/testsuite/ld-nios2/hilo16.d deleted file mode 100644 index c703413..0000000 --- a/ld/testsuite/ld-nios2/hilo16.d +++ /dev/null @@ -1,13 +0,0 @@ -#name: NIOS2 R_NIOS2_HI16,LO16,HIADJ16 -#source: hilo16.s -#source: hilo16_symbol.s -#ld: -#objdump: -dr --prefix-addresses - -# Test the %hi, %lo and %hiadi relocations -.*: +file format elf32-littlenios2 - -Disassembly of section .text: -[0-9a-f]+ <[^>]*> addi at,at,-8531 -[0-9a-f]+ <[^>]*> addi at,at,-16657 -[0-9a-f]+ <[^>]*> addi at,at,-8530 diff --git a/ld/testsuite/ld-nios2/hilo16.s b/ld/testsuite/ld-nios2/hilo16.s deleted file mode 100644 index 47b404f1..0000000 --- a/ld/testsuite/ld-nios2/hilo16.s +++ /dev/null @@ -1,10 +0,0 @@ -# Test the %hi, lo and %hiadj relocations - -.set noat - -.text -.global _start -_start: - addi r1, r1, %hi(long_symbol) - addi r1, r1, %lo(long_symbol) - addi r1, r1, %hiadj(long_symbol) diff --git a/ld/testsuite/ld-nios2/hilo16_symbol.s b/ld/testsuite/ld-nios2/hilo16_symbol.s deleted file mode 100644 index 88fdddc..0000000 --- a/ld/testsuite/ld-nios2/hilo16_symbol.s +++ /dev/null @@ -1,3 +0,0 @@ -.global long_symbol -.set long_symbol, 0xDEADBEEF - diff --git a/ld/testsuite/ld-nios2/imm5.d b/ld/testsuite/ld-nios2/imm5.d deleted file mode 100644 index 2640c9c..0000000 --- a/ld/testsuite/ld-nios2/imm5.d +++ /dev/null @@ -1,13 +0,0 @@ -#name: NIOS2 R_NIOS2_IMM5 -#source: imm5.s -#source: imm5_symbol.s -#ld: -#objdump: -dr --prefix-addresses - -# Test the branch instructions. -.*: +file format elf32-littlenios2 - -Disassembly of section .text: -[0-9a-f]+ <[^>]*> roli at,at,31 -[0-9a-f]+ <.[^>]*> Address 0x[0-9a-f]+ is out of bounds. - diff --git a/ld/testsuite/ld-nios2/imm5.s b/ld/testsuite/ld-nios2/imm5.s deleted file mode 100644 index 21bbfc3..0000000 --- a/ld/testsuite/ld-nios2/imm5.s +++ /dev/null @@ -1,9 +0,0 @@ -# Test the imm5 relocation - -.set noat -.text -.global _start -_start: - roli r1, r1, imm5 - - diff --git a/ld/testsuite/ld-nios2/imm5_symbol.s b/ld/testsuite/ld-nios2/imm5_symbol.s deleted file mode 100644 index d988951..0000000 --- a/ld/testsuite/ld-nios2/imm5_symbol.s +++ /dev/null @@ -1,4 +0,0 @@ -.global imm5 -.text -.byte imm5 -.set imm5, 31 diff --git a/ld/testsuite/ld-nios2/mixed1a.d b/ld/testsuite/ld-nios2/mixed1a.d deleted file mode 100644 index 0c7d666..0000000 --- a/ld/testsuite/ld-nios2/mixed1a.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 mixed1a -#source: mixed1a.s -#as: -march=r2 -#readelf: -h - -ELF Header: -#... - Flags: 0x1 -#... diff --git a/ld/testsuite/ld-nios2/mixed1a.s b/ld/testsuite/ld-nios2/mixed1a.s deleted file mode 100644 index 8742f1c..0000000 --- a/ld/testsuite/ld-nios2/mixed1a.s +++ /dev/null @@ -1,9 +0,0 @@ -# Test linking incompatible object file types. - -.text -.global _start -_start: - movhi r2, %hiadj(foo) - addi r2, r2, %lo(foo) - ldw r2, 0(r2) - cmpeq r2, r2, zero diff --git a/ld/testsuite/ld-nios2/mixed1b.d b/ld/testsuite/ld-nios2/mixed1b.d deleted file mode 100644 index a702c5a..0000000 --- a/ld/testsuite/ld-nios2/mixed1b.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 mixed1b -#source: mixed1b.s -#as: -march=r1 -#readelf: -h - -ELF Header: -#... - Flags: 0x0 -#... diff --git a/ld/testsuite/ld-nios2/mixed1b.s b/ld/testsuite/ld-nios2/mixed1b.s deleted file mode 100644 index 0d07590..0000000 --- a/ld/testsuite/ld-nios2/mixed1b.s +++ /dev/null @@ -1,3 +0,0 @@ -# Test linking incompatible object file types. - -.comm foo,4,4 diff --git a/ld/testsuite/ld-nios2/nios2.exp b/ld/testsuite/ld-nios2/nios2.exp deleted file mode 100644 index c7860a4..0000000 --- a/ld/testsuite/ld-nios2/nios2.exp +++ /dev/null @@ -1,28 +0,0 @@ -if { ! [istarget nios2-*-*] } { - return -} - -foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.d]] { - run_dump_test [file rootname $test] -} - -set test_name "NIOS2 Mixed R1 and R2 objects" -set test mixed1 - -if ![ld_assemble $as "-march=r1 $srcdir/$subdir/${test}a.s" tmpdir/${test}a.o] { - fail "Build mixed1a.o" - return -} - -if ![ld_assemble $as "-march=r2 $srcdir/$subdir/${test}b.s" tmpdir/${test}b.o] { - fail "Build mixed1b.o" - return -} - -if { ![ld_link $ld tmpdir/$test "tmpdir/${test}a.o tmpdir/${test}b.o"] } { - if [string match "*architecture * is incompatible*" $link_output] { - pass "$test_name" - } { - fail "$test_name" - } -} diff --git a/ld/testsuite/ld-nios2/pcrel16.d b/ld/testsuite/ld-nios2/pcrel16.d deleted file mode 100644 index d4dda2e..0000000 --- a/ld/testsuite/ld-nios2/pcrel16.d +++ /dev/null @@ -1,15 +0,0 @@ -#name: NIOS2 R_NIOS2_PCREL16 -#source: pcrel16.s -#source: pcrel16_label.s -#ld: -#objdump: -dr --prefix-addresses - -# Test the relative branch relocations. -.*: +file format elf32-littlenios2 - -Disassembly of section .text: - -[0-9a-f]+ <[^>]*> br [0-9a-f]+ <ext_label> -[0-9a-f]+ <[^>]*> br [0-9a-f]+ <ext_label\+0x10> -[0-9a-f]+ <[^>]*> nop -[0-9a-f]+ <[^>]*> nop diff --git a/ld/testsuite/ld-nios2/pcrel16.s b/ld/testsuite/ld-nios2/pcrel16.s deleted file mode 100644 index 61c1c7e..0000000 --- a/ld/testsuite/ld-nios2/pcrel16.s +++ /dev/null @@ -1,8 +0,0 @@ -# Test for pc-relative relocations -.set norelax -.text -.global _start -_start: - br ext_label - br ext_label + 16 - diff --git a/ld/testsuite/ld-nios2/pcrel16_label.s b/ld/testsuite/ld-nios2/pcrel16_label.s deleted file mode 100644 index 3a76612..0000000 --- a/ld/testsuite/ld-nios2/pcrel16_label.s +++ /dev/null @@ -1,5 +0,0 @@ -.text -ext_label: - nop - nop -.global ext_label diff --git a/ld/testsuite/ld-nios2/relax_call26.s b/ld/testsuite/ld-nios2/relax_call26.s deleted file mode 100644 index b3b28df..0000000 --- a/ld/testsuite/ld-nios2/relax_call26.s +++ /dev/null @@ -1,27 +0,0 @@ -# test for call26 relaxation via linker stubs - -.globl text0 -.section text0, "ax", @progbits - call func0 # in same section - call func1 # in nearby section - call func2a # in distant section - jmpi func2b # also in distant section - -func0: - ret - -.section text1, "ax", @progbits -func1: - nop - nop - call func2a # in distant section - ret - -.section text2, "ax", @progbits -func2a: - nop - nop - nop - ret -func2b: - nop diff --git a/ld/testsuite/ld-nios2/relax_call26_boundary.ld b/ld/testsuite/ld-nios2/relax_call26_boundary.ld deleted file mode 100644 index 313ef8c..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_boundary.ld +++ /dev/null @@ -1,14 +0,0 @@ -/* Simple script for testing call26 relaxation via linker stubs. - This script is used for a bunch of tests that vary the placement of - section text0 near a 256 memory segment boundary, by using - --section-start command-line options. */ - -OUTPUT_FORMAT("elf32-littlenios2", "elf32-littlenios2", "elf32-littlenios2") -OUTPUT_ARCH(nios2) -ENTRY(_start) -SECTIONS -{ - _start = .; - text0 : { *(text0) *(text1) } - text2 0x40000000 : { *(text2) } -} diff --git a/ld/testsuite/ld-nios2/relax_call26_boundary.s b/ld/testsuite/ld-nios2/relax_call26_boundary.s deleted file mode 100644 index ce79ebd..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_boundary.s +++ /dev/null @@ -1,29 +0,0 @@ -# Test for call26 relaxation via linker stubs. -# This .s file is used with several different linker scripts that vary the -# placement of the sections in the output. -# Section text0 is 32 bytes long and requires at least 2 linker stubs -# (12 bytes each) to reach the call destinations in text2. Another stub -# may be required to reach func0 if the section is laid out so that it crosses -# a 256MB memory segment boundary. - -.globl text0 -.section text0, "ax", @progbits - call func0 # in same section - call func2a # in distant section - nop - nop - nop - nop - jmpi func2b # in distant section - -func0: - ret - -.section text2, "ax", @progbits -func2a: - nop - nop - nop - ret -func2b: - nop diff --git a/ld/testsuite/ld-nios2/relax_call26_boundary_c8.d b/ld/testsuite/ld-nios2/relax_call26_boundary_c8.d deleted file mode 100644 index 61fd858..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_boundary_c8.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 relax_call26_boundary_c8 -#ld: --relax -Trelax_call26_boundary.ld --section-start=text0=0x0fffffc8 -#source: relax_call26_boundary.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs. We don't need to -# check the exact layout of stubs for this test, only verify that it -# links without "relocation truncated to fit" errors. - -#pass diff --git a/ld/testsuite/ld-nios2/relax_call26_boundary_cc.d b/ld/testsuite/ld-nios2/relax_call26_boundary_cc.d deleted file mode 100644 index c3a571a..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_boundary_cc.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 relax_call26_boundary_cc -#ld: --relax -Trelax_call26_boundary.ld --section-start=text0=0x0fffffcc -#source: relax_call26_boundary.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs. We don't need to -# check the exact layout of stubs for this test, only verify that it -# links without "relocation truncated to fit" errors. - -#pass diff --git a/ld/testsuite/ld-nios2/relax_call26_boundary_d0.d b/ld/testsuite/ld-nios2/relax_call26_boundary_d0.d deleted file mode 100644 index 67f28ce..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_boundary_d0.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 relax_call26_boundary_d0 -#ld: --relax -Trelax_call26_boundary.ld --section-start=text0=0x0fffffd0 -#source: relax_call26_boundary.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs. We don't need to -# check the exact layout of stubs for this test, only verify that it -# links without "relocation truncated to fit" errors. - -#pass diff --git a/ld/testsuite/ld-nios2/relax_call26_boundary_d4.d b/ld/testsuite/ld-nios2/relax_call26_boundary_d4.d deleted file mode 100644 index 9ffdf0e..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_boundary_d4.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 relax_call26_boundary_d4 -#ld: --relax -Trelax_call26_boundary.ld --section-start=text0=0x0fffffd4 -#source: relax_call26_boundary.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs. We don't need to -# check the exact layout of stubs for this test, only verify that it -# links without "relocation truncated to fit" errors. - -#pass diff --git a/ld/testsuite/ld-nios2/relax_call26_boundary_d8.d b/ld/testsuite/ld-nios2/relax_call26_boundary_d8.d deleted file mode 100644 index 168d532..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_boundary_d8.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 relax_call26_boundary_d8 -#ld: --relax -Trelax_call26_boundary.ld --section-start=text0=0x0fffffd8 -#source: relax_call26_boundary.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs. We don't need to -# check the exact layout of stubs for this test, only verify that it -# links without "relocation truncated to fit" errors. - -#pass diff --git a/ld/testsuite/ld-nios2/relax_call26_boundary_dc.d b/ld/testsuite/ld-nios2/relax_call26_boundary_dc.d deleted file mode 100644 index 539051e..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_boundary_dc.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 relax_call26_boundary_dc -#ld: --relax -Trelax_call26_boundary.ld --section-start=text0=0x0fffffdc -#source: relax_call26_boundary.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs. We don't need to -# check the exact layout of stubs for this test, only verify that it -# links without "relocation truncated to fit" errors. - -#pass diff --git a/ld/testsuite/ld-nios2/relax_call26_boundary_f0.d b/ld/testsuite/ld-nios2/relax_call26_boundary_f0.d deleted file mode 100644 index fe83151..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_boundary_f0.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 relax_call26_boundary_f0 -#ld: --relax -Trelax_call26_boundary.ld --section-start=text0=0x0ffffff0 -#source: relax_call26_boundary.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs. We don't need to -# check the exact layout of stubs for this test, only verify that it -# links without "relocation truncated to fit" errors. - -#pass diff --git a/ld/testsuite/ld-nios2/relax_call26_boundary_f4.d b/ld/testsuite/ld-nios2/relax_call26_boundary_f4.d deleted file mode 100644 index 4006ff2..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_boundary_f4.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 relax_call26_boundary_f4 -#ld: --relax -Trelax_call26_boundary.ld --section-start=text0=0x0ffffff4 -#source: relax_call26_boundary.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs. We don't need to -# check the exact layout of stubs for this test, only verify that it -# links without "relocation truncated to fit" errors. - -#pass diff --git a/ld/testsuite/ld-nios2/relax_call26_boundary_f8.d b/ld/testsuite/ld-nios2/relax_call26_boundary_f8.d deleted file mode 100644 index 10eb654..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_boundary_f8.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 relax_call26_boundary_f8 -#ld: --relax -Trelax_call26_boundary.ld --section-start=text0=0x0ffffff8 -#source: relax_call26_boundary.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs. We don't need to -# check the exact layout of stubs for this test, only verify that it -# links without "relocation truncated to fit" errors. - -#pass diff --git a/ld/testsuite/ld-nios2/relax_call26_boundary_fc.d b/ld/testsuite/ld-nios2/relax_call26_boundary_fc.d deleted file mode 100644 index cf93b5a..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_boundary_fc.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 relax_call26_boundary_fc -#ld: --relax -Trelax_call26_boundary.ld --section-start=text0=0x0ffffffc -#source: relax_call26_boundary.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs. We don't need to -# check the exact layout of stubs for this test, only verify that it -# links without "relocation truncated to fit" errors. - -#pass diff --git a/ld/testsuite/ld-nios2/relax_call26_cache.d b/ld/testsuite/ld-nios2/relax_call26_cache.d deleted file mode 100644 index 43121c0..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_cache.d +++ /dev/null @@ -1,9 +0,0 @@ -#name: NIOS2 relax_call26_cache -#ld: --relax -Trelax_call26_cache.ld -#source: relax_call26_cache.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs. We don't need to -# check the exact layout of stubs for this test, only verify that it -# links without "relocation truncated to fit" errors. - -#pass diff --git a/ld/testsuite/ld-nios2/relax_call26_cache.ld b/ld/testsuite/ld-nios2/relax_call26_cache.ld deleted file mode 100644 index d3c4307..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_cache.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* Simple script for testing call26 relaxation via linker stubs. - In this case, input sections text0 and text1 are placed in the - same output section in the same 256MB segment, so they can share stubs. */ - -OUTPUT_FORMAT("elf32-littlenios2", "elf32-littlenios2", "elf32-littlenios2") -OUTPUT_ARCH(nios2) -ENTRY(_start) -SECTIONS -{ - _start = .; - text0 0x0fffffe0 : { *(text0) *(text1) } - text2 0x40000000 : { *(text2) } -} diff --git a/ld/testsuite/ld-nios2/relax_call26_cache.s b/ld/testsuite/ld-nios2/relax_call26_cache.s deleted file mode 100644 index 3712853..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_cache.s +++ /dev/null @@ -1,28 +0,0 @@ -# test for call26 relaxation via linker stubs -# -# The purpose of this test is to ensure that, when section text0 straddles -# a 256MB memory segment boundary with calls to the same function on either -# side, the stub caching doesn't get confused and incorrectly use a stub -# on the wrong side. - -.globl text0 -.section text0, "ax", @progbits - call func2a # in distant section - call func2a # in distant section - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - call func2a # in distant section - call func2a # in distant section - -.section text2, "ax", @progbits -.globl func2a -func2a: - ret diff --git a/ld/testsuite/ld-nios2/relax_call26_multi.d b/ld/testsuite/ld-nios2/relax_call26_multi.d deleted file mode 100644 index 28279ef..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_multi.d +++ /dev/null @@ -1,36 +0,0 @@ -#name: NIOS2 relax_call26_multi -#ld: --relax -Trelax_call26_multi.ld -#source: relax_call26.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs - -.*: +file format elf32-littlenios2 - -Disassembly of section text0: -00000000 <_start> call 00000010 <func0> -00000004 <[^>]*> call 0000002c <func1> -00000008 <[^>]*> call 00000020 <[^>]*> -0000000c <[^>]*> jmpi 00000014 <[^>]*> -00000010 <func0> ret -00000014 <[^>]*> movhi at,16384 -00000018 <[^>]*> addi at,at,16 -0000001c <[^>]*> jmp at -00000020 <[^>]*> movhi at,16384 -00000024 <[^>]*> addi at,at,0 -00000028 <[^>]*> jmp at - -Disassembly of section text1: -0000002c <func1> nop -00000030 <[^>]*> nop -00000034 <[^>]*> call 0000003c <[^>]*> -00000038 <[^>]*> ret -0000003c <[^>]*> movhi at,16384 -00000040 <[^>]*> addi at,at,0 -00000044 <[^>]*> jmp at - -Disassembly of section text2: -40000000 <func2a> nop -40000004 <[^>]*> nop -40000008 <[^>]*> nop -4000000c <[^>]*> ret -40000010 <func2b> nop diff --git a/ld/testsuite/ld-nios2/relax_call26_multi.ld b/ld/testsuite/ld-nios2/relax_call26_multi.ld deleted file mode 100644 index 750f747..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_multi.ld +++ /dev/null @@ -1,14 +0,0 @@ -/* Simple script for testing call26 relaxation via linker stubs. - In this case, input sections text0 and text1 cannot share stubs - because they are in different output sections. */ - -OUTPUT_FORMAT("elf32-littlenios2", "elf32-littlenios2", "elf32-littlenios2") -OUTPUT_ARCH(nios2) -ENTRY(_start) -SECTIONS -{ - _start = .; - text0 0 : { *(text0) } - text1 : { *(text1) } - text2 0x40000000 : { *(text2) } -} diff --git a/ld/testsuite/ld-nios2/relax_call26_norelax.d b/ld/testsuite/ld-nios2/relax_call26_norelax.d deleted file mode 100644 index 7c7371c..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_norelax.d +++ /dev/null @@ -1,5 +0,0 @@ -#name: NIOS2 relax_call26_norelax -#ld: --no-relax -Trelax_call26_multi.ld -#source: relax_call26.s -#error: .*relocation truncated to fit: R_NIOS2_CALL26.* -# Test relaxation of call26 relocations via linker stubs diff --git a/ld/testsuite/ld-nios2/relax_call26_shared.d b/ld/testsuite/ld-nios2/relax_call26_shared.d deleted file mode 100644 index 75ccbca..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_shared.d +++ /dev/null @@ -1,31 +0,0 @@ -#name: NIOS2 relax_call26_shared -#ld: --relax -Trelax_call26_shared.ld -#source: relax_call26.s -#objdump: -dr --prefix-addresses -# Test relaxation of call26 relocations via linker stubs - -.*: +file format elf32-littlenios2 - -Disassembly of section text0: -00000000 <_start> call 00000010 <func0> -00000004 <[^>]*> call 00000014 <func1> -00000008 <[^>]*> call 00000030 <[^>]*> -0000000c <[^>]*> jmpi 00000024 <[^>]*> -00000010 <func0> ret -00000014 <func1> nop -00000018 <[^>]*> nop -0000001c <[^>]*> call 00000030 <[^>]*> -00000020 <[^>]*> ret -00000024 <[^>]*> movhi at,16384 -00000028 <[^>]*> addi at,at,16 -0000002c <[^>]*> jmp at -00000030 <[^>]*> movhi at,16384 -00000034 <[^>]*> addi at,at,0 -00000038 <[^>]*> jmp at - -Disassembly of section text2: -40000000 <func2a> nop -40000004 <[^>]*> nop -40000008 <[^>]*> nop -4000000c <[^>]*> ret -40000010 <func2b> nop diff --git a/ld/testsuite/ld-nios2/relax_call26_shared.ld b/ld/testsuite/ld-nios2/relax_call26_shared.ld deleted file mode 100644 index 6e6fd44..0000000 --- a/ld/testsuite/ld-nios2/relax_call26_shared.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* Simple script for testing call26 relaxation via linker stubs. - In this case, input sections text0 and text1 are placed in the - same output section in the same 256MB segment, so they can share stubs. */ - -OUTPUT_FORMAT("elf32-littlenios2", "elf32-littlenios2", "elf32-littlenios2") -OUTPUT_ARCH(nios2) -ENTRY(_start) -SECTIONS -{ - _start = .; - text0 0 : { *(text0) *(text1) } - text2 0x40000000 : { *(text2) } -} diff --git a/ld/testsuite/ld-nios2/relax_callr.d b/ld/testsuite/ld-nios2/relax_callr.d deleted file mode 100644 index 7d40fe4..0000000 --- a/ld/testsuite/ld-nios2/relax_callr.d +++ /dev/null @@ -1,24 +0,0 @@ -#name: NIOS2 relax_callr -#as: -relax-all -#ld: --relax -Trelax_callr.ld -#source: relax_callr.s -#objdump: -dr --prefix-addresses -# Test relaxation of callr - -.*: +file format elf32-littlenios2 - -Disassembly of section text1: -00000000 <[^>]*> movhi at,2048 -00000004 <[^>]*> ori at,at,0 -00000008 <[^>]*> callr at -0000000c <[^>]*> movhi at,2048 -00000010 <[^>]*> ori at,at,20 -00000014 <[^>]*> callr at - -Disassembly of section text2: -08000000 <func> nop -08000004 <[^>]*> br 08000014 <func1> -08000008 <[^>]*> nop -0800000c <[^>]*> nop -08000010 <[^>]*> nop -08000014 <func1> nop diff --git a/ld/testsuite/ld-nios2/relax_callr.ld b/ld/testsuite/ld-nios2/relax_callr.ld deleted file mode 100644 index bc02d40..0000000 --- a/ld/testsuite/ld-nios2/relax_callr.ld +++ /dev/null @@ -1,11 +0,0 @@ -/* Simple script for testing relaxation */ - -OUTPUT_FORMAT("elf32-littlenios2", "elf32-littlenios2", "elf32-littlenios2") -OUTPUT_ARCH(nios2) -ENTRY(_start) -SECTIONS -{ - _start = .; - text1 0 : { *(text1) } - text2 0x08000000 : { *(text2) } -} diff --git a/ld/testsuite/ld-nios2/relax_callr.s b/ld/testsuite/ld-nios2/relax_callr.s deleted file mode 100644 index b4cc2c4..0000000 --- a/ld/testsuite/ld-nios2/relax_callr.s +++ /dev/null @@ -1,17 +0,0 @@ -# relaxation test for callr - -.globl text1 -.section text1, "ax", @progbits - - call func - call func1 - -.section text2, "ax", @progbits -func: - nop - br func1 - nop - nop - nop -func1: - nop diff --git a/ld/testsuite/ld-nios2/relax_cjmp.d b/ld/testsuite/ld-nios2/relax_cjmp.d deleted file mode 100644 index 535c59d..0000000 --- a/ld/testsuite/ld-nios2/relax_cjmp.d +++ /dev/null @@ -1,38 +0,0 @@ -#name: NIOS2 relax_cjmp -#as: -relax-all -#ld: --relax -Trelax_jmp.ld -#source: relax_cjmp.s -#objdump: -dr --prefix-addresses - -# Test relaxation of conditional jumps - -.*: +file format elf32-littlenios2 - -Disassembly of section text2: -00000000 <[^>]*> bge r2,r3,00008000 <[^>]*> -00000004 <[^>]*> bge r2,r3,00000014 <[^>]*> -00000008 <[^>]*> movhi at,1 -0000000c <[^>]*> ori at,at,24 -00000010 <[^>]*> jmp at -00000014 <[^>]*> bge r3,r2,00000020 <sym> -00000018 <[^>]*> nop -0000001c <[^>]*> nop -00000020 <sym> nop - -Disassembly of section text1: -00008000 <[^>]*> beq r2,r3,00010000 <on_border> -00008004 <[^>]*> bne r2,r3,00008014 <[^>]*> -00008008 <[^>]*> movhi at,1 -0000800c <[^>]*> ori at,at,24 -00008010 <[^>]*> jmp at -00008014 <[^>]*> nop -00008018 <[^>]*> nop -#... -00010000 <on_border> bne r2,r3,00010018 <in_range> -00010004 <[^>]*> nop -00010008 <[^>]*> nop -0001000c <[^>]*> nop -00010010 <[^>]*> nop -00010014 <[^>]*> nop -00010018 <in_range> nop -#pass diff --git a/ld/testsuite/ld-nios2/relax_cjmp.s b/ld/testsuite/ld-nios2/relax_cjmp.s deleted file mode 100644 index af00a1e..0000000 --- a/ld/testsuite/ld-nios2/relax_cjmp.s +++ /dev/null @@ -1,32 +0,0 @@ -# relaxing conditional jumps -- absolute - -.globl text1 -.section text1, "ax", @progbits - beq r2, r3, on_border - beq r2, r3, out_of_range - nop - nop - -.align 15 -on_border: - bne r2, r3, in_range - nop - nop - nop - nop - nop -out_of_range: -in_range: - nop - -.globl text2 -.section text2, "ax", @progbits - - bge r2, r3, text1 - blt r2, r3, out_of_range - ble r2, r3, sym - nop - nop -sym: - nop - diff --git a/ld/testsuite/ld-nios2/relax_jmp.ld b/ld/testsuite/ld-nios2/relax_jmp.ld deleted file mode 100644 index df6c220..0000000 --- a/ld/testsuite/ld-nios2/relax_jmp.ld +++ /dev/null @@ -1,11 +0,0 @@ -/* Simple script for testing relaxation */ - -OUTPUT_FORMAT("elf32-littlenios2", "elf32-littlenios2", "elf32-littlenios2") -OUTPUT_ARCH(nios2) -ENTRY(_start) -SECTIONS -{ - _start = .; - text2 0 : { *(text2) } - text1 0x8000 : { *(text1) } -} diff --git a/ld/testsuite/ld-nios2/relax_section.d b/ld/testsuite/ld-nios2/relax_section.d deleted file mode 100644 index 93980cd..0000000 --- a/ld/testsuite/ld-nios2/relax_section.d +++ /dev/null @@ -1,35 +0,0 @@ -#name: NIOS2 relax_section -#as: -relax-section -#ld: --relax -Trelax_jmp.ld -#source: relax_section.s -#objdump: -dr --prefix-addresses - -# Test relaxation of section - -.*: +file format elf32-littlenios2 - -Disassembly of section text1: -00008000 <[^>]*> bne r2,r3,00008010 <[^>]*> -00008004 <[^>]*> nextpc at -00008008 <[^>]*> addi at,at,32764 -0000800c <[^>]*> jmp at -00008010 <[^>]*> bge r2,r3,00008024 <[^>]*> -00008014 <[^>]*> nextpc at -00008018 <[^>]*> addi at,at,32767 -0000801c <[^>]*> addi at,at,9 -00008020 <[^>]*> jmp at -00008024 <[^>]*> bne r2,r3,00008030 <in_range> -00008028 <[^>]*> nop -0000802c <[^>]*> nop -00008030 <in_range> nop -#... -00010000 <[^>]*> br 00008030 <in_range> -00010004 <just_out_of_range> nop -00010008 <[^>]*> nop -0001000c <[^>]*> nop -00010010 <[^>]*> nop -00010014 <[^>]*> nop -00010018 <[^>]*> nop -0001001c <[^>]*> nop -00010020 <farther_out_of_range> nop -#pass diff --git a/ld/testsuite/ld-nios2/relax_section.s b/ld/testsuite/ld-nios2/relax_section.s deleted file mode 100644 index 0e803d1..0000000 --- a/ld/testsuite/ld-nios2/relax_section.s +++ /dev/null @@ -1,23 +0,0 @@ -# relaxing conditional and unconditional jumps -- pc-relative - -.globl text1 -.section text1, "ax", @progbits - beq r2, r3, just_out_of_range - blt r2, r3, farther_out_of_range - bne r2, r3, in_range - nop - nop -in_range: - nop -.align 15 - br in_range -just_out_of_range: - nop - nop - nop - nop - nop - nop - nop -farther_out_of_range: - nop diff --git a/ld/testsuite/ld-nios2/relax_ujmp.d b/ld/testsuite/ld-nios2/relax_ujmp.d deleted file mode 100644 index 68313c1..0000000 --- a/ld/testsuite/ld-nios2/relax_ujmp.d +++ /dev/null @@ -1,32 +0,0 @@ -#name: NIOS2 relax_ujmp -#as: -relax-all -#ld: --relax -Trelax_jmp.ld -#source: relax_ujmp.s -#objdump: -dr --prefix-addresses - -# Test relaxation of unconditional jumps - -.*: +file format elf32-littlenios2 - -Disassembly of section text2: -00000000 <[^>]*> br 00008000 <[^>]*> -00000004 <[^>]*> movhi at,1 -00000008 <[^>]*> ori at,at,16 -0000000c <[^>]*> jmp at -00000010 <[^>]*> br 0000001c <sym> -00000014 <[^>]*> nop -00000018 <[^>]*> nop -0000001c <sym> nop - -Disassembly of section text1: -00008000 <[^>]*> br 00010000 <on_border> -00008004 <[^>]*> movhi at,1 -00008008 <[^>]*> ori at,at,16 -0000800c <[^>]*> jmp at -#... -00010000 <on_border> br 00010010 <in_range> -00010004 <[^>]*> nop -00010008 <[^>]*> nop -0001000c <[^>]*> nop -00010010 <in_range> nop -#pass diff --git a/ld/testsuite/ld-nios2/relax_ujmp.s b/ld/testsuite/ld-nios2/relax_ujmp.s deleted file mode 100644 index 8982d73..0000000 --- a/ld/testsuite/ld-nios2/relax_ujmp.s +++ /dev/null @@ -1,37 +0,0 @@ -# relaxing unconditional jumps - -.globl text1 -.section text1, "ax", @progbits - - br on_border - br out_of_range - nop - nop - - -.align 15 -# nop -# nop -on_border: - br in_range - nop - nop - nop -out_of_range: -in_range: - nop - -.globl text2 -.section text2, "ax", @progbits - - br text1 - br out_of_range - br sym - nop - nop -sym: - nop - - - - diff --git a/ld/testsuite/ld-nios2/reloc.d b/ld/testsuite/ld-nios2/reloc.d deleted file mode 100644 index cb2959d..0000000 --- a/ld/testsuite/ld-nios2/reloc.d +++ /dev/null @@ -1,10 +0,0 @@ -#name: NIOS2 R_NIOS2_BFD_RELOC_XX -#source: reloc.s -#source: reloc_symbol.s -#ld: -#objdump: -s - -.*: +file format elf32-littlenios2 - -Contents of section .text: - [0-9a-f]+ fa00cefa efbeadde facefaef beadde00 ................ diff --git a/ld/testsuite/ld-nios2/reloc.s b/ld/testsuite/ld-nios2/reloc.s deleted file mode 100644 index 2d555c3..0000000 --- a/ld/testsuite/ld-nios2/reloc.s +++ /dev/null @@ -1,9 +0,0 @@ -# Test for Nios II 32-bit, 16 and 8-bit relocations - -.global byte_sym -.global short_sym -.global long_sym - -.set byte_sym, 0xFA -.set short_sym, 0xFACE -.set long_sym, 0xDEADBEEF diff --git a/ld/testsuite/ld-nios2/reloc_symbol.s b/ld/testsuite/ld-nios2/reloc_symbol.s deleted file mode 100644 index fa7ac95..0000000 --- a/ld/testsuite/ld-nios2/reloc_symbol.s +++ /dev/null @@ -1,24 +0,0 @@ -.text -.global _start -_start: - -# byte aligned -.align 0 -.byte byte_sym - -# short aligned -.align 1 -.short short_sym - -# word aligned -.align 2 -.long long_sym - -# now lets try some unaligned words and halfwords -.byte byte_sym -.2byte short_sym -.4byte long_sym - -#.align 2 -#nop - diff --git a/ld/testsuite/ld-nios2/s16.d b/ld/testsuite/ld-nios2/s16.d deleted file mode 100644 index 6257e18..0000000 --- a/ld/testsuite/ld-nios2/s16.d +++ /dev/null @@ -1,12 +0,0 @@ -#name: NIOS2 R_NIOS2_S16 -#source: s16.s -#source: s16_symbol.s -#ld: -#objdump: -s - -# Test the signed 16-bit relocations. -.*: +file format elf32-littlenios2 - -Contents of section .text: - [0-9a-f]+ 04004408 04006008 c4ff5f08 44004808 ..D...`..._.D.H. - [0-9a-f]+ 44004008 D.@. diff --git a/ld/testsuite/ld-nios2/s16.s b/ld/testsuite/ld-nios2/s16.s deleted file mode 100644 index df13efa..0000000 --- a/ld/testsuite/ld-nios2/s16.s +++ /dev/null @@ -1,16 +0,0 @@ -# Test for Nios II 32-bit, 16 and 8-bit relocations - -.set noat -.set some_other_sym, 0x1000 -.text -.global _start -_start: -# signed 16-bit relocation - addi r1, r1, some_sym - addi r1, r1, min - addi r1, r1, max - addi r1, r1, some_sym + some_other_sym + 1 - addi r1, r1, some_sym - some_other_sym + 1 - - - diff --git a/ld/testsuite/ld-nios2/s16_symbol.s b/ld/testsuite/ld-nios2/s16_symbol.s deleted file mode 100644 index 3902177..0000000 --- a/ld/testsuite/ld-nios2/s16_symbol.s +++ /dev/null @@ -1,10 +0,0 @@ -.global some_sym -.global some_other_sym -.global min -.global max - -.set max, 0x7fff -.set min, -0x8000 -.set some_sym, 0x1000 - - diff --git a/ld/testsuite/ld-nios2/u16.d b/ld/testsuite/ld-nios2/u16.d deleted file mode 100644 index 7d1df05..0000000 --- a/ld/testsuite/ld-nios2/u16.d +++ /dev/null @@ -1,12 +0,0 @@ -#name: NIOS2 R_NIOS2_U16 -#source: u16.s -#source: u16_symbol.s -#ld: -#objdump: -s - -# Test the unsigned 16-bit relocations. -.*: +file format elf32-littlenios2 - -Contents of section .text: - [0-9a-f]+ 0c004408 0c004008 ccff7f08 4c004808 ..D...@.....L.H. - [0-9a-f]+ 4c004008 L.@. diff --git a/ld/testsuite/ld-nios2/u16.s b/ld/testsuite/ld-nios2/u16.s deleted file mode 100644 index b890682..0000000 --- a/ld/testsuite/ld-nios2/u16.s +++ /dev/null @@ -1,16 +0,0 @@ -# Test for Nios II 32-bit, 16 and 8-bit relocations - -.set noat -.set some_other_sym, 0x1000 -.text -.global _start -_start: -# unsigned 16-bit relocation - andi r1, r1, some_sym - andi r1, r1, min - andi r1, r1, max - andi r1, r1, some_sym + some_other_sym + 1 - andi r1, r1, some_sym - some_other_sym + 1 - - - diff --git a/ld/testsuite/ld-nios2/u16_symbol.s b/ld/testsuite/ld-nios2/u16_symbol.s deleted file mode 100644 index 518b4de..0000000 --- a/ld/testsuite/ld-nios2/u16_symbol.s +++ /dev/null @@ -1,9 +0,0 @@ -.global some_sym -.global min -.global max - -.set max, 0xffff -.set min, 0 -.set some_sym, 0x1000 - - |