diff options
author | Martin Hunt <hunt@redhat.com> | 1996-07-18 00:47:05 +0000 |
---|---|---|
committer | Martin Hunt <hunt@redhat.com> | 1996-07-18 00:47:05 +0000 |
commit | 50bd50d48f63e45bd8b85dbdee1c6f2c97796b2c (patch) | |
tree | c2311511dc2b2e617f20289c17b8f5bd00a9be8b | |
parent | 6fb197de559b454be0e1c7044ad90b1b1c7db904 (diff) | |
download | gdb-50bd50d48f63e45bd8b85dbdee1c6f2c97796b2c.zip gdb-50bd50d48f63e45bd8b85dbdee1c6f2c97796b2c.tar.gz gdb-50bd50d48f63e45bd8b85dbdee1c6f2c97796b2c.tar.bz2 |
start-sanitize-d10v
Wed Jul 17 14:51:52 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* Makefile.in (ALL_MACHINES): Add cpu-d10v.o
(BFD32_BACKENDS) Add elf32-d10v.o
* archures.c: Add bfd_d10v_arch.
* bfd-in2.h: Add bfd_d10v_arch.
* config.bfd (d10v-*-*): New target.
* configure: (bfd_elf32_d10v_vec) New vector.
* configure.in: (bfd_elf32_d10v_vec) New vector.
* cpu-d10v.c: New file.
* elf.c (prep_headers): Added case bfd_arch_d10v.
* elf32-d10v.c: New file.
* libbfd.h: Rebuild.
* reloc.c (BFD_RELOC_D10V_10_PCREL_R, BFD_RELOC_D10V_10_PCREL_L, BFD_RELOC_D10V_18,
BFD_RELOC_D10V_18_PCREL): Define.
* targets.c (bfd_elf32_d10v_vec): New vector.
end-sanitize-d10v
-rw-r--r-- | bfd/.Sanitize | 36 | ||||
-rw-r--r-- | bfd/ChangeLog | 19 | ||||
-rw-r--r-- | bfd/Makefile.in | 63 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 21 | ||||
-rwxr-xr-x | bfd/config.bfd | 18 | ||||
-rwxr-xr-x | bfd/configure | 89 | ||||
-rw-r--r-- | bfd/configure.in | 7 | ||||
-rw-r--r-- | bfd/cpu-d10v.c | 40 | ||||
-rw-r--r-- | bfd/elf.c | 30 | ||||
-rw-r--r-- | bfd/elf32-d10v.c | 206 | ||||
-rw-r--r-- | bfd/libbfd.h | 36 | ||||
-rw-r--r-- | bfd/reloc.c | 69 | ||||
-rw-r--r-- | bfd/targets.c | 42 |
13 files changed, 598 insertions, 78 deletions
diff --git a/bfd/.Sanitize b/bfd/.Sanitize index 7a12df7..b373059 100644 --- a/bfd/.Sanitize +++ b/bfd/.Sanitize @@ -23,6 +23,14 @@ else lose_these_too="${arc_files} ${lose_these_too}" fi +d10v_files="cpu-d10v.c elf32-d10v.c" + +if ( echo $* | grep keep\-d10v > /dev/null ) ; then + keep_these_too="${d10v_files} ${keep_these_too}" +else + lose_these_too="${d10v_files} ${lose_these_too}" +fi + # All files listed between the "Things-to-keep:" line and the # "Files-to-sed:" line will be kept. All other files will be removed. # Directories listed in this section will have their own Sanitize @@ -287,6 +295,34 @@ else done fi +d10v_files="ChangeLog ChangeLog.2 Makefile.in archures.c reloc.c targets.c config.bfd configure.in configure bfd-in2.h elf.c libbfd.h" +if ( echo $* | grep keep\-d10v > /dev/null ) ; then + for i in $d10v_files ; do + if test ! -d $i && (grep sanitize-d10v $i > /dev/null) ; then + if [ -n "${verbose}" ] ; then + echo Keeping d10v stuff in $i + fi + fi + done +else + for i in $d10v_files ; do + if test ! -d $i && (grep sanitize-d10v $i > /dev/null) ; then + if [ -n "${verbose}" ] ; then + echo Removing traces of \"d10v\" from $i... + fi + cp $i new + sed '/start\-sanitize\-d10v/,/end-\sanitize\-d10v/d' < $i > new + if [ -n "${safe}" -a ! -f .Recover/$i ] ; then + if [ -n "${verbose}" ] ; then + echo Caching $i in .Recover... + fi + mv $i .Recover + fi + mv new $i + fi + done +fi + gm_files="ChangeLog ChangeLog.2 config.bfd" if ( echo $* | grep keep\-gm > /dev/null ) ; then for i in $gm_files ; do diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e6ca8fa..78529f8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,22 @@ +start-sanitize-d10v + Wed Jul 17 14:51:52 1996 Martin M. Hunt <hunt@pizza.cygnus.com> + + * Makefile.in (ALL_MACHINES): Add cpu-d10v.o + (BFD32_BACKENDS) Add elf32-d10v.o + * archures.c: Add bfd_d10v_arch. + * bfd-in2.h: Add bfd_d10v_arch. + * config.bfd (d10v-*-*): New target. + * configure: (bfd_elf32_d10v_vec) New vector. + * configure.in: (bfd_elf32_d10v_vec) New vector. + * cpu-d10v.c: New file. + * elf.c (prep_headers): Added case bfd_arch_d10v. + * elf32-d10v.c: New file. + * libbfd.h: Rebuild. + * reloc.c (BFD_RELOC_D10V_10_PCREL_R, BFD_RELOC_D10V_10_PCREL_L, BFD_RELOC_D10V_18, + BFD_RELOC_D10V_18_PCREL): Define. + * targets.c (bfd_elf32_d10v_vec): New vector. +end-sanitize-d10v + Wed Jul 17 10:58:55 1996 Kim Knuttila <krk@cygnus.com> * coff-ppc.c (coff_ppc_relocate_section): Removed bogus fprintf diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 7245d7a..128ab1e 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -26,11 +26,11 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ exec_prefix = @exec_prefix@ -bindir = $(exec_prefix)/bin -libdir = $(exec_prefix)/lib +bindir = @bindir@ +libdir = @libdir@ -datadir = $(prefix)/lib -mandir = $(prefix)/man +datadir = @datadir@ +mandir = @mandir@ man1dir = $(mandir)/man1 man2dir = $(mandir)/man2 man3dir = $(mandir)/man3 @@ -40,8 +40,8 @@ man6dir = $(mandir)/man6 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 man9dir = $(mandir)/man9 -infodir = $(prefix)/info -includedir = $(prefix)/include +infodir = @infodir@ +includedir = @includedir@ oldincludedir = docdir = doc @@ -116,6 +116,9 @@ ALL_MACHINES = \ cpu-arc.o \ $(end-sanitize-arc) \ cpu-arm.o \ + $(start-sanitize-d10v) \ + cpu-d10v.o \ + $(end-sanitize-d10v) \ cpu-h8300.o \ cpu-h8500.o \ cpu-hppa.o \ @@ -127,9 +130,6 @@ ALL_MACHINES = \ cpu-mips.o \ cpu-ns32k.o \ cpu-powerpc.o \ - $(start-sanitize-rce) \ - cpu-rce.o \ - $(end-sanitize-rce) \ cpu-rs6000.o \ cpu-sh.o \ cpu-sparc.o \ @@ -166,9 +166,6 @@ ALL_MACHINES_CFILES = \ BFD32_BACKENDS = \ aout-adobe.o \ aout-ns32k.o \ - $(start-sanitize-rce) \ - aout-rce.o \ - $(end-sanitize-rce) \ aout0.o \ aout32.o \ bout.o \ @@ -202,6 +199,9 @@ BFD32_BACKENDS = \ $(start-sanitize-arc) \ elf32-arc.o \ $(end-sanitize-arc) \ + $(start-sanitize-d10v) \ + elf32-d10v.o \ + $(end-sanitize-d10v) \ elf32-gen.o \ elf32-hppa.o \ elf32-i386.o \ @@ -245,6 +245,7 @@ BFD32_BACKENDS = \ pei-i386.o \ pe-ppc.o \ pei-ppc.o \ + ppcboot.o \ reloc16.o \ sparclynx.o \ sparcnetbsd.o \ @@ -329,6 +330,7 @@ BFD32_BACKENDS_CFILES = \ pei-i386.c \ pe-ppc.c \ pei-ppc.c \ + ppcboot.c \ reloc16.c \ sparclynx.c \ sparcnetbsd.c \ @@ -344,10 +346,16 @@ BFD64_BACKENDS = \ aout64.o \ coff-alpha.o \ demo64.o \ + elf64-alpha.o \ elf64-gen.o \ elf64-mips.o \ elf64-sparc.o \ elf64.o \ + evax-alpha.o \ + evax-egsd.o \ + evax-etir.o \ + evax-emh.o \ + evax-misc.o \ nlm32-alpha.o \ nlm64.o @@ -355,10 +363,16 @@ BFD64_BACKENDS_CFILES = \ aout64.c \ coff-alpha.c \ demo64.c \ + elf64-alpha.c \ elf64-gen.c \ elf64-mips.c \ elf64-sparc.c \ elf64.c \ + evax-alpha.c \ + evax-egsd.c \ + evax-etir.c \ + evax-emh.c \ + evax-misc.c \ nlm32-alpha.c \ nlm64.c @@ -428,7 +442,7 @@ CFILES = \ HFILES = aout-target.h aoutf1.h aoutx.h coffcode.h \ coffswap.h ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \ - elfcode.h hppa_stubs.h libaout.h libbfd.h \ + elfcode.h evax.h hppa_stubs.h libaout.h libbfd.h \ libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h libnlm.h \ liboasys.h nlm-target.h nlmcode.h som.h genlink.h netbsd.h ns32k.h @@ -788,6 +802,12 @@ elf32-arc.o: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/arc.h elf32-target.h end-sanitize-arc: +start-sanitize-d10v: +elf32-d10v.o: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/d10v.h elf32-target.h +end-sanitize-d10v: + $(OFILES): stamp-picdir stamp-picdir: @@ -1055,6 +1075,7 @@ pe-ppc.o: pe-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \ pei-ppc.o: pei-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h +ppcboot.o: ppcboot.c reloc16.o: reloc16.c $(INCDIR)/bfdlink.h genlink.h \ $(INCDIR)/coff/internal.h libcoff.h sparclynx.o: sparclynx.c $(INCDIR)/aout/sun4.h libaout.h \ @@ -1079,18 +1100,32 @@ coff-alpha.o: coff-alpha.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ demo64.o: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \ $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h +elf64-alpha.o: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/alpha.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \ + $(INCDIR)/aout/ar.h libcoff.h libecoff.h ecoffswap.h \ + elf64-target.h elf64-gen.o: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf64-target.h elf64-mips.o: elf64-mips.c $(INCDIR)/bfdlink.h genlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h elf64-target.h + $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h ecoffswap.h \ + elf64-target.h elf64-sparc.o: elf64-sparc.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/sparc.h elf64-target.h elf64.o: elf64.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ elfcore.h elflink.h +evax-alpha.o: evax-alpha.c $(INCDIR)/bfdlink.h evax.h +evax-egsd.o: evax-egsd.c $(INCDIR)/bfdlink.h evax.h +evax-etir.o: evax-etir.c $(INCDIR)/bfdlink.h evax.h +evax-emh.o: evax-emh.c $(INCDIR)/bfdlink.h evax.h +evax-misc.o: evax-misc.c $(INCDIR)/bfdlink.h evax.h nlm32-alpha.o: nlm32-alpha.c $(INCDIR)/nlm/alpha-ext.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 496fb61..d6f7702 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1198,6 +1198,9 @@ enum bfd_architecture bfd_arch_powerpc, /* PowerPC */ bfd_arch_rs6000, /* IBM RS/6000 */ bfd_arch_hppa, /* HP PA RISC */ +/* start-sanitize-d10v */ + bfd_arch_d10v, /* Mitsubishi D10V */ +/* end-sanitize-d10v */ bfd_arch_z8k, /* Zilog Z8000 */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 @@ -1775,6 +1778,24 @@ stored in the instruction. The high 24 bits are installed in bits 23 through 0. */ BFD_RELOC_ARC_B26, /* end-sanitize-arc */ + +/* start-sanitize-d10v */ + +/* Mitsubishi D10V relocs. +This is a 10-bit reloc with the right 2 bits +assumed to be 0. */ + BFD_RELOC_D10V_10_PCREL_L, + BFD_RELOC_D10V_10_PCREL_R, + +/* This is an 18-bit reloc with the right 2 bits +assumed to be 0. */ + BFD_RELOC_D10V_18, + +/* This is an 18-bit reloc with the right 2 bits +assumed to be 0. */ + BFD_RELOC_D10V_18_PCREL, +/* end-sanitize-d10v */ + BFD_RELOC_UNUSED }; typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type * diff --git a/bfd/config.bfd b/bfd/config.bfd index 49e71cd..389e830 100755 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -65,7 +65,7 @@ case "${targ}" in # start-sanitize-arc arc-*-elf*) targ_defvec=bfd_elf32_littlearc_vec - targ_selvecs=bfd_elf32_bigarg_vec + targ_selvecs=bfd_elf32_bigarc_vec ;; # end-sanitize-arc arm-*-riscix*) @@ -101,6 +101,12 @@ case "${targ}" in targ_underscore=yes ;; +# start-sanitize-d10v + d10v-*-*) + targ_defvec=bfd_elf32_d10v_vec + ;; +# end-sanitize-d10v + h8300*-*-*) targ_defvec=h8300coff_vec targ_underscore=yes @@ -138,7 +144,7 @@ case "${targ}" in targ_selvecs=i386coff_vec ;; i[345]86-*-sysv* | i[345]86-*-isc* | i[345]86-*-sco* | i[345]86-*-coff | \ - i[345]86-*-aix* | i[345]86-*-go32*) + i[345]86-*-aix* | i[345]86-*-go32* | i[345]86*-*-rtems*) targ_defvec=i386coff_vec ;; i[345]86-sequent-bsd*) @@ -222,7 +228,7 @@ case "${targ}" in targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec" targ_underscore=yes ;; - i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv*) + i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv* | i960-*-rtems*) targ_defvec=icoff_little_vec targ_selvecs="icoff_big_vec b_out_vec_little_host b_out_vec_big_host ieee_vec" targ_underscore=yes @@ -256,7 +262,7 @@ case "${targ}" in targ_defvec=bfd_elf32_m68k_vec targ_selvecs="m68kcoff_vec ieee_vec" ;; - m68*-*-coff* | m68*-*-sysv*) + m68*-*-coff* | m68*-*-sysv* | m68*-*-rtems*) targ_defvec=m68kcoff_vec targ_selvecs="m68kcoff_vec versados_vec ieee_vec" ;; @@ -395,7 +401,7 @@ case "${targ}" in targ_defvec=rs6000coff_vec ;; powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ - powerpc-*-solaris2* | powerpc-*-linux*) + powerpc-*-solaris2* | powerpc-*-linux* | powerpc-*-rtems*) targ_defvec=bfd_elf32_powerpc_vec targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec ppcboot_vec" ;; @@ -448,7 +454,7 @@ case "${targ}" in sparc*-*-coff*) targ_defvec=sparccoff_vec ;; - sparc*-*-*) + sparc*-*-* | sparc*-*-rtems*) targ_defvec=sunos_big_vec targ_underscore=yes ;; diff --git a/bfd/configure b/bfd/configure index 3b325a3..ffb2480 100755 --- a/bfd/configure +++ b/bfd/configure @@ -849,6 +849,27 @@ else fi +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then + echo "$ac_t""yes" 1>&6 + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$ac_t""no" 1>&6 + ISC= +fi + + # Permit host specific settings. . ${srcdir}/configure.host @@ -1053,11 +1074,11 @@ else ac_cv_c_cross=yes else cat > conftest.$ac_ext <<EOF -#line 1057 "configure" +#line 1078 "configure" #include "confdefs.h" main(){return(0);} EOF -{ (eval echo configure:1061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:1082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_c_cross=no else @@ -1095,13 +1116,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1099 "configure" +#line 1120 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1110,13 +1131,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1114 "configure" +#line 1135 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1144,12 +1165,12 @@ 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 1148 "configure" +#line 1169 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1181,12 +1202,12 @@ 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 1185 "configure" +#line 1206 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1215,7 +1236,7 @@ if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1219 "configure" +#line 1240 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -1225,7 +1246,7 @@ int t() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1250: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1244,14 +1265,14 @@ EOF fi -for ac_func in fcntl getpagesize +for ac_func in fcntl getpagesize setitimer sysconf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 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 1255 "configure" +#line 1276 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1275,7 +1296,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1312,7 +1333,7 @@ if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1316 "configure" +#line 1337 "configure" #include "confdefs.h" #include <stdio.h> @@ -1327,7 +1348,7 @@ int t() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:1331: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -1352,7 +1373,7 @@ if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1356 "configure" +#line 1377 "configure" #include "confdefs.h" #include <stdio.h> @@ -1367,7 +1388,7 @@ int t() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:1371: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -1639,7 +1660,7 @@ EOF echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1643 "configure" +#line 1664 "configure" #include "confdefs.h" #include <sys/procfs.h> int main() { return 0; } @@ -1647,7 +1668,7 @@ int t() { prstatus_t t; ; return 0; } EOF -if { (eval echo configure:1651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_header_sys_procfs_h=yes else @@ -1760,6 +1781,8 @@ do apollocoff_vec) tb="$tb coff-apollo.o" ;; b_out_vec_big_host) tb="$tb bout.o aout32.o" ;; b_out_vec_little_host) tb="$tb bout.o aout32.o" ;; + bfd_elf64_alpha_vec) tb="$tb elf64-alpha.o elf64.o $elf" + target64=true ;; # start-sanitize-arc bfd_elf32_littlearc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;; bfd_elf32_bigarc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;; @@ -1768,6 +1791,9 @@ do bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;; bfd_elf64_bigmips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o" target64=true ;; +# start-sanitize-d10v + bfd_elf32_d10v_vec) tb="$tb elf32-d10v.o elf32.o $elf" ;; +# end-sanitize-d10v bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o $elf" ;; bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o $elf" ;; @@ -1793,6 +1819,8 @@ do ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;; ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o" target64=true ;; + evax_alpha_vec) tb="$tb evax-alpha.o evax-emh.o evax-egsd.o evax-etir.o evax-misc.o" + target64=true ;; h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;; h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;; host_aout_vec) tb="$tb host-aout.o aout32.o" ;; @@ -1842,9 +1870,6 @@ do bfd_powerpcle_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;; ppcboot_vec) tb="$tb ppcboot.o" ;; shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;; -# start-sanitize-rce - rce_aout_vec) tb="$tb aout-rce.o aout32.o" ;; -# end-sanitize-rce shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;; som_vec) tb="$tb som.o" ;; sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o" ;; @@ -1907,6 +1932,10 @@ case ${host64}-${target64}-${want64} in *true*) wordsize=64 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' + if test -z "$GCC" && test "$HOST_64BIT_LONG" = "0"; then + echo "configure: warning: You have requested a 64 bit BFD configuration, but" 1>&2 + echo "configure: warning: your compiler may not have a 64 bit integral type" 1>&2 + fi ;; false-false-false) wordsize=32 @@ -1932,7 +1961,7 @@ 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 1936 "configure" +#line 1962 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1956,7 +1985,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1986,7 +2015,7 @@ else ac_cv_func_mmap=no else cat > conftest.$ac_ext <<EOF -#line 1990 "configure" +#line 2016 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. */ @@ -2055,7 +2084,7 @@ main() } EOF -{ (eval echo configure:2059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:2085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_func_mmap=yes else @@ -2080,7 +2109,7 @@ 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 2084 "configure" +#line 2110 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2104,7 +2133,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else diff --git a/bfd/configure.in b/bfd/configure.in index 44a3ef3..21f3b60 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -74,6 +74,8 @@ fi AC_PROG_CC +AC_ISC_POSIX + # Permit host specific settings. . ${srcdir}/configure.host @@ -119,7 +121,7 @@ BFD_CC_FOR_BUILD AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h) AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h) AC_HEADER_TIME -AC_CHECK_FUNCS(fcntl getpagesize) +AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf) BFD_BINARY_FOPEN @@ -423,6 +425,9 @@ do bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;; bfd_elf64_bigmips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o" target64=true ;; +# start-sanitize-d10v + bfd_elf32_d10v_vec) tb="$tb elf32-d10v.o elf32.o $elf" ;; +# end-sanitize-d10v bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o $elf" ;; bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o $elf" ;; diff --git a/bfd/cpu-d10v.c b/bfd/cpu-d10v.c new file mode 100644 index 0000000..a1ff088 --- /dev/null +++ b/bfd/cpu-d10v.c @@ -0,0 +1,40 @@ +/* BFD support for the D10V processor + Copyright 1996 Free Software Foundation, Inc. + Contributed by Martin Hunt (hunt@cygnus.com). + +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_d10v_arch = +{ + 16, /* 16 bits in a word */ + 16, /* 16 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_d10v, + 0, + "d10v", + "d10v", + 4, /* section alignment power */ + true, + bfd_default_compatible, + bfd_default_scan, + 0, +}; + @@ -1039,7 +1039,8 @@ elf_fake_sections (abfd, asect, failedptrarg) this_hdr->sh_flags = 0; - if ((asect->flags & SEC_ALLOC) != 0) + if ((asect->flags & SEC_ALLOC) != 0 + || asect->user_set_vma) this_hdr->sh_addr = asect->vma; else this_hdr->sh_addr = 0; @@ -1758,10 +1759,11 @@ map_sections_to_segments (abfd) /* See if this section and the last one will fit in the same segment. Don't put a loadable section after a non-loadable section. If we are building a dynamic executable, don't put - a writable section in a read only segment (we don't do this - for a non-dynamic executable because some people prefer to - have only one program segment; anybody can use PHDRS in their - linker script to control what happens anyhow). */ + a writable section in a read only segment, unless they're on + the same page anyhow (we don't do this for a non-dynamic + executable because some people prefer to have only one + program segment; anybody can use PHDRS in their linker script + to control what happens anyhow). */ if (last_hdr == NULL || ((BFD_ALIGN (last_hdr->lma + last_hdr->_raw_size, maxpagesize) >= hdr->lma) @@ -1769,8 +1771,14 @@ map_sections_to_segments (abfd) || (hdr->flags & SEC_LOAD) == 0) && (dynsec == NULL || writable - || (hdr->flags & SEC_READONLY) != 0))) + || (hdr->flags & SEC_READONLY) != 0 + || (BFD_ALIGN (last_hdr->lma + last_hdr->_raw_size, + maxpagesize) + > hdr->lma)))) + { + if ((hdr->flags & SEC_READONLY) == 0) + writable = true; last_hdr = hdr; continue; } @@ -1788,6 +1796,8 @@ map_sections_to_segments (abfd) if ((hdr->flags & SEC_READONLY) == 0) writable = true; + else + writable = false; last_hdr = hdr; phdr_index = i; @@ -2406,6 +2416,14 @@ prep_headers (abfd) case bfd_arch_powerpc: i_ehdrp->e_machine = EM_PPC; break; + case bfd_arch_alpha: + i_ehdrp->e_machine = EM_ALPHA; + break; +/* start-sanitize-d10v */ + case bfd_arch_d10v: + i_ehdrp->e_machine = EM_CYGNUS_D10V; + break; +/* end-sanitize-d10v */ /* start-sanitize-arc */ case bfd_arch_arc: i_ehdrp->e_machine = EM_CYGNUS_ARC; diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c new file mode 100644 index 0000000..3c98fab --- /dev/null +++ b/bfd/elf32-d10v.c @@ -0,0 +1,206 @@ +/* D10V-specific support for 32-bit ELF + Copyright (C) 1996 Free Software Foundation, Inc. + Contributed by Martin Hunt (hunt@cygnus.com). + +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" +#include "elf-bfd.h" +/* #include "elf/d10v.h" */ + +static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup + PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); +static void d10v_info_to_howto_rel + PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + + +/* Use REL instead of RELA to save space */ +#define USE_REL + +enum reloc_type +{ + R_D10V_NONE = 0, + R_D10V_10_PCREL_R, + R_D10V_10_PCREL_L, + R_D10V_16, + R_D10V_18, + R_D10V_18_PCREL, + R_D10V_max +}; + +static reloc_howto_type elf_d10v_howto_table[] = +{ + /* This reloc does nothing. */ + HOWTO (R_D10V_NONE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* An PC Relative 10-bit relocation, shifted by 2 */ + /* right container */ + HOWTO (R_D10V_10_PCREL_R, /* type */ + 2, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_10_PCREL_R", /* name */ + false, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + true), /* pcrel_offset */ + + /* An PC Relative 10-bit relocation, shifted by 2 */ + /* left container */ + HOWTO (R_D10V_10_PCREL_L, /* type */ + 2, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + true, /* pc_relative */ + 15, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_10_PCREL_L", /* name */ + false, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + true), /* pcrel_offset */ + + /* A 16 bit absolute relocation */ + HOWTO (R_D10V_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* An 18 bit absolute relocation, right shifted 2 */ + HOWTO (R_D10V_18, /* type */ + 2, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_18", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A relative 18 bit relocation, right shifted by 2 */ + HOWTO (R_D10V_18_PCREL, /* type */ + 2, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_18_PCREL", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + true), /* pcrel_offset */ + +}; + +/* Map BFD reloc types to D10V ELF reloc types. */ + +struct d10v_reloc_map +{ + unsigned char bfd_reloc_val; + unsigned char elf_reloc_val; +}; + + static const struct d10v_reloc_map d10v_reloc_map[] = +{ + { BFD_RELOC_NONE, R_D10V_NONE, }, + { BFD_RELOC_D10V_10_PCREL_R, R_D10V_10_PCREL_R }, + { BFD_RELOC_D10V_10_PCREL_L, R_D10V_10_PCREL_L }, + { BFD_RELOC_16, R_D10V_16 }, + { BFD_RELOC_D10V_18, R_D10V_18 }, + { BFD_RELOC_D10V_18_PCREL, R_D10V_18_PCREL }, +}; + +static reloc_howto_type * +bfd_elf32_bfd_reloc_type_lookup (abfd, code) + bfd *abfd; + bfd_reloc_code_real_type code; +{ + unsigned int i; + + for (i = 0; + i < sizeof (d10v_reloc_map) / sizeof (struct d10v_reloc_map); + i++) + { + if (d10v_reloc_map[i].bfd_reloc_val == code) + return &elf_d10v_howto_table[d10v_reloc_map[i].elf_reloc_val]; + } + + return NULL; +} + +/* Set the howto pointer for an D10V ELF reloc. */ + +static void +d10v_info_to_howto_rel (abfd, cache_ptr, dst) + bfd *abfd; + arelent *cache_ptr; + Elf32_Internal_Rel *dst; +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (dst->r_info); + BFD_ASSERT (r_type < (unsigned int) R_D10V_max); + cache_ptr->howto = &elf_d10v_howto_table[r_type]; +} + +#define ELF_ARCH bfd_arch_d10v +#define ELF_MACHINE_CODE EM_CYGNUS_D10V +#define ELF_MAXPAGESIZE 0x1000 + +#define TARGET_BIG_SYM bfd_elf32_d10v_vec +#define TARGET_BIG_NAME "elf32-d10v" + +#define elf_info_to_howto 0 +#define elf_info_to_howto_rel d10v_info_to_howto_rel +#define elf_backend_object_p 0 +#define elf_backend_final_write_processing 0 + +#include "elf32-target.h" diff --git a/bfd/libbfd.h b/bfd/libbfd.h index c2d3f00..d62d980 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -425,6 +425,20 @@ extern bfd_reloc_status_type _bfd_final_link_relocate extern bfd_reloc_status_type _bfd_relocate_contents PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *)); +/* Link stabs in sections in the first pass. */ + +extern boolean _bfd_link_section_stabs + PARAMS ((bfd *, PTR *, asection *, asection *, PTR *)); + +/* Write out the .stab section when linking stabs in sections. */ + +extern boolean _bfd_write_section_stabs + PARAMS ((bfd *, asection *, PTR *, bfd_byte *)); + +/* Write out the .stabstr string table when linking stabs in sections. */ + +extern boolean _bfd_write_stab_strings PARAMS ((bfd *, PTR *)); + /* Create a string table. */ extern struct bfd_strtab_hash *_bfd_stringtab_init PARAMS ((void)); @@ -468,15 +482,6 @@ void bfd_assert PARAMS ((const char*,int)); FILE * bfd_cache_lookup_worker PARAMS ((bfd *)); extern bfd *bfd_last_cache; - -/* Now Steve, what's the story here? */ -#ifdef lint -#define itos(x) "l" -#define stoi(x) 1 -#else -#define itos(x) ((char*)(x)) -#define stoi(x) ((int)(x)) -#endif /* List of supported target vectors, and the default vector (if bfd_default_vector[0] is NULL, there is no default). */ @@ -581,6 +586,8 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_LO10", "BFD_RELOC_GPREL16", "BFD_RELOC_GPREL32", + "BFD_RELOC_SWREL32", + "BFD_RELOC_SWREL64", "BFD_RELOC_I960_CALLJ", "BFD_RELOC_NONE", "BFD_RELOC_SPARC_WDISP22", @@ -616,9 +623,12 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_SPARC_5", "BFD_RELOC_ALPHA_GPDISP_HI16", "BFD_RELOC_ALPHA_GPDISP_LO16", + "BFD_RELOC_ALPHA_GPDISP", "BFD_RELOC_ALPHA_LITERAL", "BFD_RELOC_ALPHA_LITUSE", "BFD_RELOC_ALPHA_HINT", + "BFD_RELOC_ALPHA_LINKAGE", + "BFD_RELOC_ALPHA_BASEREG", "BFD_RELOC_MIPS_JMP", "BFD_RELOC_HI16", "BFD_RELOC_HI16_S", @@ -698,6 +708,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_ARC_B22_PCREL", "BFD_RELOC_ARC_B26", /* end-sanitize-arc */ + +/* start-sanitize-d10v */ + "BFD_RELOC_D10V_10_PCREL_L", + "BFD_RELOC_D10V_10_PCREL_R", + "BFD_RELOC_D10V_18", + "BFD_RELOC_D10V_18_PCREL", +/* end-sanitize-d10v */ + "@@overflow: BFD_RELOC_UNUSED@@", }; #endif diff --git a/bfd/reloc.c b/bfd/reloc.c index 5e6004a..f2d6567 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -621,6 +621,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, /* WTF?? */ if (abfd->xvec->flavour == bfd_target_coff_flavour && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0 + && strcmp (abfd->xvec->name, "xcoff-powermac") != 0 && strcmp (abfd->xvec->name, "coff-Intel-little") != 0 && strcmp (abfd->xvec->name, "coff-Intel-big") != 0) { @@ -1083,6 +1084,7 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, /* WTF?? */ if (abfd->xvec->flavour == bfd_target_coff_flavour && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0 + && strcmp (abfd->xvec->name, "xcoff-powermac") != 0 && strcmp (abfd->xvec->name, "coff-Intel-little") != 0 && strcmp (abfd->xvec->name, "coff-Intel-big") != 0) { @@ -1407,7 +1409,7 @@ _bfd_final_link_relocate (howto, input_bfd, input_section, contents, address, bfd_vma relocation; /* Sanity check the address. */ - if (address > input_section->_cooked_size) + if (address > input_section->_raw_size) return bfd_reloc_outofrange; /* This function assumes that we are dealing with a basic relocation @@ -1799,6 +1801,15 @@ decided relatively late. ENUM + BFD_RELOC_SWREL32 +ENUMX + BFD_RELOC_SWREL64 +ENUMDOC + For openVMS/Alpha systems, these are displacements for switch +tables. + + +ENUM BFD_RELOC_I960_CALLJ ENUMDOC Reloc types used for i960/b.out. @@ -1883,8 +1894,8 @@ ENUMDOC ENUM BFD_RELOC_ALPHA_GPDISP_HI16 ENUMDOC - Alpha ECOFF relocations. Some of these treat the symbol or "addend" - in some special way. + Alpha ECOFF and ELF relocations. Some of these treat the symbol or + "addend" in some special way. For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when writing; when reading, it will be the absolute section symbol. The addend is the displacement in bytes of the "lda" instruction from @@ -1898,6 +1909,13 @@ ENUMDOC reading, for convenience. ENUM + BFD_RELOC_ALPHA_GPDISP +ENUMDOC + The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 + relocation except that there is no accompanying GPDISP_LO16 + relocation. + +ENUM BFD_RELOC_ALPHA_LITERAL ENUMX BFD_RELOC_ALPHA_LITUSE @@ -1930,6 +1948,17 @@ ENUMDOC prediction logic which may be provided on some processors. ENUM + BFD_RELOC_ALPHA_LINKAGE +ENUMDOC + The LINKAGE relocation outputs a special code in the object file, + the rest is handled by the linker. + +ENUM + BFD_RELOC_ALPHA_BASEREG +ENUMDOC + The BASEREG relocation calculates differences to basereg. + +ENUM BFD_RELOC_MIPS_JMP ENUMDOC Bits 27..2 of the relocation address shifted right 2 bits; @@ -1981,6 +2010,10 @@ ENUMX BFD_RELOC_MIPS_GOT_HI16 ENUMX BFD_RELOC_MIPS_GOT_LO16 +ENUMX + BFD_RELOC_MIPS_CALL_HI16 +ENUMX + BFD_RELOC_MIPS_CALL_LO16 ENUMDOC MIPS ELF relocations. @@ -2146,6 +2179,36 @@ ENUMDOC through 0. COMMENT {* end-sanitize-arc *} + +COMMENT +{* start-sanitize-d10v *} +ENUM + BFD_RELOC_D10V_10_PCREL_R +ENUMDOC + Mitsubishi D10V relocs. + This is a 10-bit reloc with the right 2 bits + assumed to be 0. +ENUM + BFD_RELOC_D10V_10_PCREL_L +ENUMDOC + Mitsubishi D10V relocs. + This is a 10-bit reloc with the right 2 bits + assumed to be 0. This is the same as the previous reloc + except it is in the left container, i.e., + shifted left 15 bits. +ENUM + BFD_RELOC_D10V_18 +ENUMDOC + This is an 18-bit reloc with the right 2 bits + assumed to be 0. +ENUM + BFD_RELOC_D10V_18_PCREL +ENUMDOC + This is an 18-bit reloc with the right 2 bits + assumed to be 0. +COMMENT +{* end-sanitize-d10v *} + ENDSENUM BFD_RELOC_UNUSED CODE_FRAGMENT diff --git a/bfd/targets.c b/bfd/targets.c index 24a0963..6a0a673 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -1,5 +1,5 @@ /* Generic target-file-type support for the BFD library. - Copyright 1990, 91, 92, 93, 94, 1995 Free Software Foundation, Inc. + Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -149,7 +149,8 @@ DESCRIPTION . bfd_target_som_flavour, . bfd_target_os9k_flavour, . bfd_target_versados_flavour, -. bfd_target_msdos_flavour +. bfd_target_msdos_flavour, +. bfd_target_evax_flavour .}; . .enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; @@ -480,17 +481,23 @@ extern const bfd_target armpei_little_vec; extern const bfd_target armpei_big_vec; extern const bfd_target b_out_vec_big_host; extern const bfd_target b_out_vec_little_host; +extern const bfd_target bfd_elf64_alpha_vec; /* start-sanitize-arc */ extern const bfd_target bfd_elf32_bigarc_vec; extern const bfd_target bfd_elf32_littlearc_vec; /* end-sanitize-arc */ extern const bfd_target bfd_elf32_big_generic_vec; extern const bfd_target bfd_elf32_bigmips_vec; +extern const bfd_target bfd_elf64_bigmips_vec; +/* start-sanitize-d10v */ +extern const bfd_target bfd_elf32_d10v_vec; +/* end-sanitize-d10v */ extern const bfd_target bfd_elf32_hppa_vec; extern const bfd_target bfd_elf32_i386_vec; extern const bfd_target bfd_elf32_i860_vec; extern const bfd_target bfd_elf32_little_generic_vec; extern const bfd_target bfd_elf32_littlemips_vec; +extern const bfd_target bfd_elf64_littlemips_vec; extern const bfd_target bfd_elf32_m68k_vec; extern const bfd_target bfd_elf32_m88k_vec; extern const bfd_target bfd_elf32_powerpc_vec; @@ -503,6 +510,7 @@ extern const bfd_target demo_64_vec; extern const bfd_target ecoff_big_vec; extern const bfd_target ecoff_little_vec; extern const bfd_target ecoffalpha_little_vec; +extern const bfd_target evax_alpha_vec; extern const bfd_target h8300coff_vec; extern const bfd_target h8500coff_vec; extern const bfd_target host_aout_vec; @@ -532,8 +540,10 @@ extern const bfd_target i860coff_vec; extern const bfd_target icoff_big_vec; extern const bfd_target icoff_little_vec; extern const bfd_target ieee_vec; +extern const bfd_target m68kaux_coff_vec; extern const bfd_target m68kcoff_vec; extern const bfd_target m68kcoffun_vec; +extern const bfd_target m68klinux_vec; extern const bfd_target m68klynx_aout_vec; extern const bfd_target m68klynx_coff_vec; extern const bfd_target m68knetbsd_vec; @@ -548,13 +558,11 @@ extern const bfd_target nlm32_powerpc_vec; extern const bfd_target pc532netbsd_vec; extern const bfd_target oasys_vec; extern const bfd_target pc532machaout_vec; +extern const bfd_target ppcboot_vec; extern const bfd_target riscix_vec; extern const bfd_target pmac_xcoff_vec; extern const bfd_target rs6000coff_vec; extern const bfd_target shcoff_vec; -/* start-sanitize-rce */ -extern bfd_target rce_aout_vec; -/* end-sanitize-rce */ extern const bfd_target shlcoff_vec; extern const bfd_target sparclynx_aout_vec; extern const bfd_target sparclynx_coff_vec; @@ -619,10 +627,19 @@ const bfd_target * const bfd_target_vector[] = { --enable-targets=all, objdump or gdb should be able to examine the file even if we don't recognize the machine type. */ &bfd_elf32_big_generic_vec, +#ifdef BFD64 + &bfd_elf64_alpha_vec, +#endif /* start-sanitize-arc */ &bfd_elf32_bigarc_vec, /* end-sanitize-arc */ &bfd_elf32_bigmips_vec, +#ifdef BFD64 + &bfd_elf64_bigmips_vec, +#endif +/* start-sanitize-d10v */ + &bfd_elf32_d10v_vec, +/* end-sanitize-d10v */ &bfd_elf32_hppa_vec, &bfd_elf32_i386_vec, &bfd_elf32_i860_vec, @@ -631,6 +648,9 @@ const bfd_target * const bfd_target_vector[] = { &bfd_elf32_littlearc_vec, /* end-sanitize-arc */ &bfd_elf32_littlemips_vec, +#ifdef BFD64 + &bfd_elf64_littlemips_vec, +#endif &bfd_elf32_m68k_vec, &bfd_elf32_m88k_vec, &bfd_elf32_sparc_vec, @@ -650,8 +670,9 @@ const bfd_target * const bfd_target_vector[] = { #endif &ecoff_big_vec, &ecoff_little_vec, -#if 0 +#ifdef BFD64 &ecoffalpha_little_vec, + &evax_alpha_vec, #endif &h8300coff_vec, &h8500coff_vec, @@ -704,6 +725,11 @@ const bfd_target * const bfd_target_vector[] = { &ieee_vec, &m68kcoff_vec, &m68kcoffun_vec, +#if 0 + /* Since a.out files lack decent magic numbers, no way to recognize + which kind of a.out file it is. */ + &m68klinux_vec, +#endif &m68klynx_aout_vec, &m68klynx_coff_vec, &m68knetbsd_vec, @@ -736,11 +762,9 @@ const bfd_target * const bfd_target_vector[] = { &pmac_xcoff_vec, #endif &rs6000coff_vec, + &ppcboot_vec, &shcoff_vec, &shlcoff_vec, -/* start-sanitize-rce */ - &rce_aout_vec, -/* end-sanitize-rce */ &sparclynx_aout_vec, &sparclynx_coff_vec, &sparcnetbsd_vec, |