mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
6927f98292
Add option to offset S12 addresses into XGATE memory space. Tweak target flags to match other tools. (i.e. -m m68hc11). * doc/as.texinfo: Mention new options. * doc/c-m68hc11.texi: Document new options. * NEWS: Mention new support. * archures.c: Add bfd_arch_m9s12x and bfd_arch_m9s12xg. * config.bfd: Likewise. * cpu-m9s12x.c: New. * cpu-m9s12xg.c: New. * elf32-m68hc12.c: Add S12X and XGATE co-processor support. Add option to offset S12 addresses into XGATE memory space. Fix carry bug in IMM16 (IMM8 low/high) relocate. * Makefile.am (ALL_MACHINES): Add cpu-m9s12x and cpu-m9s12xg. (ALL_MACHINES_CFILES): Likewise. * reloc.c: Add S12X relocs. * Makefile.in: Regenerate. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * gas/m68hc11/insns9s12x.s: New * gas/m68hc11/insns9s12x.d: New * gas/m68hc11/hexprefix.s: New * gas/m68hc11/hexprefix.d: New * gas/m68hc11/9s12x-exg-sex-tfr.s: New * gas/m68hc11/9s12x-exg-sex-tfr.d: New * gas/m68hc11/insns9s12xg.s: New * gas/m68hc11/insns9s12xg.d: New * gas/m68hc11/9s12x-mov.s: New * gas/m68hc11/9s12x-mov.d: New * gas/m68hc11/m68hc11.exp: Updated * gas/m68hc11/*.d: Brought in line with changed objdump output. * gas/all/gas.exp: XFAIL all hc11/12 targets for redef2,3. * gas/elf/elf.exp: XFAIL all hc11/12 targets for redef. * gas/elf/dwarf2-1.d: Skip for hc11/12 targets. * gas/elf/dwarf2-2.d: Likewise. * ld-m68hc11/xgate-link.s: New. * ld-m68hc11/xgate-link.d: New. * ld-m68hc11/xgate-offset.s: New. * ld-m68hc11/xgate-offset.d: New. * ld-m68hc11/xgate1.s: New. * ld-m68hc11/xgate1.d: New. * ld-m68hc11/xgate2.s: New. * ld-m68hc11/m68hc11.exp: Updated. * ld-m68hc11/*.d: Brought in line with changed objdump output. * ld-gc/gc.exp: Update CFLAGS for m68hc11. * ld-plugin/plugin.exp: Likewise. * ld-srec/srec.exp: XFAIL for m68hc11 and m68hc12. * configure.in: Add S12X and XGATE co-processor support to m68hc11 target. * disassemble.c: Likewise. * configure: Regenerate. * m68hc11-dis.c: Make objdump output more consistent, use hex instead of decimal and use 0x prefix for hex. * m68hc11-opc.c: Add S12X and XGATE opcodes. * dis-asm.h (print_insn_m9s12x): Prototype. (print_insn_m9s12xg): Prototype. * m68hc11.h (R_M68HC12_16B, R_M68HC12_PCREL_9, R_M68HC12_PCREL_10) R_M68HC12_HI8XG, R_M68HC12_LO8XG): New relocations. (E_M68HC11_XGATE_RAMOFFSET): Define. * m68hc11.h: Add XGate definitions. (struct m68hc11_opcode): Add xg_mask field.
134 lines
4.0 KiB
Plaintext
134 lines
4.0 KiB
Plaintext
# Expect script for ld-gc tests
|
|
# Copyright 2008, 2009, 2010, 2012
|
|
# Free Software Foundation, Inc.
|
|
#
|
|
# This file is part of the 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.
|
|
|
|
# These tests require --gc-sections
|
|
if ![check_gc_sections_available] {
|
|
return
|
|
}
|
|
|
|
set cflags "-ffunction-sections -fdata-sections"
|
|
set objfile "tmpdir/gc.o"
|
|
|
|
if [istarget powerpc64*-*-*] {
|
|
# otherwise with -mcmodel=medium gcc we get XPASSes.
|
|
set cflags "$cflags -mminimal-toc"
|
|
}
|
|
|
|
if { [istarget m681*-*-*] || [istarget m68hc1*-*-*] } {
|
|
# Otherwise tests FAIL due to _.frame
|
|
set cflags "$cflags -fomit-frame-pointer -mshort"
|
|
}
|
|
|
|
if { [is_remote host] || [which $CC] != 0 } {
|
|
ld_compile "$CC -c $CFLAGS $cflags" $srcdir/$subdir/gc.c $objfile
|
|
}
|
|
|
|
proc test_gc { testname filename linker ldflags} {
|
|
global nm
|
|
global srcdir
|
|
global subdir
|
|
global nm_output
|
|
global objfile
|
|
|
|
if ![file readable $objfile ] {
|
|
untested $testname
|
|
return
|
|
}
|
|
|
|
set outfile "tmpdir/$filename"
|
|
set options "-L$srcdir/$subdir"
|
|
append options " " $ldflags " " [ld_simple_link_defsyms] " " $objfile
|
|
|
|
# SH64 targets needs an extra ld option for this test.
|
|
if [istarget sh64*-*-*] {
|
|
if [istarget sh64*l*-*-*] {
|
|
set options "-mshlelf32 $options"
|
|
} else {
|
|
set options "-mshelf32 $options"
|
|
}
|
|
}
|
|
|
|
if ![ld_simple_link $linker $outfile $options] {
|
|
fail $testname
|
|
return
|
|
}
|
|
if ![ld_nm $nm "" $outfile] {
|
|
unresolved $testname
|
|
return
|
|
}
|
|
if {![info exists nm_output(used_func)] \
|
|
|| ![info exists nm_output(used_var)]} {
|
|
send_log "used sections do not exist\n"
|
|
verbose "used sections do not exist"
|
|
fail $testname
|
|
return
|
|
}
|
|
#ppc64_elf_gc_mark_hook needs to be taught how to look through
|
|
#the .toc section to properly mark variable sections for gc.
|
|
setup_xfail "powerpc64*-*-*"
|
|
if {[info exists nm_output(unused_func)] \
|
|
|| [info exists nm_output(unused_var)]} {
|
|
send_log "unused section still here\n"
|
|
verbose "unused section still here"
|
|
fail $testname
|
|
return
|
|
}
|
|
pass $testname
|
|
}
|
|
|
|
test_gc "Check --gc-section" "gcexe" $ld "--gc-sections -e main"
|
|
test_gc "Check --gc-section/-q" "gcrexe" $ld "--gc-sections -q -e main"
|
|
test_gc "Check --gc-section/-r/-e" "gcrel" $ld "-r --gc-sections -e main"
|
|
test_gc "Check --gc-section/-r/-u" "gcrel" $ld "-r --gc-sections -u used_func"
|
|
|
|
run_dump_test "noent"
|
|
run_dump_test "abi-note"
|
|
run_dump_test "start"
|
|
|
|
if { [is_elf_format] && [check_shared_lib_support] } then {
|
|
set gasopt ""
|
|
if { [istarget tic6x-*] } then {
|
|
set gasopt "-mpic -mpid=near"
|
|
}
|
|
if {![ld_assemble_flags $as $gasopt $srcdir/$subdir/libpersonality.s tmpdir/libpersonality.o]
|
|
|| ![ld_simple_link $ld tmpdir/libpersonality.so "-shared tmpdir/libpersonality.o"] } then {
|
|
fail libpersonality
|
|
} else {
|
|
run_dump_test "personality"
|
|
}
|
|
}
|
|
|
|
if { [is_remote host] || [which $CC] != 0 } {
|
|
if { [istarget "*-*-linux*"]
|
|
|| [istarget "*-*-nacl*"]
|
|
|| [istarget "*-*-gnu*"] } {
|
|
ld_compile "$CC -fPIC $CFLAGS $cflags" $srcdir/$subdir/pr11218-1.c tmpdir/pr11218-1.o
|
|
ld_simple_link $ld tmpdir/pr11218-1.so "-shared tmpdir/pr11218-1.o"
|
|
ld_compile "$CC -c $CFLAGS $cflags" $srcdir/$subdir/pr11218-2.c tmpdir/pr11218-2.o
|
|
run_dump_test "pr11218"
|
|
}
|
|
}
|
|
|
|
if { [is_remote host] || [which $CC] != 0 } {
|
|
ld_compile "$CC $CFLAGS $cflags" $srcdir/$subdir/pr13683.c tmpdir/pr13683.o
|
|
run_dump_test "pr13683"
|
|
}
|