From 95c5070c6ef2dafd9ea6026ce08862326bd08a24 Mon Sep 17 00:00:00 2001 From: Catherine Moore Date: Mon, 1 Feb 1999 20:21:00 +0000 Subject: [PATCH] * Makefile.am (elf32-arm-oldabi.lo): New. (elf32-arm-newabi.lo): New. * Makefile.in: Regenerate. * config.bfd (thumb-*-elf): Remove definition of targ_underscore. (arm-*-elf): Likewise. (arm-*-oabi): New. (thumb-*-oabi): New. * configure: Regenerate. * configure.in (bfd_elf32_littlearm_oabi_vec): New. (bfd_elf32_bigarm_oabi_vec): New. * elf32-arm-newabi.c: New. * elf32-arm-oldabi.c: New. * elf32-arm.c: Removed. * elf32-arm.h: New. --- bfd/ChangeLog | 17 ++ bfd/Makefile.am | 63 +++-- bfd/Makefile.in | 64 +++-- bfd/configure | 88 +++---- bfd/configure.in | 14 +- bfd/elf32-arm-newabi.c | 398 +++++++++++++++++++++++++++++++ bfd/elf32-arm-oldabi.c | 329 +++++++++++++++++++++++++ bfd/{elf32-arm.c => elf32-arm.h} | 333 ++------------------------ 8 files changed, 901 insertions(+), 405 deletions(-) create mode 100644 bfd/elf32-arm-newabi.c create mode 100644 bfd/elf32-arm-oldabi.c rename bfd/{elf32-arm.c => elf32-arm.h} (82%) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 41f2be1cff3..aecaf2b74a9 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,20 @@ +Mon Feb 1 11:46:31 1999 Catherine Moore + + * Makefile.am (elf32-arm-oldabi.lo): New. + (elf32-arm-newabi.lo): New. + * Makefile.in: Regenerate. + * config.bfd (thumb-*-elf): Remove definition of targ_underscore. + (arm-*-elf): Likewise. + (arm-*-oabi): New. + (thumb-*-oabi): New. + * configure: Regenerate. + * configure.in (bfd_elf32_littlearm_oabi_vec): New. + (bfd_elf32_bigarm_oabi_vec): New. + * elf32-arm-newabi.c: New. + * elf32-arm-oldabi.c: New. + * elf32-arm.c: Removed. + * elf32-arm.h: New. + Mon Feb 1 11:52:12 1999 Frank Ch. Eigler * binary.c (binary_set_section_contents): Omit warnings for diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 11cb1eebf25..ca6594c0922 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -150,7 +150,8 @@ BFD32_BACKENDS = \ ecofflink.lo \ elf.lo \ elf32-arc.lo \ - elf32-arm.lo \ + elf32-arm-oldabi.lo \ + elf32-arm-newabi.lo \ elf32-d10v.lo \ elf32-d30v.lo \ elf32-fr30.lo \ @@ -214,6 +215,11 @@ BFD32_BACKENDS = \ sunos.lo \ vaxnetbsd.lo \ versados.lo \ + vms.lo \ + vms-gsd.lo \ + vms-hdr.lo \ + vms-misc.lo \ + vms-tir.lo \ xcofflink.lo BFD32_BACKENDS_CFILES = \ @@ -258,7 +264,8 @@ BFD32_BACKENDS_CFILES = \ ecofflink.c \ elf.c \ elf32-arc.c \ - elf32-arm.c \ + elf32-arm-oldabi.c \ + elf32-arm-newabi.c \ elf32-d10v.c \ elf32-d30v.c \ elf32-fr30.c \ @@ -322,6 +329,11 @@ BFD32_BACKENDS_CFILES = \ sunos.c \ vaxnetbsd.c \ versados.c \ + vms.c \ + vms-gsd.c \ + vms-hdr.c \ + vms-misc.c \ + vms-tir.c \ xcofflink.c # The .o files needed by all of the 64 bit vectors that are configured into @@ -337,12 +349,7 @@ BFD64_BACKENDS = \ elf64-sparc.lo \ elf64.lo \ nlm32-alpha.lo \ - nlm64.lo \ - vms.lo \ - vms-gsd.lo \ - vms-hdr.lo \ - vms-misc.lo \ - vms-tir.lo + nlm64.lo BFD64_BACKENDS_CFILES = \ aout64.c \ @@ -354,12 +361,7 @@ BFD64_BACKENDS_CFILES = \ elf64-sparc.c \ elf64.c \ nlm32-alpha.c \ - nlm64.c \ - vms.c \ - vms-gsd.c \ - vms-hdr.c \ - vms-misc.c \ - vms-tir.c + nlm64.c OPTIONAL_BACKENDS = \ aix386-core.lo \ @@ -367,6 +369,7 @@ OPTIONAL_BACKENDS = \ irix-core.lo \ lynx-core.lo \ osf-core.lo \ + sco5-core.lo \ trad-core.lo \ cisco-core.lo @@ -376,6 +379,7 @@ OPTIONAL_BACKENDS_CFILES = \ irix-core.c \ lynx-core.c \ osf-core.c \ + sco5-core.c \ trad-core.c \ cisco-core.c @@ -616,7 +620,12 @@ coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/coff/tic80.h $(INCDIR)/coff/internal.h coffcode.h end-sanitize-tic80: -elf32-arm.lo: elf32-arm.c elf-bfd.h $(INCDIR)/elf/common.h \ +elf32-arm-oldabi.lo: elf32-arm-oldabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h + +# What appears below is generated by a hacked mkdep using gcc -MM. +elf32-arm-newabi.lo: elf32-arm-newabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h @@ -658,6 +667,7 @@ cpu-arc.lo: cpu-arc.c cpu-arm.lo: cpu-arm.c cpu-d10v.lo: cpu-d10v.c cpu-d30v.lo: cpu-d30v.c +cpu-fr30.lo: cpu-fr30.c cpu-h8300.lo: cpu-h8300.c cpu-h8500.lo: cpu-h8500.c cpu-hppa.lo: cpu-hppa.c @@ -794,6 +804,12 @@ elf.lo: elf.c $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ elf32-arc.lo: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-arm-oldabi.lo: elf32-arm-oldabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-arm-newabi.lo: elf32-arm-newabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-d10v.lo: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf32-target.h @@ -802,7 +818,7 @@ elf32-d30v.lo: elf32-d30v.c elf-bfd.h $(INCDIR)/elf/common.h \ elf32-target.h elf32-fr30.lo: elf32-fr30.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - elf32-target.h + $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf32-target.h @@ -821,7 +837,7 @@ elf32-m32r.lo: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m68k.lo: elf32-m68k.c $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - elf32-target.h + $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m88k.lo: elf32-m88k.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf32-target.h @@ -843,7 +859,7 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - elf32-target.h + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ @@ -974,6 +990,11 @@ vaxnetbsd.lo: vaxnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h versados.lo: versados.c $(INCDIR)/libiberty.h +vms.lo: vms.c $(INCDIR)/bfdlink.h vms.h +vms-gsd.lo: vms-gsd.c $(INCDIR)/bfdlink.h vms.h +vms-hdr.lo: vms-hdr.c $(INCDIR)/bfdlink.h vms.h +vms-misc.lo: vms-misc.c $(INCDIR)/bfdlink.h vms.h +vms-tir.lo: vms-tir.c $(INCDIR)/bfdlink.h vms.h xcofflink.lo: xcofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ libcoff.h aout64.lo: aout64.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \ @@ -1014,17 +1035,13 @@ nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/nlm/alpha-ext.h \ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h nlm64.lo: nlm64.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \ $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h -vms.lo: vms.c $(INCDIR)/bfdlink.h vms.h -vms-gsd.lo: vms-gsd.c $(INCDIR)/bfdlink.h vms.h -vms-hdr.lo: vms-hdr.c $(INCDIR)/bfdlink.h vms.h -vms-misc.lo: vms-misc.c $(INCDIR)/bfdlink.h vms.h -vms-tir.lo: vms-tir.c $(INCDIR)/bfdlink.h vms.h aix386-core.lo: aix386-core.c $(INCDIR)/coff/i386.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h hpux-core.lo: hpux-core.c irix-core.lo: irix-core.c lynx-core.lo: lynx-core.c osf-core.lo: osf-core.c +sco5-core.lo: sco5-core.c libaout.h $(INCDIR)/bfdlink.h trad-core.lo: trad-core.c libaout.h $(INCDIR)/bfdlink.h cisco-core.lo: cisco-core.c # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 61ebf092b77..ca769829655 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -264,7 +264,8 @@ BFD32_BACKENDS = \ ecofflink.lo \ elf.lo \ elf32-arc.lo \ - elf32-arm.lo \ + elf32-arm-oldabi.lo \ + elf32-arm-newabi.lo \ elf32-d10v.lo \ elf32-d30v.lo \ elf32-fr30.lo \ @@ -328,6 +329,11 @@ BFD32_BACKENDS = \ sunos.lo \ vaxnetbsd.lo \ versados.lo \ + vms.lo \ + vms-gsd.lo \ + vms-hdr.lo \ + vms-misc.lo \ + vms-tir.lo \ xcofflink.lo BFD32_BACKENDS_CFILES = \ @@ -372,7 +378,8 @@ BFD32_BACKENDS_CFILES = \ ecofflink.c \ elf.c \ elf32-arc.c \ - elf32-arm.c \ + elf32-arm-oldabi.c \ + elf32-arm-newabi.c \ elf32-d10v.c \ elf32-d30v.c \ elf32-fr30.c \ @@ -436,6 +443,11 @@ BFD32_BACKENDS_CFILES = \ sunos.c \ vaxnetbsd.c \ versados.c \ + vms.c \ + vms-gsd.c \ + vms-hdr.c \ + vms-misc.c \ + vms-tir.c \ xcofflink.c # The .o files needed by all of the 64 bit vectors that are configured into @@ -451,12 +463,7 @@ BFD64_BACKENDS = \ elf64-sparc.lo \ elf64.lo \ nlm32-alpha.lo \ - nlm64.lo \ - vms.lo \ - vms-gsd.lo \ - vms-hdr.lo \ - vms-misc.lo \ - vms-tir.lo + nlm64.lo BFD64_BACKENDS_CFILES = \ aout64.c \ @@ -468,12 +475,7 @@ BFD64_BACKENDS_CFILES = \ elf64-sparc.c \ elf64.c \ nlm32-alpha.c \ - nlm64.c \ - vms.c \ - vms-gsd.c \ - vms-hdr.c \ - vms-misc.c \ - vms-tir.c + nlm64.c OPTIONAL_BACKENDS = \ aix386-core.lo \ @@ -481,6 +483,7 @@ OPTIONAL_BACKENDS = \ irix-core.lo \ lynx-core.lo \ osf-core.lo \ + sco5-core.lo \ trad-core.lo \ cisco-core.lo @@ -490,6 +493,7 @@ OPTIONAL_BACKENDS_CFILES = \ irix-core.c \ lynx-core.c \ osf-core.c \ + sco5-core.c \ trad-core.c \ cisco-core.c @@ -595,7 +599,7 @@ all: all-recursive-am all-am .SUFFIXES: .SUFFIXES: .S .c .lo .o .s -$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: @MAINT@Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @@ -1091,7 +1095,11 @@ coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/coff/tic80.h $(INCDIR)/coff/internal.h coffcode.h end-sanitize-tic80: -elf32-arm.lo: elf32-arm.c elf-bfd.h $(INCDIR)/elf/common.h \ +elf32-arm-oldabi.lo: elf32-arm-oldabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h + +elf32-arm-newabi.lo: elf32-arm-newabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h @@ -1133,6 +1141,7 @@ cpu-arc.lo: cpu-arc.c cpu-arm.lo: cpu-arm.c cpu-d10v.lo: cpu-d10v.c cpu-d30v.lo: cpu-d30v.c +cpu-fr30.lo: cpu-fr30.c cpu-h8300.lo: cpu-h8300.c cpu-h8500.lo: cpu-h8500.c cpu-hppa.lo: cpu-hppa.c @@ -1269,6 +1278,12 @@ elf.lo: elf.c $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ elf32-arc.lo: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-arm-oldabi.lo: elf32-arm-oldabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-arm-newabi.lo: elf32-arm-newabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-d10v.lo: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf32-target.h @@ -1277,7 +1292,7 @@ elf32-d30v.lo: elf32-d30v.c elf-bfd.h $(INCDIR)/elf/common.h \ elf32-target.h elf32-fr30.lo: elf32-fr30.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - elf32-target.h + $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf32-target.h @@ -1296,7 +1311,7 @@ elf32-m32r.lo: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m68k.lo: elf32-m68k.c $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - elf32-target.h + $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m88k.lo: elf32-m88k.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf32-target.h @@ -1318,7 +1333,7 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - elf32-target.h + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ @@ -1449,6 +1464,11 @@ vaxnetbsd.lo: vaxnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h versados.lo: versados.c $(INCDIR)/libiberty.h +vms.lo: vms.c $(INCDIR)/bfdlink.h vms.h +vms-gsd.lo: vms-gsd.c $(INCDIR)/bfdlink.h vms.h +vms-hdr.lo: vms-hdr.c $(INCDIR)/bfdlink.h vms.h +vms-misc.lo: vms-misc.c $(INCDIR)/bfdlink.h vms.h +vms-tir.lo: vms-tir.c $(INCDIR)/bfdlink.h vms.h xcofflink.lo: xcofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ libcoff.h aout64.lo: aout64.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \ @@ -1489,17 +1509,13 @@ nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/nlm/alpha-ext.h \ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h nlm64.lo: nlm64.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \ $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h -vms.lo: vms.c $(INCDIR)/bfdlink.h vms.h -vms-gsd.lo: vms-gsd.c $(INCDIR)/bfdlink.h vms.h -vms-hdr.lo: vms-hdr.c $(INCDIR)/bfdlink.h vms.h -vms-misc.lo: vms-misc.c $(INCDIR)/bfdlink.h vms.h -vms-tir.lo: vms-tir.c $(INCDIR)/bfdlink.h vms.h aix386-core.lo: aix386-core.c $(INCDIR)/coff/i386.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h hpux-core.lo: hpux-core.c irix-core.lo: irix-core.c lynx-core.lo: lynx-core.c osf-core.lo: osf-core.c +sco5-core.lo: sco5-core.c libaout.h $(INCDIR)/bfdlink.h trad-core.lo: trad-core.c libaout.h $(INCDIR)/bfdlink.h cisco-core.lo: cisco-core.c # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/bfd/configure b/bfd/configure index 3b36792ebc6..90df180d1c7 100755 --- a/bfd/configure +++ b/bfd/configure @@ -4395,6 +4395,9 @@ EOF #define TRAD_HEADER "hosts/esix.h" EOF + ;; + i[3456]86-*-sco3.2v5*) + COREFILE=sco5-core.lo ;; i[3456]86-*-sco* | i[3456]86-*-isc*) COREFILE=trad-core.lo @@ -4591,6 +4594,7 @@ EOF osf-core.lo) COREFLAG=-DOSF_CORE ;; ptrace-core.lo) COREFLAG=-DPTRACE_CORE ;; rs6000-core.lo) COREFLAG="$COREFLAG -DAIX_CORE" ;; + sco5-core.lo) COREFLAG="$COREFLAG -DSCO5_CORE" ;; trad-core.lo) COREFLAG="$COREFLAG -DTRAD_CORE" ;; esac @@ -4600,17 +4604,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4604: checking for $ac_hdr" >&5 +echo "configure:4608: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4618: \"$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* @@ -4638,19 +4642,19 @@ done if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4642: checking for prstatus_t in sys/procfs.h" >&5 +echo "configure:4646: checking for prstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { prstatus_t avar ; return 0; } EOF -if { (eval echo configure:4654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus_t=yes else @@ -4672,19 +4676,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6 echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4676: checking for prstatus_t.pr_who in sys/procfs.h" >&5 +echo "configure:4680: checking for prstatus_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { prstatus_t avar; void* aref = (void*) &avar.pr_who ; return 0; } EOF -if { (eval echo configure:4688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes else @@ -4706,19 +4710,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6 echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4710: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:4714: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { pstatus_t avar ; return 0; } EOF -if { (eval echo configure:4722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -4740,19 +4744,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4744: checking for prpsinfo_t in sys/procfs.h" >&5 +echo "configure:4748: checking for prpsinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { prpsinfo_t avar ; return 0; } EOF -if { (eval echo configure:4756: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo_t=yes else @@ -4774,19 +4778,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6 echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4778: checking for psinfo_t in sys/procfs.h" >&5 +echo "configure:4782: checking for psinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { psinfo_t avar ; return 0; } EOF -if { (eval echo configure:4790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo_t=yes else @@ -4808,19 +4812,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6 echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4812: checking for lwpstatus_t in sys/procfs.h" >&5 +echo "configure:4816: checking for lwpstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { lwpstatus_t avar ; return 0; } EOF -if { (eval echo configure:4824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpstatus_t=yes else @@ -4842,19 +4846,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4846: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 +echo "configure:4850: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { lwpstatus_t avar; void* aref = (void*) &avar.pr_context ; return 0; } EOF -if { (eval echo configure:4858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes else @@ -4876,19 +4880,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4880: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 +echo "configure:4884: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { lwpstatus_t avar; void* aref = (void*) &avar.pr_reg ; return 0; } EOF -if { (eval echo configure:4892: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes else @@ -5026,9 +5030,11 @@ do bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" target64=true ;; bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; - bfd_elf32_littlearm_vec) tb="$tb elf32-arm.lo elf32.lo $elf" ;; + bfd_elf32_littlearm_vec) tb="$tb elf32-arm-newabi.lo elf32.lo $elf" ;; + bfd_elf32_littlearm_oabi_vec) tb="$tb elf32-arm-oldabi.lo elf32.lo $elf" ;; bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; - bfd_elf32_bigarm_vec) tb="$tb elf32-arm.lo elf32.lo $elf" ;; + bfd_elf32_bigarm_vec) tb="$tb elf32-arm-newabi.lo elf32.lo $elf" ;; + bfd_elf32_bigarm_oabi_vec) tb="$tb elf32-arm-oldabi.lo elf32.lo $elf" ;; bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo" @@ -5227,17 +5233,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5231: checking for $ac_hdr" >&5 +echo "configure:5235: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5245: \"$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* @@ -5266,12 +5272,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5270: checking for $ac_func" >&5 +echo "configure:5274: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5302: \"$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 @@ -5319,7 +5325,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:5323: checking for working mmap" >&5 +echo "configure:5327: 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 @@ -5327,7 +5333,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5475: \"$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 @@ -5492,12 +5498,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5496: checking for $ac_func" >&5 +echo "configure:5500: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5528: \"$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 diff --git a/bfd/configure.in b/bfd/configure.in index f334a401779..3fadc74d714 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. dnl -AC_PREREQ(2.5) +AC_PREREQ(2.12.1) AC_INIT(libbfd.c) AC_CANONICAL_SYSTEM @@ -156,6 +156,11 @@ changequote([,])dnl COREFILE=trad-core.lo AC_DEFINE(TRAD_HEADER,"hosts/esix.h") ;; +changequote(,)dnl + i[3456]86-*-sco3.2v5*) +changequote([,])dnl + COREFILE=sco5-core.lo + ;; changequote(,)dnl i[3456]86-*-sco* | i[3456]86-*-isc*) changequote([,])dnl @@ -293,6 +298,7 @@ changequote([,])dnl osf-core.lo) COREFLAG=-DOSF_CORE ;; ptrace-core.lo) COREFLAG=-DPTRACE_CORE ;; rs6000-core.lo) COREFLAG="$COREFLAG -DAIX_CORE" ;; + sco5-core.lo) COREFLAG="$COREFLAG -DSCO5_CORE" ;; trad-core.lo) COREFLAG="$COREFLAG -DTRAD_CORE" ;; esac @@ -425,9 +431,11 @@ do bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" target64=true ;; bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; - bfd_elf32_littlearm_vec) tb="$tb elf32-arm.lo elf32.lo $elf" ;; + bfd_elf32_littlearm_vec) tb="$tb elf32-arm-newabi.lo elf32.lo $elf" ;; + bfd_elf32_littlearm_oabi_vec) tb="$tb elf32-arm-oldabi.lo elf32.lo $elf" ;; bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; - bfd_elf32_bigarm_vec) tb="$tb elf32-arm.lo elf32.lo $elf" ;; + bfd_elf32_bigarm_vec) tb="$tb elf32-arm-newabi.lo elf32.lo $elf" ;; + bfd_elf32_bigarm_oabi_vec) tb="$tb elf32-arm-oldabi.lo elf32.lo $elf" ;; bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo" diff --git a/bfd/elf32-arm-newabi.c b/bfd/elf32-arm-newabi.c new file mode 100644 index 00000000000..0278a470394 --- /dev/null +++ b/bfd/elf32-arm-newabi.c @@ -0,0 +1,398 @@ +/* 32-bit ELF support for ARM new abi option. + Copyright 1999 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 "elf/arm.h" +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" + +#define USE_REL + +#define TARGET_LITTLE_SYM bfd_elf32_littlearm_vec +#define TARGET_LITTLE_NAME "elf32-littlearm" +#define TARGET_BIG_SYM bfd_elf32_bigarm_vec +#define TARGET_BIG_NAME "elf32-bigarm" +#define elf_info_to_howto 0 +#define elf_info_to_howto_rel elf32_arm_info_to_howto_rel + + +static reloc_howto_type elf32_arm_howto_table[] = +{ + /* No relocation */ + HOWTO (R_ARM_NONE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_PC24, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_PC24", /* name */ + false, /* partial_inplace */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 32 bit absolute */ + HOWTO (R_ARM_ABS32, /* 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_ARM_ABS32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* standard 32bit pc-relative reloc */ + HOWTO (R_ARM_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_REL32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 8 bit absolute */ + HOWTO (R_ARM_PC13, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_PC13", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit absolute */ + HOWTO (R_ARM_ABS16, /* 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_ARM_ABS16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* 12 bit absolute */ + HOWTO (R_ARM_ABS12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS12", /* name */ + false, /* partial_inplace */ + 0x000008ff, /* src_mask */ + 0x000008ff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_THM_ABS5, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_ABS5", /* name */ + false, /* partial_inplace */ + 0x000007e0, /* src_mask */ + 0x000007e0, /* dst_mask */ + false), /* pcrel_offset */ + + /* 8 bit absolute */ + HOWTO (R_ARM_ABS8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS8", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_SBREL32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_SBREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_THM_PC22, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 22, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC22", /* name */ + false, /* partial_inplace */ + 0x07ff07ff, /* src_mask */ + 0x07ff07ff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_ARM_THM_PC8, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC8", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_ARM_AMP_VCALL9, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_AMP_VCALL9", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_ARM_SWI24, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_SWI24", /* name */ + false, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0x00000000, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_THM_SWI8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_SWI8", /* name */ + false, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0x00000000, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RREL32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RABS32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RABS32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RPC24, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RPC24", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RBASE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RBASE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + +}; + + /* GNU extension to record C++ vtable hierarchy */ +static reloc_howto_type elf32_arm_vtinherit_howto = + HOWTO (R_ARM_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_ARM_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false); /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage */ +static reloc_howto_type elf32_arm_vtentry_howto = + HOWTO (R_ARM_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_ARM_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false); /* pcrel_offset */ + + /* 12 bit pc relative */ +static reloc_howto_type elf32_arm_thm_pc11_howto = + HOWTO (R_ARM_THM_PC11, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC11", /* name */ + false, /* partial_inplace */ + 0x000007ff, /* src_mask */ + 0x000007ff, /* dst_mask */ + true); /* pcrel_offset */ + + /* 12 bit pc relative */ +static reloc_howto_type elf32_arm_thm_pc9_howto = + HOWTO (R_ARM_THM_PC9, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC9", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + true); /* pcrel_offset */ + + +static void +elf32_arm_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) + bfd *abfd; + arelent *bfd_reloc; + Elf32_Internal_Rel *elf_reloc; +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (elf_reloc->r_info); + if (r_type == R_ARM_GNU_VTINHERIT) + bfd_reloc->howto = &elf32_arm_vtinherit_howto; + else if (r_type == R_ARM_GNU_VTENTRY) + bfd_reloc->howto = &elf32_arm_vtentry_howto; + else if (r_type == R_ARM_THM_PC11) + bfd_reloc->howto = &elf32_arm_thm_pc11_howto; + else if (r_type == R_ARM_THM_PC9) + bfd_reloc->howto = &elf32_arm_thm_pc9_howto; + else + bfd_reloc->howto = &elf32_arm_howto_table[r_type]; +} +#include "elf32-arm.h" diff --git a/bfd/elf32-arm-oldabi.c b/bfd/elf32-arm-oldabi.c new file mode 100644 index 00000000000..dd49e01df22 --- /dev/null +++ b/bfd/elf32-arm-oldabi.c @@ -0,0 +1,329 @@ +/* 32-bit ELF support for ARM old abi option. + Copyright 1999 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 "elf/arm-oabi.h" +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" + +#define USE_RELA + +#define TARGET_LITTLE_SYM bfd_elf32_littlearm_oabi_vec +#define TARGET_LITTLE_NAME "elf32-littlearm-oabi" +#define TARGET_BIG_SYM bfd_elf32_bigarm_oabi_vec +#define TARGET_BIG_NAME "elf32-bigarm-oabi" +#define elf_info_to_howto elf32_arm_info_to_howto +#define elf_info_to_howto_rel 0 + +static reloc_howto_type elf32_arm_howto_table[] = +{ + /* No relocation */ + HOWTO (R_ARM_NONE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_PC24, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_PC24", /* name */ + false, /* partial_inplace */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 32 bit absolute */ + HOWTO (R_ARM_ABS32, /* 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_ARM_ABS32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* standard 32bit pc-relative reloc */ + HOWTO (R_ARM_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_REL32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 8 bit absolute */ + HOWTO (R_ARM_ABS8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS8", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit absolute */ + HOWTO (R_ARM_ABS16, /* 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_ARM_ABS16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* 12 bit absolute */ + HOWTO (R_ARM_ABS12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS12", /* name */ + false, /* partial_inplace */ + 0x000008ff, /* src_mask */ + 0x000008ff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_THM_ABS5, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_ABS5", /* name */ + false, /* partial_inplace */ + 0x000007e0, /* src_mask */ + 0x000007e0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_THM_PC22, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 22, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC22", /* name */ + false, /* partial_inplace */ + 0x07ff07ff, /* src_mask */ + 0x07ff07ff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_ARM_SBREL32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_SBREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_AMP_VCALL9, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_AMP_VCALL9", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 12 bit pc relative */ + HOWTO (R_ARM_THM_PC11, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC11", /* name */ + false, /* partial_inplace */ + 0x000007ff, /* src_mask */ + 0x000007ff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 12 bit pc relative */ + HOWTO (R_ARM_THM_PC9, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC9", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + true), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy */ + HOWTO (R_ARM_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_ARM_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage */ + HOWTO (R_ARM_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_ARM_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + + HOWTO (R_ARM_RREL32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RABS32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RABS32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RPC24, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RPC24", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RBASE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RBASE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + +}; + +static void +elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) + bfd *abfd; + arelent *bfd_reloc; + Elf32_Internal_Rela *elf_reloc; +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (elf_reloc->r_info); + /* fixme: need range test */ + /* BFD_ASSERT (r_type < (unsigned int) R_ELF32_ARM_MAX); */ + bfd_reloc->howto = &elf32_arm_howto_table[r_type]; +} +#include "elf32-arm.h" diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.h similarity index 82% rename from bfd/elf32-arm.c rename to bfd/elf32-arm.h index 70000bd3b09..857fe38b7af 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.h @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM - Copyright 1993, 1995, 1998 Free Software Foundation, Inc. + Copyright 1998, 1999 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,12 +17,6 @@ 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/arm.h" typedef unsigned long int insn32; typedef unsigned short int insn16; @@ -628,289 +622,6 @@ error_return: } -#define USE_RELA -#define TARGET_UNDERSCORE '_' - -static reloc_howto_type elf32_arm_howto_table[] = -{ - /* No relocation */ - HOWTO (R_ARM_NONE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_PC24, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 24, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_PC24", /* name */ - false, /* partial_inplace */ - 0x00ffffff, /* src_mask */ - 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 32 bit absolute */ - HOWTO (R_ARM_ABS32, /* 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_ARM_ABS32", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* standard 32bit pc-relative reloc */ - HOWTO (R_ARM_REL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_REL32", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 8 bit absolute */ - HOWTO (R_ARM_ABS8, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS8", /* name */ - false, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit absolute */ - HOWTO (R_ARM_ABS16, /* 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_ARM_ABS16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* 12 bit absolute */ - HOWTO (R_ARM_ABS12, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS12", /* name */ - false, /* partial_inplace */ - 0x000008ff, /* src_mask */ - 0x000008ff, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_THM_ABS5, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 5, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_ABS5", /* name */ - false, /* partial_inplace */ - 0x000007e0, /* src_mask */ - 0x000007e0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_THM_PC22, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 22, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC22", /* name */ - false, /* partial_inplace */ - 0x07ff07ff, /* src_mask */ - 0x07ff07ff, /* dst_mask */ - true), /* pcrel_offset */ - - HOWTO (R_ARM_SBREL32, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_SBREL32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_AMP_VCALL9, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_AMP_VCALL9", /* name */ - false, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 12 bit pc relative */ - HOWTO (R_ARM_THM_PC11, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 11, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC11", /* name */ - false, /* partial_inplace */ - 0x000007ff, /* src_mask */ - 0x000007ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 12 bit pc relative */ - HOWTO (R_ARM_THM_PC9, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC9", /* name */ - false, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* GNU extension to record C++ vtable hierarchy */ - HOWTO (R_ARM_GNU_VTINHERIT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_ARM_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* GNU extension to record C++ vtable member usage */ - HOWTO (R_ARM_GNU_VTENTRY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_elf_rel_vtable_reloc_fn, /* special_function */ - "R_ARM_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - - HOWTO (R_ARM_RREL32, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RREL32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_RABS32, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RABS32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_RPC24, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RPC24", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_RBASE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RBASE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - -}; struct elf32_arm_reloc_map { unsigned char bfd_reloc_val; @@ -954,20 +665,6 @@ elf32_arm_reloc_type_lookup (abfd, code) return NULL; } -static void -elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) - bfd *abfd; - arelent *bfd_reloc; - Elf32_Internal_Rela *elf_reloc; -{ - unsigned int r_type; - - r_type = ELF32_R_TYPE (elf_reloc->r_info); - /* fixme: need range test */ - /* BFD_ASSERT (r_type < (unsigned int) R_ELF32_ARM_MAX); */ - bfd_reloc->howto = &elf32_arm_howto_table[r_type]; -} - /* The thumb form of a long branch is a bit finicky, because the offset encoding is split over two fields, each in it's own instruction. They can occur in any order. So given a thumb form of long branch, and an @@ -1245,6 +942,9 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, case R_ARM_PC24: /* Arm B/BL instruction */ +#ifdef USE_REL + addend = (bfd_get_32 (input_bfd, hit_data) & howto->src_mask); +#endif /* check for arm calling thumb function */ if (sym_flags == STT_ARM_TFUNC) { @@ -1265,6 +965,9 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, return bfd_reloc_ok; case R_ARM_ABS32: +#ifdef USE_REL + addend = (bfd_get_32 (input_bfd, hit_data) & howto->src_mask); +#endif value += addend; if (sym_flags == STT_ARM_TFUNC) value |= 1; @@ -1272,6 +975,9 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, return bfd_reloc_ok; case R_ARM_REL32: +#ifdef USE_REL + addend = (bfd_get_32 (input_bfd, hit_data) & howto->src_mask); +#endif value -= (input_section->output_section->vma + input_section->output_offset); value += addend; @@ -1280,8 +986,10 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, return bfd_reloc_ok; case R_ARM_ABS8: +#ifdef USE_REL + addend = (bfd_get_32 (input_bfd, hit_data) & howto->src_mask); +#endif value += addend; - if ((long) value > 0x7f || (long) value < -0x80) return bfd_reloc_overflow; @@ -1289,6 +997,9 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, return bfd_reloc_ok; case R_ARM_ABS16: +#ifdef USE_REL + addend = (bfd_get_32 (input_bfd, hit_data) & howto->src_mask); +#endif value += addend; if ((long) value > 0x7fff || (long) value < -0x8000) @@ -1300,6 +1011,9 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, case R_ARM_ABS12: /* Support ldr and str instruction for the arm */ /* Also thumb b (unconditional branch) */ +#ifdef USE_REL + addend = (bfd_get_32 (input_bfd, hit_data) & howto->src_mask); +#endif value += addend; if ((long) value > 0x7ff || (long) value < -0x800) @@ -1843,7 +1557,6 @@ elf32_arm_gc_mark_hook (abfd, info, rel, h, sym) break; default: - printf("h is %s\n", h->root.root.string); switch (h->root.type) { case bfd_link_hash_defined: @@ -2020,17 +1733,10 @@ elf32_arm_find_nearest_line return true; } - -#define TARGET_LITTLE_SYM bfd_elf32_littlearm_vec -#define TARGET_LITTLE_NAME "elf32-littlearm" -#define TARGET_BIG_SYM bfd_elf32_bigarm_vec -#define TARGET_BIG_NAME "elf32-bigarm" #define ELF_ARCH bfd_arch_arm #define ELF_MACHINE_CODE EM_ARM #define bfd_elf32_bfd_reloc_type_lookup elf32_arm_reloc_type_lookup -#define elf_info_to_howto elf32_arm_info_to_howto -#define elf_info_to_howto_rel 0 #define elf_backend_relocate_section elf32_arm_relocate_section #define bfd_elf32_bfd_copy_private_bfd_data elf32_arm_copy_private_bfd_data #define bfd_elf32_bfd_merge_private_bfd_data elf32_arm_merge_private_bfd_data @@ -2044,6 +1750,5 @@ elf32_arm_find_nearest_line #define elf_backend_check_relocs elf32_arm_check_relocs #define elf_backend_can_gc_sections 1 -#define elf_symbol_leading_char '_' #include "elf32-target.h" -- 2.30.2