Add IP2k support to BFD and LD

This commit is contained in:
Nick Clifton 2002-07-17 14:15:52 +00:00
parent 0dafd5f6a9
commit cf88bb9f09
24 changed files with 2481 additions and 17 deletions

View File

@ -1,3 +1,25 @@
2002-07-15 Denis Chertykov <denisc@overta.ru>
Frank Ch. Eigler <fche@redhat.com>
Ben Elliston <bje@redhat.com>
Alan Lehotsky <alehotsky@cygnus.com>
John Healy <jhealy@redhat.com>
Graham Stott <grahams@redhat.com>
Jeff Johnston <jjohnstn@redhat.com>
* Makefile.am: Add support for ip2k.
* Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.
* archures.c: Add support for ip2k.
* config.bfd: Add support for ip2k.
* configure.in: Add support for ip2k.
* configure: Regenerate.
* reloc.c: Add support for ip2k.
* targets.c: Add support for ip2k.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* cpu-ip2k.c: New file.
* elf32-ip2k.c: New file.
2002-07-17 Ian Rickards <irickard@arm.com>
* dwarf2.c (concat_filename): If we can't establish the directory

View File

@ -67,6 +67,7 @@ ALL_MACHINES = \
cpu-i386.lo \
cpu-i860.lo \
cpu-i960.lo \
cpu-ip2k.lo \
cpu-m32r.lo \
cpu-m68hc11.lo \
cpu-m68hc12.lo \
@ -117,6 +118,7 @@ ALL_MACHINES_CFILES = \
cpu-i386.c \
cpu-i860.c \
cpu-i960.c \
cpu-ip2k.c \
cpu-m32r.c \
cpu-m68hc11.c \
cpu-m68hc12.c \
@ -214,6 +216,7 @@ BFD32_BACKENDS = \
elf32-i860.lo \
elf32-i960.lo \
elf32-ia64.lo \
elf32-ip2k.c \
elf32-m32r.lo \
elf32-m68hc11.lo \
elf32-m68hc12.lo \
@ -370,6 +373,7 @@ BFD32_BACKENDS_CFILES = \
elf32-i386qnx.c \
elf32-i860.c \
elf32-i960.c \
elf32-ip2k.c \
elf32-m32r.c \
elf32-m68k.c \
elf32-m68hc11.c \
@ -901,6 +905,7 @@ cpu-i370.lo: cpu-i370.c $(INCDIR)/filenames.h
cpu-i386.lo: cpu-i386.c $(INCDIR)/filenames.h
cpu-i860.lo: cpu-i860.c $(INCDIR)/filenames.h
cpu-i960.lo: cpu-i960.c $(INCDIR)/filenames.h
cpu-ip2k.lo: cpu-ip2k.c $(INCDIR)/filenames.h
cpu-m32r.lo: cpu-m32r.c $(INCDIR)/filenames.h
cpu-m68hc11.lo: cpu-m68hc11.c $(INCDIR)/filenames.h
cpu-m68hc12.lo: cpu-m68hc12.c $(INCDIR)/filenames.h
@ -1149,6 +1154,10 @@ elf32-i960.lo: elf32-i960.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-ip2k.lo: elf32-ip2k.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \

View File

@ -193,6 +193,7 @@ ALL_MACHINES = \
cpu-i386.lo \
cpu-i860.lo \
cpu-i960.lo \
cpu-ip2k.lo \
cpu-m32r.lo \
cpu-m68hc11.lo \
cpu-m68hc12.lo \
@ -244,6 +245,7 @@ ALL_MACHINES_CFILES = \
cpu-i386.c \
cpu-i860.c \
cpu-i960.c \
cpu-ip2k.c \
cpu-m32r.c \
cpu-m68hc11.c \
cpu-m68hc12.c \
@ -342,6 +344,7 @@ BFD32_BACKENDS = \
elf32-i860.lo \
elf32-i960.lo \
elf32-ia64.lo \
elf32-ip2k.c \
elf32-m32r.lo \
elf32-m68hc11.lo \
elf32-m68hc12.lo \
@ -499,6 +502,7 @@ BFD32_BACKENDS_CFILES = \
elf32-i386qnx.c \
elf32-i860.c \
elf32-i960.c \
elf32-ip2k.c \
elf32-m32r.c \
elf32-m68k.c \
elf32-m68hc11.c \
@ -778,7 +782,7 @@ configure.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
@ -1431,6 +1435,7 @@ cpu-i370.lo: cpu-i370.c $(INCDIR)/filenames.h
cpu-i386.lo: cpu-i386.c $(INCDIR)/filenames.h
cpu-i860.lo: cpu-i860.c $(INCDIR)/filenames.h
cpu-i960.lo: cpu-i960.c $(INCDIR)/filenames.h
cpu-ip2k.lo: cpu-ip2k.c $(INCDIR)/filenames.h
cpu-m32r.lo: cpu-m32r.c $(INCDIR)/filenames.h
cpu-m68hc11.lo: cpu-m68hc11.c $(INCDIR)/filenames.h
cpu-m68hc12.lo: cpu-m68hc12.c $(INCDIR)/filenames.h
@ -1679,6 +1684,10 @@ elf32-i960.lo: elf32-i960.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-ip2k.lo: elf32-ip2k.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \

View File

@ -258,6 +258,9 @@ DESCRIPTION
. bfd_arch_ia64, {* HP/Intel ia64 *}
.#define bfd_mach_ia64_elf64 0
.#define bfd_mach_ia64_elf32 1
. bfd_arch_ip2k, {* Ubicom IP2K microcontrollers. *}
.#define bfd_mach_ip2022 0
.#define bfd_mach_ip2022ext 1
. bfd_arch_pj,
. bfd_arch_avr, {* Atmel AVR microcontrollers. *}
.#define bfd_mach_avr1 1
@ -331,6 +334,7 @@ extern const bfd_arch_info_type bfd_i386_arch;
extern const bfd_arch_info_type bfd_i860_arch;
extern const bfd_arch_info_type bfd_i960_arch;
extern const bfd_arch_info_type bfd_ia64_arch;
extern const bfd_arch_info_type bfd_ip2k_arch;
extern const bfd_arch_info_type bfd_m32r_arch;
extern const bfd_arch_info_type bfd_m68hc11_arch;
extern const bfd_arch_info_type bfd_m68hc12_arch;
@ -386,6 +390,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
&bfd_i860_arch,
&bfd_i960_arch,
&bfd_ia64_arch,
&bfd_ip2k_arch,
&bfd_m32r_arch,
&bfd_m68hc11_arch,
&bfd_m68hc12_arch,

View File

@ -1648,6 +1648,9 @@ enum bfd_architecture
bfd_arch_ia64, /* HP/Intel ia64 */
#define bfd_mach_ia64_elf64 0
#define bfd_mach_ia64_elf32 1
bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
#define bfd_mach_ip2022 0
#define bfd_mach_ip2022ext 1
bfd_arch_pj,
bfd_arch_avr, /* Atmel AVR microcontrollers. */
#define bfd_mach_avr1 1
@ -2901,6 +2904,40 @@ into 22 bits. */
/* 32 bit rel. offset to GOT entry. */
BFD_RELOC_390_GOTENT,
/* Scenix IP2K - 9-bit register number / data address */
BFD_RELOC_IP2K_FR9,
/* Scenix IP2K - 4-bit register/data bank number */
BFD_RELOC_IP2K_BANK,
/* Scenix IP2K - low 13 bits of instruction word address */
BFD_RELOC_IP2K_ADDR16CJP,
/* Scenix IP2K - high 3 bits of instruction word address */
BFD_RELOC_IP2K_PAGE3,
/* Scenix IP2K - ext/low/high 8 bits of data address */
BFD_RELOC_IP2K_LO8DATA,
BFD_RELOC_IP2K_HI8DATA,
BFD_RELOC_IP2K_EX8DATA,
/* Scenix IP2K - low/high 8 bits of instruction word address */
BFD_RELOC_IP2K_LO8INSN,
BFD_RELOC_IP2K_HI8INSN,
/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
BFD_RELOC_IP2K_PC_SKIP,
/* Scenix IP2K - 16 bit word address in text section. */
BFD_RELOC_IP2K_TEXT,
/* Scenix IP2K - 7-bit sp or dp offset */
BFD_RELOC_IP2K_FR_OFFSET,
/* Scenix VPE4K coprocessor - data/insn-space addressing */
BFD_RELOC_VPE4KMATH_DATA,
BFD_RELOC_VPE4KMATH_INSN,
/* These two relocations are used by the linker to determine which of
the entries in a C++ virtual function table are actually used. When
the --gc-sections option is given, the linker will zero out the entries

View File

@ -518,6 +518,10 @@ case "${targ}" in
targ_selvecs="icoff_little_vec icoff_big_vec"
;;
ip2k-*-elf)
targ_defvec=bfd_elf32_ip2k_vec
;;
m32r-*-*)
targ_defvec=bfd_elf32_m32r_vec
;;

29
bfd/configure vendored
View File

@ -6081,6 +6081,7 @@ do
bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;
bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;;
bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf";;
bfd_elf32_ip2k_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;;
bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
@ -6321,10 +6322,10 @@ case ${host64}-${target64}-${want64} in
if test -n "$GCC" ; then
bad_64bit_gcc=no;
echo $ac_n "checking for gcc version with buggy 64-bit support""... $ac_c" 1>&6
echo "configure:6325: checking for gcc version with buggy 64-bit support" >&5
echo "configure:6326: checking for gcc version with buggy 64-bit support" >&5
# Add more tests for gcc versions with non-working 64-bit support here.
cat > conftest.$ac_ext <<EOF
#line 6328 "configure"
#line 6329 "configure"
#include "confdefs.h"
:__GNUC__:__GNUC_MINOR__:__i386__:
EOF
@ -6369,17 +6370,17 @@ for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:6373: checking for $ac_hdr" >&5
echo "configure:6374: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6378 "configure"
#line 6379 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:6384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -6408,12 +6409,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6412: checking for $ac_func" >&5
echo "configure:6413: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6417 "configure"
#line 6418 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -6436,7 +6437,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:6440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:6441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -6461,7 +6462,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
echo "configure:6465: checking for working mmap" >&5
echo "configure:6466: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -6469,7 +6470,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
#line 6473 "configure"
#line 6474 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@ -6622,7 +6623,7 @@ main()
}
EOF
if { (eval echo configure:6626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:6627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@ -6647,12 +6648,12 @@ fi
for ac_func in madvise mprotect
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6651: checking for $ac_func" >&5
echo "configure:6652: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6656 "configure"
#line 6657 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -6675,7 +6676,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:6679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:6680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else

View File

@ -582,6 +582,7 @@ do
bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;
bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;;
bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf";;
bfd_elf32_ip2k_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;;
bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;

54
bfd/cpu-ip2k.c Normal file
View File

@ -0,0 +1,54 @@
/* BFD support for the Scenix IP2xxx processor.
Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
const bfd_arch_info_type bfd_ip2k_nonext_arch =
{
32, /* Bits per word - not really true. */
16, /* Bits per address. */
8, /* Bits per byte. */
bfd_arch_ip2k, /* Architecture. */
bfd_mach_ip2022, /* Machine. */
"ip2k", /* Architecture name. */
"ip2022", /* Machine name. */
1, /* Section align power. */
false, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */
NULL /* Next in list. */
};
const bfd_arch_info_type bfd_ip2k_arch =
{
32, /* Bits per word - not really true. */
16, /* Bits per address. */
8, /* Bits per byte. */
bfd_arch_ip2k, /* Architecture. */
bfd_mach_ip2022ext, /* Machine. */
"ip2k", /* Architecture name. */
"ip2022ext", /* Machine name. */
1, /* Section align power. */
true, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */
& bfd_ip2k_nonext_arch /* Next in list. */
};

View File

@ -244,7 +244,7 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:

1989
bfd/elf32-ip2k.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1120,6 +1120,20 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_390_GOT64",
"BFD_RELOC_390_PLT64",
"BFD_RELOC_390_GOTENT",
"BFD_RELOC_IP2K_FR9",
"BFD_RELOC_IP2K_BANK",
"BFD_RELOC_IP2K_ADDR16CJP",
"BFD_RELOC_IP2K_PAGE3",
"BFD_RELOC_IP2K_LO8DATA",
"BFD_RELOC_IP2K_HI8DATA",
"BFD_RELOC_IP2K_EX8DATA",
"BFD_RELOC_IP2K_LO8INSN",
"BFD_RELOC_IP2K_HI8INSN",
"BFD_RELOC_IP2K_PC_SKIP",
"BFD_RELOC_IP2K_TEXT",
"BFD_RELOC_IP2K_FR_OFFSET",
"BFD_RELOC_VPE4KMATH_DATA",
"BFD_RELOC_VPE4KMATH_INSN",
"BFD_RELOC_VTABLE_INHERIT",
"BFD_RELOC_VTABLE_ENTRY",
"BFD_RELOC_IA64_IMM14",

View File

@ -3122,6 +3122,55 @@ ENUM
ENUMDOC
32 bit rel. offset to GOT entry.
ENUM
BFD_RELOC_IP2K_FR9
ENUMDOC
Scenix IP2K - 9-bit register number / data address
ENUM
BFD_RELOC_IP2K_BANK
ENUMDOC
Scenix IP2K - 4-bit register/data bank number
ENUM
BFD_RELOC_IP2K_ADDR16CJP
ENUMDOC
Scenix IP2K - low 13 bits of instruction word address
ENUM
BFD_RELOC_IP2K_PAGE3
ENUMDOC
Scenix IP2K - high 3 bits of instruction word address
ENUM
BFD_RELOC_IP2K_LO8DATA
ENUMX
BFD_RELOC_IP2K_HI8DATA
ENUMX
BFD_RELOC_IP2K_EX8DATA
ENUMDOC
Scenix IP2K - ext/low/high 8 bits of data address
ENUM
BFD_RELOC_IP2K_LO8INSN
ENUMX
BFD_RELOC_IP2K_HI8INSN
ENUMDOC
Scenix IP2K - low/high 8 bits of instruction word address
ENUM
BFD_RELOC_IP2K_PC_SKIP
ENUMDOC
Scenix IP2K - even/odd PC modifier to modify snb pcl.0
ENUM
BFD_RELOC_IP2K_TEXT
ENUMDOC
Scenix IP2K - 16 bit word address in text section.
ENUM
BFD_RELOC_IP2K_FR_OFFSET
ENUMDOC
Scenix IP2K - 7-bit sp or dp offset
ENUM
BFD_RELOC_VPE4KMATH_DATA
ENUMX
BFD_RELOC_VPE4KMATH_INSN
ENUMDOC
Scenix VPE4K coprocessor - data/insn-space addressing
ENUM
BFD_RELOC_VTABLE_INHERIT
ENUMX

View File

@ -526,6 +526,7 @@ extern const bfd_target bfd_elf32_i860_vec;
extern const bfd_target bfd_elf32_i960_vec;
extern const bfd_target bfd_elf32_ia64_big_vec;
extern const bfd_target bfd_elf32_ia64_hpux_big_vec;
extern const bfd_target bfd_elf32_ip2k_vec;
extern const bfd_target bfd_elf32_little_generic_vec;
extern const bfd_target bfd_elf32_littlearc_vec;
extern const bfd_target bfd_elf32_littlearm_oabi_vec;
@ -790,6 +791,7 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf32_ia64_big_vec,
#endif
&bfd_elf32_ia64_hpux_big_vec,
&bfd_elf32_ip2k_vec,
&bfd_elf32_little_generic_vec,
&bfd_elf32_littlearc_vec,
&bfd_elf32_littlearm_oabi_vec,

View File

@ -1,3 +1,15 @@
2002-07-15 Denis Chertykov <denisc@overta.ru>
Frank Ch. Eigler <fche@redhat.com>
Ben Elliston <bje@redhat.com>
Alan Lehotsky <alehotsky@cygnus.com>
John Healy <jhealy@redhat.com>
Graham Stott <grahams@redhat.com>
Jeff Johnston <jjohnstn@redhat.com>
* common.h (EM_IP2K): New macro.
(EM_IP2K_OLD): New macro.
* ip2k.h: New file.
2002-07-01 Matt Thomas <matt@3am-software.com>
* vax.h: Rename EF_* to EF_VAX_*.

View File

@ -176,6 +176,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
#define EM_IP2K 101 /* Ubicom IP2022 micro controller */
/* If it is necessary to assign new unofficial EM_* values, please pick large
random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision

62
include/elf/ip2k.h Normal file
View File

@ -0,0 +1,62 @@
/* IP2xxx ELF support for BFD.
Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
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 2 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.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _ELF_IP2K_H
#define _ELF_IP2K_H
#include "elf/reloc-macros.h"
/* Relocations. */
START_RELOC_NUMBERS (elf_ip2k_reloc_type)
RELOC_NUMBER (R_IP2K_NONE, 0)
RELOC_NUMBER (R_IP2K_16, 1)
RELOC_NUMBER (R_IP2K_32, 2)
RELOC_NUMBER (R_IP2K_FR9, 3)
RELOC_NUMBER (R_IP2K_BANK, 4)
RELOC_NUMBER (R_IP2K_ADDR16CJP, 5)
RELOC_NUMBER (R_IP2K_PAGE3, 6)
RELOC_NUMBER (R_IP2K_LO8DATA, 7)
RELOC_NUMBER (R_IP2K_HI8DATA, 8)
RELOC_NUMBER (R_IP2K_LO8INSN, 9)
RELOC_NUMBER (R_IP2K_HI8INSN, 10)
RELOC_NUMBER (R_IP2K_PC_SKIP, 11)
RELOC_NUMBER (R_IP2K_TEXT, 12)
RELOC_NUMBER (R_IP2K_FR_OFFSET, 13)
RELOC_NUMBER (R_IP2K_EX8DATA, 14)
END_RELOC_NUMBERS(R_IP2K_max)
/* Define the data & instruction memory discriminator. In a linked
executable, an symbol should be deemed to point to an instruction
if ((address & IP2K_INSN_MASK) == IP2K_INSN_VALUE), and similarly
for the data space. See also `ld/emulparams/elf32ip2k.sh'. */
/* ??? Consider extending the _MASK values to include all the
intermediate bits that must be zero due to the limited physical
memory size on the IP2K. */
#define IP2K_DATA_MASK 0xff000000
#define IP2K_DATA_VALUE 0x01000000
#define IP2K_INSN_MASK 0xff000000
#define IP2K_INSN_VALUE 0x02000000
/* The location of the memory mapped hardware stack. */
#define IP2K_STACK_VALUE 0x0f000000
#define IP2K_STACK_SIZE 0x20
#endif /* _ELF_IP2K_H */

View File

@ -1,3 +1,15 @@
2002-07-16 Denis Chertykov <denisc@overta.ru>
Nick Clifton <nickc@redhat.com>
Frank Ch. Eigler <fche@redhat.com>
John Healy <jhealy@redhat.com>
* configure.tgt: Add support for ip2k-elf.
* Makefile.am: Add support for ip2k-elf.
* Makefile.in: Regenerate.
* emulparams/elf32ip2k.sh: New file.
* scripttempl/ip2k.sc: New file
* NEWS: Mention support for new port.
2002-07-16 Nick Clifton <nickc@cambridge.redhat.com>
* NEWS: Add 'Changes in 2.13'.

View File

@ -161,6 +161,7 @@ ALL_EMULATIONS = \
eelf32fr30.o \
eelf32frv.o \
eelf32i370.o \
eelf32ip2k.o \
eelf32l4300.o \
eelf32lmip.o \
eelf32lppc.o \
@ -626,6 +627,9 @@ eelf64lppc.c: $(srcdir)/emulparams/elf64lppc.sh \
eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfi370.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32i370 "$(tdir_elf32i370)"
eelf32ip2k.c: $(srcdir)/emulparams/elf32ip2k.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/ip2k.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ip2k "$(tdir_ip2k)"
eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"

View File

@ -272,6 +272,7 @@ ALL_EMULATIONS = \
eelf32fr30.o \
eelf32frv.o \
eelf32i370.o \
eelf32ip2k.o \
eelf32l4300.o \
eelf32lmip.o \
eelf32lppc.o \
@ -526,7 +527,7 @@ deffilep.c ldgram.c ldlex.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES)
OBJECTS = $(ld_new_OBJECTS)
@ -1349,6 +1350,9 @@ eelf64lppc.c: $(srcdir)/emulparams/elf64lppc.sh \
eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfi370.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32i370 "$(tdir_elf32i370)"
eelf32ip2k.c: $(srcdir)/emulparams/elf32ip2k.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/ip2k.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ip2k "$(tdir_ip2k)"
eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"

View File

@ -1,4 +1,7 @@
-*- text -*-
* IP2K support added by Denis Chertykov.
Changes in 2.13:
* Support for the Fujitsu FRV architecture added by Red Hat. Models for FR400

View File

@ -494,6 +494,7 @@ mcore-*-elf) targ_emul=elf32mcore ;;
s390x-*-linux*) targ_emul=elf64_s390 ;;
s390-*-linux*) targ_emul=elf_s390 ;;
*-*-ieee*) targ_emul=vanilla ;;
ip2k-*-elf) targ_emul=elf32ip2k ;;
*)
echo 2>&1 "*** ld does not support target ${targ}"

View File

@ -0,0 +1,19 @@
MACHINE=
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-ip2k"
# See also `include/elf/ip2k.h'
DATA_ADDR=0x01000100
TEXT_START_ADDR=0x02010000
GPR_START_ADDR=0x1000080
GPR_SIZE=0x7F
GRP_MEMORY=gpr
ARCH=ip2k
ENTRY=__start
EMBEDDED=yes
ELFSIZE=32
MAXPAGESIZE=256
WRITABLE_RODATA=
OTHER_RELOCATING_SECTIONS='PROVIDE (__stack = 0x01000FFF);'
OTHER_READONLY_SECTIONS='.pram 0x2000000 : { *(.pram) } .reset 0x201FFE0 : { *(.reset) }'
OTHER_READWRITE_SECTIONS='.gpr 0x1000080 : { *(.gpr) }'

150
ld/scripttempl/ip2k.sc Normal file
View File

@ -0,0 +1,150 @@
cat << EOF
OUTPUT_FORMAT("elf32-ip2k", "elf32-ip2k", "elf32-ip2k")
OUTPUT_ARCH(ip2k)
ENTRY(_start)
SEARCH_DIR(.);
/* IP2022 default linker script. */
MEMORY
{
D_GPR : org = 0x01000080, len = 128
D_RAM : org = 0x01000100, len = 4K - 256
P_RAM : org = 0x02000000, len = 16K
P_ROM : org = 0x02010000, len = 64K - 32
P_RESET : org = 0x0201FFE0, len = 32
P_CONFIG : org = 0x02020000, len = 128
}
SECTIONS
{
/* Allocated memory end markers
(initialized to start of appropiate memory address). */
__data_end = 0x01000100;
__pram_end = 0x02000000;
__flash_end = 0x02010000;
/* Global general purpose registers in direct addressing range. */
.gpr 0x01000080 :
{
*(.gpr)
} >D_GPR
/* Pre-allocated, pre-initialized data memory. */
__data_run_begin = __data_end;
__data_load_begin = (__flash_end + 1) & 0xFFFFFFFE;
.data __data_run_begin : AT (__data_load_begin)
{
* (.data);
* (.rodata)
} >D_RAM
__data_run_end = __data_run_begin + SIZEOF(.data);
__data_load_end = __data_load_begin + SIZEOF(.data);
__data_end = __data_run_end;
__flash_end = __data_load_end;
/* Pre-allocated, uninitialized data memory. */
__bss_begin = __data_end;
.bss __bss_begin :
{
* (.bss)
} >D_RAM
__bss_end = __bss_begin + SIZEOF(.bss);
__data_end = __bss_end;
/* Pre-allocated PRAM data memory. */
__pram_data_begin = (__pram_end + 1) & 0xFFFFFFFE;
.pram_data __pram_data_begin :
{
* (.pram_data)
} >P_RAM
__pram_data_end = __pram_data_begin + SIZEOF(.pram_data);
__pram_end = __pram_data_end;
/* PRAM code. */
__pram_run_begin = (__pram_end + 1) & 0xFFFFFFFE;
__pram_load_begin = (__flash_end + 1) & 0xFFFFFFFE;
.pram __pram_run_begin : AT (__pram_load_begin)
{
* (.pram)
} >P_RAM
__pram_run_end = __pram_run_begin + SIZEOF(.pram);
__pram_load_end = __pram_load_begin + SIZEOF(.pram);
__pram_load_shift = ((__pram_run_begin - __pram_load_begin) & 0x1FFFF) | 0x02000000;
__pram_end = __pram_run_end;
__flash_end = __pram_load_end;
/* PRAM overlay code. */
__pram_overlay_run_start = (__pram_end + 1) & 0xFFFFFFFE;
__pram_overlay_load_start = (__flash_end + 1) & 0xFFFFFFFE;
OVERLAY __pram_overlay_run_start : AT (__pram_overlay_load_start)
{
.pram1 { */overlay1/* (.pram); * (.pram1) }
.pram2 { */overlay2/* (.pram); * (.pram2) }
} >P_RAM
__pram_overlay_run_end = .;
__pram_overlay_load_end = __pram_overlay_load_start + SIZEOF(.pram1) + SIZEOF(.pram2);
__pram_end = __pram_overlay_run_end;
__flash_end = __pram_overlay_load_end;
/* Flash code. */
__text_begin = (__flash_end + 1) & 0xFFFFFFFE;
.text __text_begin :
{
* (.text);
* (.text.libgcc)
} >P_ROM = 0xffff
__text_end = __text_begin + SIZEOF(.text);
__flash_end = __text_end;
/* Strings. */
__strings_begin = (__flash_end + 1) & 0xFFFFFFFE;
.strings __strings_begin :
{
* (strings);
* (.progmem.data)
} >P_ROM = 0xffff
__strings_end = __strings_begin + SIZEOF (.strings);
__flash_end = __strings_end;
.ctors : { * (.ctors) } > P_ROM
.dtors : { * (.dtors) } > P_ROM
/* Reset code. */
.reset : { * (.reset) } >P_RESET = 0xffff
/* Configuration block. */
.config : { * (.config) } >P_CONFIG = 0xffff
/* Stack. */
PROVIDE (__stack = 0x01000FFF);
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF 1. */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions. */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2. */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2. */
.debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
}
EOF