Fallout from recent bfd_reloc_outofrange changes
authorAlan Modra <amodra@gmail.com>
Mon, 19 Jan 2015 00:06:26 +0000 (10:36 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 19 Jan 2015 09:07:45 +0000 (19:37 +1030)
Commit ec93045b and cd21f5da introduced a large number of tic4x and
tic54x regressions, due to the new checks being wrong for targets
with octets_per_byte != 1.  To fix that I introduced a new
bfd_get_section_limit_octets and performed the check on octets rather
than byte adresses, reducing the number of bfd_octets_per_byte calls.
bfd_octets_per_byte is rather expensive..

I then wondered why the same bfd_reloc_outofrange check added to
bfd_perform_relocation wasn't also added to bfd_install_relocation.
The two functions are virtually identical and ought to remain that
way.  However, adding the same check to bfd_install_relocation
resulted in ld-elf "FAIL Link eh-group.o to eh-group" on many ELF
targets, including x64_64-linux.  The reason being that eh-group.o
has NONE relocs at the end of a section, and most targets give NONE
relocs a non-zero size.  So if we are to keep the new outofrange
check it appears that NONE relocs must have a zero size.

* bfd-in.h (bfd_get_section_limit_octets): New define, extracted from..
(bfd_get_section_limit): ..here.
* reloc.c (bfd_perform_relocation): Correct bfd_reloc_outofrange check.
(bfd_install_relocation, _bfd_final_link_relocate): Add same check here.
* elf32-sh.c (sh_elf_reloc): Correct bfd_reloc_outofrange check.
* elf32-ppc.c (ppc_elf_addr16_ha_reloc): Remove duplicated
bfd_reloc_outofrange check.
* bfd-in2.h: Regenerate.

* cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Return bfd_reloc_ok
on zero size relocs.
* ecoff.c (ecoff_reloc_link_order): Likewise.
* elf32-nds32.c (nds32_relocate_contents): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.

* reloc.c (_bfd_relocate_contents): Don't bomb on zero size relocs.
(_bfd_clear_contents): Likewise.
* elfxx-mips.c (mips_elf_obtain_contents): Likewise.
(mips_elf_perform_relocation): Likewise.

* aoutx.h (aout_link_reloc_link_order): Allow for NULL return
from malloc on zero size alloc.
* cofflink.c (_bfd_coff_reloc_link_order): Likewise.
* elflink.c (elf_reloc_link_order): Likewise.
* linker.c (_bfd_generic_reloc_link_order): Likewise.
* pdp11.c (aout_link_reloc_link_order): Likewise.
* xcofflink.c (xcoff_reloc_link_order): Likewise.

* aoutx.h (howto_table_ext): Ensure NONE relocs have size 3,
bitsize 0, and complain_overflow_dont.
* coff-sparc.c (coff_sparc_howto_table): Likewise.
* elf-hppa.h (elf_hppa_howto_table): Likewise.
* elf-m10200.c (elf_mn10200_howto_table): Likewise.
* elf-m10300.c (elf_mn10300_howto_table): Likewise.
* elf32-arc.c (elf_arc_howto_table): Likewise.
* elf32-arm.c (elf32_arm_howto_table_1): Likewise.
* elf32-avr.c (elf_avr_howto_table): Likewise.
* elf32-bfin.c (bfin_howto_table): Likewise.
* elf32-cr16.c (cr16_elf_howto_table): Likewise.
* elf32-cris.c (cris_elf_howto_table): Likewise.
* elf32-crx.c (crx_elf_howto_table): Likewise.
* elf32-d10v.c (elf_d10v_howto_table): Likewise.
* elf32-d30v.c (elf_d30v_howto_table): Likewise.
* elf32-dlx.c (dlx_elf_howto_table): Likewise.
* elf32-epiphany.c (epiphany_elf_howto_table): Likewise.
* elf32-fr30.c (fr30_elf_howto_table): Likewise.
* elf32-frv.c (elf32_frv_howto_table): Likewise.
* elf32-h8300.c (h8_elf_howto_table): Likewise.
* elf32-i370.c (i370_elf_howto_raw): Likewise.
* elf32-i386.c (elf_howto_table): Likewise.
* elf32-i860.c (elf32_i860_howto_table): Likewise.
* elf32-i960.c (elf32_i960_relocate): Likewise.
* elf32-ip2k.c (ip2k_elf_howto_table): Likewise.
* elf32-iq2000.c (iq2000_elf_howto_table): Likewise.
* elf32-lm32.c (lm32_elf_howto_table): Likewise.
* elf32-m32c.c (m32c_elf_howto_table): Likewise.
* elf32-m32r.c (m32r_elf_howto_table): Likewise.
* elf32-m68hc11.c (elf_m68hc11_howto_table): Likewise.
* elf32-m68hc12.c (elf_m68hc11_howto_table): Likewise.
* elf32-m68k.c (howto_table): Likewise.
* elf32-mcore.c (mcore_elf_howto_raw): Likewise.
* elf32-mep.c (mep_elf_howto_table): Likewise.
* elf32-metag.c (elf_metag_howto_table): Likewise.
* elf32-microblaze.c (microblaze_elf_howto_raw): Likewise.
* elf32-mips.c (elf_mips_howto_table_rel): Likewise.
* elf32-moxie.c (moxie_elf_howto_table): Likewise.
* elf32-msp430.c (elf_msp430_howto_table): Likewise.
* elf32-mt.c (mt_elf_howto_table): Likewise.
* elf32-nds32.c (nds32_elf_howto_table): Likewise.
* elf32-nios2.c (elf_nios2_howto_table_rel): Likewise.
* elf32-or1k.c (or1k_elf_howto_table): Likewise.
* elf32-pj.c (pj_elf_howto_table): Likewise.
* elf32-ppc.c (ppc_elf_howto_raw): Likewise.
* elf32-rl78.c (rl78_elf_howto_table): Likewise.
* elf32-rx.c (rx_elf_howto_table): Likewise.
* elf32-s390.c (elf_howto_table): Likewise.
* elf32-score.c (elf32_score_howto_table): Likewise.
* elf32-score7.c (elf32_score_howto_table): Likewise.
* elf32-sh-relocs.h (R_SH_NONE): Likewise.
* elf32-spu.c (elf_howto_table): Likewise.
* elf32-tic6x.c (elf32_tic6x_howto_table): Likewise.
* elf32-tilepro.c (tilepro_elf_howto_table): Likewise.
* elf32-v850.c (v850_elf_howto_table): Likewise.
* elf32-vax.c (howto_table): Likewise.
* elf32-visium.c (visium_elf_howto_table): Likewise.
* elf32-xc16x.c (xc16x_elf_howto_table): Likewise.
* elf32-xgate.c (elf_xgate_howto_table): Likewise.
* elf32-xstormy16.c (xstormy16_elf_howto_table): Likewise.
* elf32-xtensa.c (elf_howto_table): Likewise.
* elf64-alpha.c (elf64_alpha_howto_table): Likewise.
* elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
* elf64-mmix.c (elf_mmix_howto_table): Likewise.
* elf64-ppc.c (ppc64_elf_howto_raw): Likewise.
* elf64-s390.c (elf_howto_table): Likewise.
* elf64-sh64.c (sh_elf64_howto_table): Likewise.
* elf64-x86-64.c (x86_64_elf_howto_table): Likewise.
* elfn32-mips.c (elf_mips_howto_table_rel): Likewise.
* elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
(elfNN_aarch64_howto_none): Likewise.
* elfxx-ia64.c (ia64_howto_table): Likewise.
* elfxx-sparc.c (_bfd_sparc_elf_howto_table): Likewise.
* elfxx-tilegx.c (tilegx_elf_howto_table): Likewise.
* nlm32-sparc.c (nlm32_sparc_howto_table): Likewise.

87 files changed:
bfd/ChangeLog
bfd/aoutx.h
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/coff-sparc.c
bfd/cofflink.c
bfd/cpu-ns32k.c
bfd/ecoff.c
bfd/elf-hppa.h
bfd/elf-m10200.c
bfd/elf-m10300.c
bfd/elf32-arc.c
bfd/elf32-arm.c
bfd/elf32-avr.c
bfd/elf32-bfin.c
bfd/elf32-cr16.c
bfd/elf32-cris.c
bfd/elf32-crx.c
bfd/elf32-d10v.c
bfd/elf32-d30v.c
bfd/elf32-dlx.c
bfd/elf32-epiphany.c
bfd/elf32-fr30.c
bfd/elf32-frv.c
bfd/elf32-h8300.c
bfd/elf32-i370.c
bfd/elf32-i386.c
bfd/elf32-i860.c
bfd/elf32-i960.c
bfd/elf32-ip2k.c
bfd/elf32-iq2000.c
bfd/elf32-lm32.c
bfd/elf32-m32c.c
bfd/elf32-m32r.c
bfd/elf32-m68hc11.c
bfd/elf32-m68hc12.c
bfd/elf32-m68k.c
bfd/elf32-mcore.c
bfd/elf32-mep.c
bfd/elf32-metag.c
bfd/elf32-microblaze.c
bfd/elf32-mips.c
bfd/elf32-moxie.c
bfd/elf32-msp430.c
bfd/elf32-mt.c
bfd/elf32-nds32.c
bfd/elf32-nios2.c
bfd/elf32-or1k.c
bfd/elf32-pj.c
bfd/elf32-ppc.c
bfd/elf32-rl78.c
bfd/elf32-rx.c
bfd/elf32-s390.c
bfd/elf32-score.c
bfd/elf32-score7.c
bfd/elf32-sh-relocs.h
bfd/elf32-sh.c
bfd/elf32-spu.c
bfd/elf32-tic6x.c
bfd/elf32-tilepro.c
bfd/elf32-v850.c
bfd/elf32-vax.c
bfd/elf32-visium.c
bfd/elf32-xc16x.c
bfd/elf32-xgate.c
bfd/elf32-xstormy16.c
bfd/elf32-xtensa.c
bfd/elf64-alpha.c
bfd/elf64-mips.c
bfd/elf64-mmix.c
bfd/elf64-ppc.c
bfd/elf64-s390.c
bfd/elf64-sh64.c
bfd/elf64-x86-64.c
bfd/elflink.c
bfd/elfn32-mips.c
bfd/elfnn-aarch64.c
bfd/elfxx-aarch64.c
bfd/elfxx-ia64.c
bfd/elfxx-mips.c
bfd/elfxx-sparc.c
bfd/elfxx-tilegx.c
bfd/linker.c
bfd/nlm32-sparc.c
bfd/pdp11.c
bfd/reloc.c
bfd/xcofflink.c

index 9558b5c3d39e98786d1ad20bdad8d70192067896..b9c6c389e7fc94d304df24a441cf38ebefe91b1b 100644 (file)
@@ -1,3 +1,109 @@
+2015-01-19  Alan Modra  <amodra@gmail.com>
+
+       * bfd-in.h (bfd_get_section_limit_octets): New define, extracted from..
+       (bfd_get_section_limit): ..here.
+       * reloc.c (bfd_perform_relocation): Correct bfd_reloc_outofrange check.
+       (bfd_install_relocation, _bfd_final_link_relocate): Add same check here.
+       * elf32-sh.c (sh_elf_reloc): Correct bfd_reloc_outofrange check.
+       * elf32-ppc.c (ppc_elf_addr16_ha_reloc): Remove duplicated
+       bfd_reloc_outofrange check.
+       * bfd-in2.h: Regenerate.
+
+       * cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Return bfd_reloc_ok
+       on zero size relocs.
+       * ecoff.c (ecoff_reloc_link_order): Likewise.
+       * elf32-nds32.c (nds32_relocate_contents): Likewise.
+       * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
+
+       * reloc.c (_bfd_relocate_contents): Don't bomb on zero size relocs.
+       (_bfd_clear_contents): Likewise.
+       * elfxx-mips.c (mips_elf_obtain_contents): Likewise.
+       (mips_elf_perform_relocation): Likewise.
+
+       * aoutx.h (aout_link_reloc_link_order): Allow for NULL return
+       from malloc on zero size alloc.
+       * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
+       * elflink.c (elf_reloc_link_order): Likewise.
+       * linker.c (_bfd_generic_reloc_link_order): Likewise.
+       * pdp11.c (aout_link_reloc_link_order): Likewise.
+       * xcofflink.c (xcoff_reloc_link_order): Likewise.
+
+       * aoutx.h (howto_table_ext): Ensure NONE relocs have size 3,
+       bitsize 0, and complain_overflow_dont.
+       * coff-sparc.c (coff_sparc_howto_table): Likewise.
+       * elf-hppa.h (elf_hppa_howto_table): Likewise.
+       * elf-m10200.c (elf_mn10200_howto_table): Likewise.
+       * elf-m10300.c (elf_mn10300_howto_table): Likewise.
+       * elf32-arc.c (elf_arc_howto_table): Likewise.
+       * elf32-arm.c (elf32_arm_howto_table_1): Likewise.
+       * elf32-avr.c (elf_avr_howto_table): Likewise.
+       * elf32-bfin.c (bfin_howto_table): Likewise.
+       * elf32-cr16.c (cr16_elf_howto_table): Likewise.
+       * elf32-cris.c (cris_elf_howto_table): Likewise.
+       * elf32-crx.c (crx_elf_howto_table): Likewise.
+       * elf32-d10v.c (elf_d10v_howto_table): Likewise.
+       * elf32-d30v.c (elf_d30v_howto_table): Likewise.
+       * elf32-dlx.c (dlx_elf_howto_table): Likewise.
+       * elf32-epiphany.c (epiphany_elf_howto_table): Likewise.
+       * elf32-fr30.c (fr30_elf_howto_table): Likewise.
+       * elf32-frv.c (elf32_frv_howto_table): Likewise.
+       * elf32-h8300.c (h8_elf_howto_table): Likewise.
+       * elf32-i370.c (i370_elf_howto_raw): Likewise.
+       * elf32-i386.c (elf_howto_table): Likewise.
+       * elf32-i860.c (elf32_i860_howto_table): Likewise.
+       * elf32-i960.c (elf32_i960_relocate): Likewise.
+       * elf32-ip2k.c (ip2k_elf_howto_table): Likewise.
+       * elf32-iq2000.c (iq2000_elf_howto_table): Likewise.
+       * elf32-lm32.c (lm32_elf_howto_table): Likewise.
+       * elf32-m32c.c (m32c_elf_howto_table): Likewise.
+       * elf32-m32r.c (m32r_elf_howto_table): Likewise.
+       * elf32-m68hc11.c (elf_m68hc11_howto_table): Likewise.
+       * elf32-m68hc12.c (elf_m68hc11_howto_table): Likewise.
+       * elf32-m68k.c (howto_table): Likewise.
+       * elf32-mcore.c (mcore_elf_howto_raw): Likewise.
+       * elf32-mep.c (mep_elf_howto_table): Likewise.
+       * elf32-metag.c (elf_metag_howto_table): Likewise.
+       * elf32-microblaze.c (microblaze_elf_howto_raw): Likewise.
+       * elf32-mips.c (elf_mips_howto_table_rel): Likewise.
+       * elf32-moxie.c (moxie_elf_howto_table): Likewise.
+       * elf32-msp430.c (elf_msp430_howto_table): Likewise.
+       * elf32-mt.c (mt_elf_howto_table): Likewise.
+       * elf32-nds32.c (nds32_elf_howto_table): Likewise.
+       * elf32-nios2.c (elf_nios2_howto_table_rel): Likewise.
+       * elf32-or1k.c (or1k_elf_howto_table): Likewise.
+       * elf32-pj.c (pj_elf_howto_table): Likewise.
+       * elf32-ppc.c (ppc_elf_howto_raw): Likewise.
+       * elf32-rl78.c (rl78_elf_howto_table): Likewise.
+       * elf32-rx.c (rx_elf_howto_table): Likewise.
+       * elf32-s390.c (elf_howto_table): Likewise.
+       * elf32-score.c (elf32_score_howto_table): Likewise.
+       * elf32-score7.c (elf32_score_howto_table): Likewise.
+       * elf32-sh-relocs.h (R_SH_NONE): Likewise.
+       * elf32-spu.c (elf_howto_table): Likewise.
+       * elf32-tic6x.c (elf32_tic6x_howto_table): Likewise.
+       * elf32-tilepro.c (tilepro_elf_howto_table): Likewise.
+       * elf32-v850.c (v850_elf_howto_table): Likewise.
+       * elf32-vax.c (howto_table): Likewise.
+       * elf32-visium.c (visium_elf_howto_table): Likewise.
+       * elf32-xc16x.c (xc16x_elf_howto_table): Likewise.
+       * elf32-xgate.c (elf_xgate_howto_table): Likewise.
+       * elf32-xstormy16.c (xstormy16_elf_howto_table): Likewise.
+       * elf32-xtensa.c (elf_howto_table): Likewise.
+       * elf64-alpha.c (elf64_alpha_howto_table): Likewise.
+       * elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
+       * elf64-mmix.c (elf_mmix_howto_table): Likewise.
+       * elf64-ppc.c (ppc64_elf_howto_raw): Likewise.
+       * elf64-s390.c (elf_howto_table): Likewise.
+       * elf64-sh64.c (sh_elf64_howto_table): Likewise.
+       * elf64-x86-64.c (x86_64_elf_howto_table): Likewise.
+       * elfn32-mips.c (elf_mips_howto_table_rel): Likewise.
+       * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
+       (elfNN_aarch64_howto_none): Likewise.
+       * elfxx-ia64.c (ia64_howto_table): Likewise.
+       * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Likewise.
+       * elfxx-tilegx.c (tilegx_elf_howto_table): Likewise.
+       * nlm32-sparc.c (nlm32_sparc_howto_table): Likewise.
+
 2015-01-15  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/17847
index d4e0fecb6bc758e3b9ac3813d04e5dde5f7b8580..e3bd2dddb6ae54022c3f286a6a7b1c23ce26324b 100644 (file)
@@ -203,8 +203,8 @@ reloc_howto_type howto_table_ext[] =
   HOWTO (RELOC_GLOB_DAT,0,  2, 0,  FALSE, 0, complain_overflow_bitfield, 0, "GLOB_DAT",    FALSE, 0, 0x00000000, FALSE),
   HOWTO (RELOC_JMP_SLOT,0,  2, 0,  FALSE, 0, complain_overflow_bitfield, 0, "JMP_SLOT",    FALSE, 0, 0x00000000, FALSE),
   HOWTO (RELOC_RELATIVE,0,  2, 0,  FALSE, 0, complain_overflow_bitfield, 0, "RELATIVE",    FALSE, 0, 0x00000000, FALSE),
-  HOWTO (0,             0,  0,  0,  FALSE, 0, complain_overflow_dont,     0, "R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
-  HOWTO (0,             0,  0,  0,  FALSE, 0, complain_overflow_dont,     0, "R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
+  HOWTO (0,             0,  3,  0,  FALSE, 0, complain_overflow_dont,     0, "R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
+  HOWTO (0,             0,  3,  0,  FALSE, 0, complain_overflow_dont,     0, "R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
 #define RELOC_SPARC_REV32 RELOC_WDISP19
   HOWTO (RELOC_SPARC_REV32, 0, 2, 32, FALSE, 0, complain_overflow_dont,   0,"R_SPARC_REV32",FALSE, 0, 0xffffffff, FALSE),
 };
@@ -3816,7 +3816,7 @@ aout_link_reloc_link_order (struct aout_final_link_info *flaginfo,
 
          size = bfd_get_reloc_size (howto);
          buf = (bfd_byte *) bfd_zmalloc (size);
-         if (buf == NULL)
+         if (buf == NULL && size != 0)
            return FALSE;
          r = MY_relocate_contents (howto, flaginfo->output_bfd,
                                    (bfd_vma) pr->addend, buf);
index 4b3738023e743c189dcb324ff1b80d88b5e190cc..8ffae997bd2176bb453b2ae96fb9a76efe3cb569 100644 (file)
@@ -292,10 +292,13 @@ typedef struct bfd_section *sec_ptr;
 
 #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
 
+#define bfd_get_section_limit_octets(bfd, sec)                 \
+  ((bfd)->direction != write_direction && (sec)->rawsize != 0  \
+   ? (sec)->rawsize : (sec)->size)
+
 /* Find the address one past the end of SEC.  */
 #define bfd_get_section_limit(bfd, sec) \
-  (((bfd)->direction != write_direction && (sec)->rawsize != 0 \
-    ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd))
+  (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
 
 /* Return TRUE if input section SEC has been discarded.  */
 #define discarded_section(sec)                         \
index b718f10d08ed03c5d918eaac824cf61cbcd33dc7..5de57e6f5c2c405c740249a42159fb4e241611f6 100644 (file)
@@ -299,10 +299,13 @@ typedef struct bfd_section *sec_ptr;
 
 #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
 
+#define bfd_get_section_limit_octets(bfd, sec)                 \
+  ((bfd)->direction != write_direction && (sec)->rawsize != 0  \
+   ? (sec)->rawsize : (sec)->size)
+
 /* Find the address one past the end of SEC.  */
 #define bfd_get_section_limit(bfd, sec) \
-  (((bfd)->direction != write_direction && (sec)->rawsize != 0 \
-    ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd))
+  (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))
 
 /* Return TRUE if input section SEC has been discarded.  */
 #define discarded_section(sec)                         \
index 232cefaceadd4ab446128896dda0c76f62976407..ae873110e36a690fd5a4029ab101455c0e6a5a56 100644 (file)
@@ -74,7 +74,7 @@ bfd_coff_generic_reloc (bfd *abfd ATTRIBUTE_UNUSED,
 
 static reloc_howto_type coff_sparc_howto_table[] =
 {
-  HOWTO(R_SPARC_NONE,    0,0, 0,FALSE,0,complain_overflow_dont,    bfd_coff_generic_reloc,"R_SPARC_NONE",    FALSE,0,0x00000000,TRUE),
+  HOWTO(R_SPARC_NONE,    0,3, 0,FALSE,0,complain_overflow_dont,    bfd_coff_generic_reloc,"R_SPARC_NONE",    FALSE,0,0x00000000,TRUE),
   HOWTO(R_SPARC_8,       0,0, 8,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_8",       FALSE,0,0x000000ff,TRUE),
   HOWTO(R_SPARC_16,      0,1,16,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_16",      FALSE,0,0x0000ffff,TRUE),
   HOWTO(R_SPARC_32,      0,2,32,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_32",      FALSE,0,0xffffffff,TRUE),
index ee4d032cbd02faf8fcc21a0c7917ddb5209e214d..0ac10de881977cf2cb0d9181784f5633a6d26a41 100644 (file)
@@ -2789,7 +2789,7 @@ _bfd_coff_reloc_link_order (bfd *output_bfd,
 
       size = bfd_get_reloc_size (howto);
       buf = (bfd_byte *) bfd_zmalloc (size);
-      if (buf == NULL)
+      if (buf == NULL && size != 0)
        return FALSE;
 
       rstat = _bfd_relocate_contents (howto, output_bfd,
index a08cf889bb0318f08435006209885c3cf10fa77b..5745427070aa6898bdc904aaf2723482b55c41f9 100644 (file)
@@ -585,8 +585,9 @@ _bfd_do_ns32k_reloc_contents (reloc_howto_type *howto,
   switch (size)
     {
     default:
-    case 0:
       abort ();
+    case 0:
+      return bfd_reloc_ok;
     case 1:
     case 2:
     case 4:
index f4f45a4a82cd1895cf173ada49fff1f3630ed1cf..504d6b987f4637cbf290f827914f52d1b31d014e 100644 (file)
@@ -3999,7 +3999,7 @@ ecoff_reloc_link_order (bfd *output_bfd,
 
       size = bfd_get_reloc_size (rel.howto);
       buf = (bfd_byte *) bfd_zmalloc (size);
-      if (buf == NULL)
+      if (buf == NULL && size != 0)
        return FALSE;
       rstat = _bfd_relocate_contents (rel.howto, output_bfd,
                                      (bfd_vma) addend, buf);
index 5e647962ea10224b901ef99e838fca194b5e4c78..b907f6e676c91b67eb5413c672083ab591265f2d 100644 (file)
@@ -47,7 +47,7 @@
 
 static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] =
 {
-  { R_PARISC_NONE, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
+  { R_PARISC_NONE, 0, 3, 0, FALSE, 0, complain_overflow_dont,
     bfd_elf_generic_reloc, "R_PARISC_NONE", FALSE, 0, 0, FALSE },
 
   /* The values in DIR32 are to placate the check in
index 70926861efc82932df26692ab0d63f9199355fec..45bfed774112f594111a686605ad8276ab928310 100644 (file)
@@ -46,11 +46,11 @@ static reloc_howto_type elf_mn10200_howto_table[] =
   /* Dummy relocation.  Does nothing.  */
   HOWTO (R_MN10200_NONE,
         0,
-        2,
-        16,
+        3,
+        0,
         FALSE,
         0,
-        complain_overflow_bitfield,
+        complain_overflow_dont,
         bfd_elf_generic_reloc,
         "R_MN10200_NONE",
         FALSE,
index 52457ed6e85d81555b8f87d40568ac10c768fec5..acb21ff0f39f103bb133c2a412201a8327c249d5 100644 (file)
@@ -142,11 +142,11 @@ static reloc_howto_type elf_mn10300_howto_table[] =
   /* Dummy relocation.  Does nothing.  */
   HOWTO (R_MN10300_NONE,
         0,
-        2,
-        16,
+        3,
+        0,
         FALSE,
         0,
-        complain_overflow_bitfield,
+        complain_overflow_dont,
         bfd_elf_generic_reloc,
         "R_MN10300_NONE",
         FALSE,
index 15116ca894b6a6b45f7b669739330eb8aafcffc9..ef71b256ae63f1a02c4af3d7e8a26008df40df84 100644 (file)
@@ -58,8 +58,8 @@ static reloc_howto_type elf_arc_howto_table[] =
   /* This reloc does nothing.  */
   HOWTO (R_ARC_NONE,           /* Type.  */
         0,                     /* Rightshift.  */
-        2,                     /* Size (0 = byte, 1 = short, 2 = long).  */
-        32,                    /* Bitsize.  */
+        3,                     /* Size (0 = byte, 1 = short, 2 = long).  */
+        0,                     /* Bitsize.  */
         FALSE,                 /* PC_relative.  */
         0,                     /* Bitpos.  */
         complain_overflow_bitfield, /* Complain_on_overflow.  */
index d36a7a538f10ba705db666e49778a622bb5fb4e8..3ebd1f301e43caf298c5b664259c159a9ec032a8 100644 (file)
@@ -79,7 +79,7 @@ static reloc_howto_type elf32_arm_howto_table_1[] =
   /* No relocation.  */
   HOWTO (R_ARM_NONE,           /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index adcf1a3c9c77ca896e3d43389d3da084dead822a..c88b6aafd52f0341f3c1aa7971a5b66921c731d3 100644 (file)
@@ -121,11 +121,11 @@ static reloc_howto_type elf_avr_howto_table[] =
 {
   HOWTO (R_AVR_NONE,           /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_AVR_NONE",          /* name */
         FALSE,                 /* partial_inplace */
index 07924832028ca36d8bd155c93a5c4ddec22ae1da..898010fbfd334b3fdbd10c21b0590f84fbd47a0c 100644 (file)
@@ -423,11 +423,11 @@ static reloc_howto_type bfin_howto_table [] =
   /* This reloc does nothing. .  */
   HOWTO (R_BFIN_UNUSED0,       /* type.  */
         0,                     /* rightshift.  */
-        2,                     /* size (0 = byte, 1 = short, 2 = long).  */
-        32,                    /* bitsize.  */
+        3,                     /* size (0 = byte, 1 = short, 2 = long).  */
+        0,                     /* bitsize.  */
         FALSE,                 /* pc_relative.  */
         0,                     /* bitpos.  */
-        complain_overflow_bitfield, /* complain_on_overflow.  */
+        complain_overflow_dont, /* complain_on_overflow.  */
         bfd_elf_generic_reloc, /* special_function.  */
         "R_BFIN_UNUSED0",      /* name.  */
         FALSE,                 /* partial_inplace.  */
@@ -451,11 +451,11 @@ static reloc_howto_type bfin_howto_table [] =
 
   HOWTO (R_BFIN_UNUSED1,       /* type.  */
         0,                     /* rightshift.  */
-        2,                     /* size (0 = byte, 1 = short, 2 = long).  */
-        32,                    /* bitsize.  */
+        3,                     /* size (0 = byte, 1 = short, 2 = long).  */
+        0,                     /* bitsize.  */
         FALSE,                 /* pc_relative.  */
         0,                     /* bitpos.  */
-        complain_overflow_bitfield, /* complain_on_overflow.  */
+        complain_overflow_dont, /* complain_on_overflow.  */
         bfd_elf_generic_reloc, /* special_function.  */
         "R_BFIN_UNUSED1",      /* name.  */
         FALSE,                 /* partial_inplace.  */
@@ -581,8 +581,8 @@ static reloc_howto_type bfin_howto_table [] =
 
   HOWTO (R_BFIN_UNUSEDB,       /* type.  */
         0,                     /* rightshift.  */
-        2,                     /* size (0 = byte, 1 = short, 2 = long).  */
-        32,                    /* bitsize.  */
+        3,                     /* size (0 = byte, 1 = short, 2 = long).  */
+        0,                     /* bitsize.  */
         FALSE,                 /* pc_relative.  */
         0,                     /* bitpos.  */
         complain_overflow_dont, /* complain_on_overflow.  */
@@ -595,8 +595,8 @@ static reloc_howto_type bfin_howto_table [] =
 
   HOWTO (R_BFIN_UNUSEDC,       /* type.  */
         0,                     /* rightshift.  */
-        2,                     /* size (0 = byte, 1 = short, 2 = long).  */
-        32,                    /* bitsize.  */
+        3,                     /* size (0 = byte, 1 = short, 2 = long).  */
+        0,                     /* bitsize.  */
         FALSE,                 /* pc_relative.  */
         0,                     /* bitpos.  */
         complain_overflow_dont, /* complain_on_overflow.  */
index 7b9976a3408f972e2d64523881c95154c4dfad39..23ced9e29295ff4610fb1e83ec39f6f302d4605a 100644 (file)
@@ -115,8 +115,8 @@ static reloc_howto_type cr16_elf_howto_table[] =
 {
   HOWTO (R_CR16_NONE,              /* type */
          0,                        /* rightshift */
-         2,                        /* size */
-         32,                       /* bitsize */
+         3,                        /* size */
+         0,                        /* bitsize */
          FALSE,                    /* pc_relative */
          0,                        /* bitpos */
          complain_overflow_dont,   /* complain_on_overflow */
index d9a3178428a768dbd687cdb9bb4530df8f8f78bb..46f51694f6ff15d281bdc2b28f483cd4ffefc1ec 100644 (file)
@@ -40,11 +40,11 @@ static reloc_howto_type cris_elf_howto_table [] =
   /* This reloc does nothing.  */
   HOWTO (R_CRIS_NONE,          /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_CRIS_NONE",         /* name */
         FALSE,                 /* partial_inplace */
index 3d82da2acbf8964de655cc2fbc8e42b38bbd9310..2b6411decb2be0c6ece18e60ff2678216987f72c 100644 (file)
@@ -82,8 +82,8 @@ static reloc_howto_type crx_elf_howto_table[] =
 {
   HOWTO (R_CRX_NONE,           /* type */
         0,                     /* rightshift */
-        2,                     /* size */
-        32,                    /* bitsize */
+        3,                     /* size */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
         complain_overflow_dont,/* complain_on_overflow */
index df9bb8919cb078575ce1a8d014465cebd1b9623a..951f7f56440846584a3b624095241deefe5425e6 100644 (file)
@@ -33,8 +33,8 @@ 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.  */
+        3,                     /* Size (0 = byte, 1 = short, 2 = long).  */
+        0,                     /* Bitsize.  */
         FALSE,                 /* PC_relative.  */
         0,                     /* Bitpos.  */
         complain_overflow_dont,/* Complain_on_overflow.  */
index 36e2bc4db8b40553a24d535faf99c9bc98fab8a2..fdf44ecd9df7b387a759283902eab3450378a15a 100644 (file)
@@ -254,11 +254,11 @@ static reloc_howto_type elf_d30v_howto_table[] =
   /* This reloc does nothing.  */
   HOWTO (R_D30V_NONE,          /* Type.  */
         0,                     /* Rightshift.  */
-        2,                     /* Size (0 = byte, 1 = short, 2 = long).  */
-        32,                    /* Bitsize.  */
+        3,                     /* Size (0 = byte, 1 = short, 2 = long).  */
+        0,                     /* Bitsize.  */
         FALSE,                 /* PC_relative.  */
         0,                     /* Bitpos.  */
-        complain_overflow_bitfield, /* Complain_on_overflow.  */
+        complain_overflow_dont, /* Complain_on_overflow.  */
         bfd_elf_generic_reloc, /* Special_function.  */
         "R_D30V_NONE",         /* Name.  */
         FALSE,                 /* Partial_inplace.  */
index 917a8b31564784156023a8066d1751fe135f1507..b8b73ab5b9c73110b569c149f000c1c8ded08e0f 100644 (file)
@@ -237,7 +237,7 @@ static reloc_howto_type dlx_elf_howto_table[]=
   /* No relocation.  */
   HOWTO (R_DLX_NONE,            /* Type. */
         0,                     /* Rightshift.  */
-        0,                     /* size (0 = byte, 1 = short, 2 = long).  */
+        3,                     /* size (0 = byte, 1 = short, 2 = long).  */
         0,                     /* Bitsize.  */
         FALSE,                 /* PC_relative.  */
         0,                     /* Bitpos.  */
index d3461b7d64684747d110e0424418e65aeeee33c3..bd640ae21a5727da2d9fa602fd1365045abdd597 100644 (file)
@@ -63,7 +63,7 @@ static reloc_howto_type epiphany_elf_howto_table [] =
          pr)                   /* pcrel_offset */
 
   /* This reloc does nothing.  */
-  AHOW (R_EPIPHANY_NONE,    0, 0,32, FALSE, 0, complain_overflow_dont,     "R_EPIPHANY_NONE",        0,          0),
+  AHOW (R_EPIPHANY_NONE,    0, 3,0, FALSE, 0, complain_overflow_dont,     "R_EPIPHANY_NONE",        0,          0),
 
   /* 8 bit absolute (not likely) */
   AHOW (R_EPIPHANY_8,       0, 0, 8, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_8",      0x000000ff, 0x000000ff),
index 620a43fd46c285b5f914c54b5b0bdde08e3e8095..d7c326d36481589c8173fec4f36d73e678ff3f68 100644 (file)
@@ -37,11 +37,11 @@ static reloc_howto_type fr30_elf_howto_table [] =
   /* This reloc does nothing.  */
   HOWTO (R_FR30_NONE,          /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_FR30_NONE",         /* name */
         FALSE,                 /* partial_inplace */
index ca0f78d008e8807fc456f62a1c90adab633e736c..deaa2e31803a429e2fef6a0edea3006556fb8eb3 100644 (file)
@@ -34,11 +34,11 @@ static reloc_howto_type elf32_frv_howto_table [] =
   /* This reloc does nothing.  */
   HOWTO (R_FRV_NONE,           /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_FRV_NONE",          /* name */
         FALSE,                 /* partial_inplace */
index d6d315dabd32c531cf50808f3062e033bfebc619..367603298a88279e28b5f3f9202ed71dce2208d9 100644 (file)
@@ -61,7 +61,7 @@ static reloc_howto_type h8_elf_howto_table[] =
 #define R_H8_NONE_X 0
   HOWTO (R_H8_NONE,            /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index ab65cfc6af2cc07519f1349400c9d1756f7d4881..7d92fe546641ad28844591ef5046edb0120e43ff 100644 (file)
@@ -40,11 +40,11 @@ static reloc_howto_type i370_elf_howto_raw[] =
   /* This reloc does nothing.  */
   HOWTO (R_I370_NONE,          /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_I370_NONE",         /* name */
         FALSE,                 /* partial_inplace */
index a6c8faab9a53655a1fb298abc3c0b9678632235c..439538e233d4f8a1a000f7a28e6a862cc587dd5f 100644 (file)
@@ -37,7 +37,7 @@
 
 static reloc_howto_type elf_howto_table[]=
 {
-  HOWTO(R_386_NONE, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
+  HOWTO(R_386_NONE, 0, 3, 0, FALSE, 0, complain_overflow_dont,
        bfd_elf_generic_reloc, "R_386_NONE",
        TRUE, 0x00000000, 0x00000000, FALSE),
   HOWTO(R_386_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
index 505c1c0fbd65f9897f6eddcce0bf39c5604e5d92..c3dcf53efcc2b3545dace02d2e04d966314c17db 100644 (file)
@@ -264,11 +264,11 @@ static reloc_howto_type elf32_i860_howto_table [] =
   /* This relocation does nothing.  */
   HOWTO (R_860_NONE,           /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_860_NONE",          /* name */
         FALSE,                 /* partial_inplace */
index 0fd00e0f9745cc5781f848bead5f1ed788529072..978f2a1bba9004db6a0e7c439dbfd17a8055a0ee 100644 (file)
@@ -83,7 +83,7 @@ elf32_i960_relocate (bfd *abfd ATTRIBUTE_UNUSED,
 
 static reloc_howto_type elf_howto_table[]=
 {
-  HOWTO (R_960_NONE, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
+  HOWTO (R_960_NONE, 0, 3, 0, FALSE, 0, complain_overflow_dont,
         elf32_i960_relocate, "R_960_NONE", TRUE,
         0x00000000, 0x00000000, FALSE),
   EMPTY_HOWTO (1),
index 755da57811b9157ca8378d7db99582f74063220a..c06860df1233da3a21627846ad56d5a83a4123a4 100644 (file)
@@ -141,7 +141,7 @@ static reloc_howto_type ip2k_elf_howto_table [] =
           pr)                   /* pcrel_offset */
 
   /* This reloc does nothing.  */
-  IP2K_HOWTO (R_IP2K_NONE, 0,2,32, FALSE, 0, "R_IP2K_NONE", 0, 0),
+  IP2K_HOWTO (R_IP2K_NONE, 0,3,0, FALSE, 0, "R_IP2K_NONE", 0, 0),
   /* A 16 bit absolute relocation.  */
   IP2K_HOWTO (R_IP2K_16, 0,1,16, FALSE, 0, "R_IP2K_16", 0, 0xffff),
   /* A 32 bit absolute relocation.  */
index aae9af54f7a7a64ef20eb8f5bdb7feecdd6291a7..500dcd413cf55c9019c6c8d8069a6ce4dc9f5545 100644 (file)
@@ -34,11 +34,11 @@ static reloc_howto_type iq2000_elf_howto_table [] =
 
   HOWTO (R_IQ2000_NONE,                     /* type */
         0,                          /* rightshift */
-        2,                          /* size (0 = byte, 1 = short, 2 = long) */
-        32,                         /* bitsize */
+        3,                          /* size (0 = byte, 1 = short, 2 = long) */
+        0,                          /* bitsize */
         FALSE,                      /* pc_relative */
         0,                          /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont,     /* complain_on_overflow */
         bfd_elf_generic_reloc,      /* special_function */
         "R_IQ2000_NONE",            /* name */
         FALSE,                      /* partial_inplace */
index 9acebe0fc2bdfd14607ff3a5f5403cf2ea498c0f..6aca84842b6ab318f8e18a4e89b76605cb89954e 100644 (file)
@@ -262,11 +262,11 @@ static reloc_howto_type lm32_elf_howto_table [] =
   /* This reloc does nothing.  */
   HOWTO (R_LM32_NONE,               /* type */
          0,                         /* rightshift */
-         2,                         /* size (0 = byte, 1 = short, 2 = long) */
-         32,                        /* bitsize */
+         3,                         /* size (0 = byte, 1 = short, 2 = long) */
+         0,                         /* bitsize */
          FALSE,                     /* pc_relative */
          0,                         /* bitpos */
-         complain_overflow_bitfield,/* complain_on_overflow */
+         complain_overflow_dont,    /* complain_on_overflow */
          bfd_elf_generic_reloc,     /* special_function */
          "R_LM32_NONE",             /* name */
          FALSE,                     /* partial_inplace */
index 3ddab6e8d259e0c65893fbbac8012cf9b5feec33..988aa2a7fdebc11854d1876bbc218f504c774832 100644 (file)
@@ -47,11 +47,11 @@ static reloc_howto_type m32c_elf_howto_table [] =
   /* This reloc does nothing.  */
   HOWTO (R_M32C_NONE,          /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_M32C_NONE",         /* name */
         FALSE,                 /* partial_inplace */
index 9d746998e9d1e2f4665777e76216fc999d3fe61c..51aff555191c8a666c6ba5d6b8b1b429244a8003 100644 (file)
@@ -474,11 +474,11 @@ static reloc_howto_type m32r_elf_howto_table[] =
   /* This reloc does nothing.  */
   HOWTO (R_M32R_NONE,          /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_M32R_NONE",         /* name */
         FALSE,                 /* partial_inplace */
index 5cda8f78f987bf8a70ce4787c30e4dbc1061a4dd..7f70a1c1f79d53007840313ab5054332729a27e5 100644 (file)
@@ -65,8 +65,8 @@ static reloc_howto_type elf_m68hc11_howto_table[] = {
   /* This reloc does nothing.  */
   HOWTO (R_M68HC11_NONE,       /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
         complain_overflow_dont,/* complain_on_overflow */
index 38e0e30c18a1c4e28e0980d00b59177de4afc093..1df3491c8eb46952bd95fa7aad3a0af4bbde6b21 100644 (file)
@@ -107,8 +107,8 @@ static reloc_howto_type elf_m68hc11_howto_table[] = {
   /* This reloc does nothing.  */
   HOWTO (R_M68HC11_NONE,       /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
         complain_overflow_dont,/* complain_on_overflow */
index 0d04b4e9cef732d7e3ffa06132304ef2e04d1ae2..fad3ec62d887e7f4917cc1916a4d79286d3007a2 100644 (file)
@@ -31,7 +31,7 @@ elf_m68k_discard_copies (struct elf_link_hash_entry *, void *);
 
 static reloc_howto_type howto_table[] =
 {
-  HOWTO(R_68K_NONE,       0, 0, 0, FALSE,0, complain_overflow_dont,     bfd_elf_generic_reloc, "R_68K_NONE",      FALSE, 0, 0x00000000,FALSE),
+  HOWTO(R_68K_NONE,       0, 3, 0, FALSE,0, complain_overflow_dont,     bfd_elf_generic_reloc, "R_68K_NONE",      FALSE, 0, 0x00000000,FALSE),
   HOWTO(R_68K_32,         0, 2,32, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_32",        FALSE, 0, 0xffffffff,FALSE),
   HOWTO(R_68K_16,         0, 1,16, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_16",        FALSE, 0, 0x0000ffff,FALSE),
   HOWTO(R_68K_8,          0, 0, 8, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_8",         FALSE, 0, 0x000000ff,FALSE),
index 7e29901616ff8e540479a60c6438b52385a48ccf..f8c5beb2de5b25314d4ce9cda908980efd2a7147 100644 (file)
@@ -110,11 +110,11 @@ static reloc_howto_type mcore_elf_howto_raw[] =
   /* This reloc does nothing.  */
   HOWTO (R_MCORE_NONE,         /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield,  /* complain_on_overflow */
+        complain_overflow_dont,  /* complain_on_overflow */
         NULL,                  /* special_function */
         "R_MCORE_NONE",        /* name */
         FALSE,                 /* partial_inplace */
index e3d1bc0454c569dca843133f7fee74f9200b37f3..d94c13c2ce7ced23b26d9f5e5be566cca4abbc63 100644 (file)
@@ -42,7 +42,7 @@ static bfd_reloc_status_type mep_reloc (bfd *, arelent *, struct bfd_symbol *,
 static reloc_howto_type mep_elf_howto_table [] =
 {
   /* type, size, bits, leftshift, rightshift, pcrel, OD/OS/OU, mask.  */
-  MEPREL (R_MEP_NONE,     0,  0, 0, 0, 0, N, 0),
+  MEPREL (R_MEP_NONE,     3,  0, 0, 0, 0, N, 0),
   MEPREL (R_RELC,         0,  0, 0, 0, 0, N, 0),
   /* MEPRELOC:HOWTO */
     /* This section generated from bfd/mep-relocs.pl from include/elf/mep.h.  */
index dab6bf390dab0cc3512663702fb15314ea33c6b8..84c7623d90d152161bafa9fc832daf531c5af7bf 100644 (file)
@@ -142,7 +142,7 @@ static reloc_howto_type elf_metag_howto_table[] =
   /* No relocation.  */
   HOWTO (R_METAG_NONE,         /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index 4217dd7ae7c83bcabcf4a6ed48b1a575cee2956a..50dce2720b894c34c106210c9510cf1d06dddb6c 100644 (file)
@@ -44,11 +44,11 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
    /* This reloc does nothing.  */
    HOWTO (R_MICROBLAZE_NONE,   /* Type.  */
           0,                   /* Rightshift.  */
-          2,                   /* Size (0 = byte, 1 = short, 2 = long).  */
-          32,                  /* Bitsize.  */
+          3,                   /* Size (0 = byte, 1 = short, 2 = long).  */
+          0,                   /* Bitsize.  */
           FALSE,               /* PC_relative.  */
           0,                   /* Bitpos.  */
-          complain_overflow_bitfield,  /* Complain on overflow.  */
+          complain_overflow_dont,  /* Complain on overflow.  */
           NULL,                  /* Special Function.  */
           "R_MICROBLAZE_NONE",         /* Name.  */
           FALSE,               /* Partial Inplace.  */
@@ -179,11 +179,11 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
    /* This reloc does nothing.  Used for relaxation.  */
    HOWTO (R_MICROBLAZE_64_NONE,        /* Type.  */
           0,                   /* Rightshift.  */
-          2,                   /* Size (0 = byte, 1 = short, 2 = long).  */
-          32,                  /* Bitsize.  */
+          3,                   /* Size (0 = byte, 1 = short, 2 = long).  */
+          0,                   /* Bitsize.  */
           TRUE,                        /* PC_relative.  */
           0,                   /* Bitpos.  */
-          complain_overflow_bitfield,  /* Complain on overflow.  */
+          complain_overflow_dont, /* Complain on overflow.  */
           NULL,                  /* Special Function.  */
           "R_MICROBLAZE_64_NONE",/* Name.  */
           FALSE,               /* Partial Inplace.  */
index c762d9a1f4cdd7a7c7988ac3c64e9de43e1c7777..fff08e5568d3c8225187de80aa2ed9be51e45336 100644 (file)
@@ -107,7 +107,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] =
   /* No relocation.  */
   HOWTO (R_MIPS_NONE,          /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index 51b0cfcb489bfe0388b5476b70332291763c3abe..a8584230a42be1707e8a0fe690f6aa2fbc2b7de3 100644 (file)
@@ -34,11 +34,11 @@ static reloc_howto_type moxie_elf_howto_table [] =
   /* This reloc does nothing.  */
   HOWTO (R_MOXIE_NONE,         /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_MOXIE_NONE",                /* name */
         FALSE,                 /* partial_inplace */
index 3a1c0a1c10440654b4abb15ef051fb57a3d5aa3e..921c5d38fc6afdf7fff0f3fe9a89b8f8a42452a4 100644 (file)
@@ -30,11 +30,11 @@ static reloc_howto_type elf_msp430_howto_table[] =
 {
   HOWTO (R_MSP430_NONE,                /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield,/* complain_on_overflow */
+        complain_overflow_dont,/* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_MSP430_NONE",       /* name */
         FALSE,                 /* partial_inplace */
@@ -197,11 +197,11 @@ static reloc_howto_type elf_msp430x_howto_table[] =
 {
   HOWTO (R_MSP430_NONE,                /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield,/* complain_on_overflow */
+        complain_overflow_dont,/* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_MSP430_NONE",       /* name */
         FALSE,                 /* partial_inplace */
index 5c9970c1da9773502a43663e804544e143ef9626..6a4430fe9425f56954839c49f43af9c69e3c9721 100644 (file)
@@ -48,8 +48,8 @@ static reloc_howto_type mt_elf_howto_table [] =
   /* This reloc does nothing.  */
   HOWTO (R_MT_NONE,           /* type */
           0,                      /* rightshift */
-          2,                      /* size (0 = byte, 1 = short, 2 = long) */
-          32,                     /* bitsize */
+          3,                      /* size (0 = byte, 1 = short, 2 = long) */
+          0,                      /* bitsize */
           FALSE,                  /* pc_relative */
           0,                      /* bitpos */
           complain_overflow_dont, /* complain_on_overflow */
index 7f53191e2e04885070e9561ea743441a6614e44b..5c97519da72afad8f3f41d622a76284006a5b431 100644 (file)
@@ -321,11 +321,11 @@ static reloc_howto_type nds32_elf_howto_table[] =
   /* This reloc does nothing.  */
   HOWTO (R_NDS32_NONE,         /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield,    /* complain_on_overflow */
+        complain_overflow_dont,        /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_NDS32_NONE",        /* name */
         FALSE,                 /* partial_inplace */
@@ -4186,11 +4186,10 @@ nds32_relocate_contents (reloc_howto_type *howto, bfd *input_bfd,
   switch (size)
     {
     default:
-    case 0:
-    case 1:
-    case 8:
       abort ();
       break;
+    case 0:
+      return bfd_reloc_ok;
     case 2:
       x = bfd_getb16 (location);
       break;
index 5877d8fff7b25a9f6382cfe4ce74fb56b6f1d4f5..55a3f60da7bf174b3166580b5c3b2dd010c41d68 100644 (file)
@@ -80,7 +80,7 @@ static reloc_howto_type elf_nios2_howto_table_rel[] = {
   /* No relocation.  */
   HOWTO (R_NIOS2_NONE,         /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index e80a2d9f1f6e4c435383abd1f83abdbd41fc45f7..0d2ebf0cb2fb796573691d23026bca56c038a237 100644 (file)
@@ -60,8 +60,8 @@ static reloc_howto_type or1k_elf_howto_table[] =
   /* This reloc does nothing.  */
   HOWTO (R_OR1K_NONE,           /* type */
          0,                     /* rightshift */
-         2,                     /* size (0 = byte, 1 = short, 2 = long) */
-         32,                    /* bitsize */
+         3,                     /* size (0 = byte, 1 = short, 2 = long) */
+         0,                     /* bitsize */
          FALSE,                 /* pc_relative */
          0,                     /* bitpos */
          complain_overflow_dont, /* complain_on_overflow */
index 7498094ecda0409afb2653e12bb4827d6aae96f5..aa09e5683946d0e25a1913198b9430684b18f1cd 100644 (file)
@@ -113,7 +113,7 @@ static reloc_howto_type pj_elf_howto_table[] =
   /* No relocation.  */
   HOWTO (R_PJ_NONE,            /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index 2a0bdd393eacba86e1730653cb08947c39657f85..7adb0f692c33ab94a18e849e4b6cfaf99ee7c6ef 100644 (file)
@@ -187,8 +187,8 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
   /* This reloc does nothing.  */
   HOWTO (R_PPC_NONE,           /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
         complain_overflow_dont, /* complain_on_overflow */
@@ -2066,9 +2066,6 @@ ppc_elf_addr16_ha_reloc (bfd *abfd ATTRIBUTE_UNUSED,
       return bfd_reloc_ok;
     }
 
-  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
-    return bfd_reloc_outofrange;
-
   if (bfd_is_com_section (symbol->section))
     relocation = 0;
   else
index 795a281be10064abe8d14c1b7252c6178c9ab4d5..5901ed873f4ed3348abb24021a4f8309d62ac5c7 100644 (file)
@@ -37,7 +37,7 @@
 
 static reloc_howto_type rl78_elf_howto_table [] =
 {
-  RL78REL (NONE,         0,  0, 0, dont,     FALSE),
+  RL78REL (NONE,         3,  0, 0, dont,     FALSE),
   RL78REL (DIR32,        2, 32, 0, signed,   FALSE),
   RL78REL (DIR24S,       2, 24, 0, signed,   FALSE),
   RL78REL (DIR16,        1, 16, 0, dont,     FALSE),
index 1bbaeba439d89558d96d21d76cbe13b165880cd5..058e086008fa173338492b319ef2053d3a4d3cb7 100644 (file)
@@ -49,7 +49,7 @@ void rx_dump_symtab (bfd *, void *, void *);
 
 static reloc_howto_type rx_elf_howto_table [] =
 {
-  RXREL (NONE,         0,  0, 0, dont,     FALSE),
+  RXREL (NONE,         3,  0, 0, dont,     FALSE),
   RXREL (DIR32,        2, 32, 0, signed,   FALSE),
   RXREL (DIR24S,       2, 24, 0, signed,   FALSE),
   RXREL (DIR16,        1, 16, 0, dont,     FALSE),
index ff89b3412aaa92ad0c1a62f425d933612f40842b..f5403e29e8de6c5c30ee479dde48e97b7632dcd1 100644 (file)
@@ -39,7 +39,7 @@ static reloc_howto_type elf_howto_table[] =
 {
   HOWTO (R_390_NONE,           /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = 2 byte, 2 = 4 byte) */
+        3,                     /* size (0 = byte, 1 = 2 byte, 2 = 4 byte) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index 1ecc9ffee61ee9a7d57c031a4e009a6cb1068eba..710e6b65bbf74354a019bf2fbae7aa7607ff0b77 100644 (file)
@@ -645,7 +645,7 @@ static reloc_howto_type elf32_score_howto_table[] =
   /* No relocation.  */
   HOWTO (R_SCORE_NONE,          /* type */
          0,                     /* rightshift */
-         0,                     /* size (0 = byte, 1 = short, 2 = long) */
+         3,                     /* size (0 = byte, 1 = short, 2 = long) */
          0,                     /* bitsize */
          FALSE,                 /* pc_relative */
          0,                     /* bitpos */
index 8c4b69f497cf2f29f4be83e626de59c90630a486..e23f67d126b525189266a6d340b133c7931ecd5b 100644 (file)
@@ -546,7 +546,7 @@ static reloc_howto_type elf32_score_howto_table[] =
   /* No relocation.  */
   HOWTO (R_SCORE_NONE,          /* type */
          0,                     /* rightshift */
-         0,                     /* size (0 = byte, 1 = short, 2 = long) */
+         3,                     /* size (0 = byte, 1 = short, 2 = long) */
          0,                     /* bitsize */
          FALSE,                 /* pc_relative */
          0,                     /* bitpos */
index 8f1db0f6877b97723b95486ed48af4a467a2ab72..bea900c07cb90f0bb4f4afc74fae9281298b13de 100644 (file)
@@ -20,7 +20,7 @@
 /* No relocation.  */
   HOWTO (R_SH_NONE,            /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index a13a6f6276db37e7199636a6ed457ac6e2728c41..f92cdff3e201d0350f59c6952a4583568ecffaea 100644 (file)
@@ -256,10 +256,8 @@ sh_elf_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol_in,
     return bfd_reloc_undefined;
 
   /* PR 17512: file: 9891ca98.  */
-  if (addr > bfd_get_section_limit (abfd, input_section)
-      - bfd_get_reloc_size (reloc_entry->howto)
-      || bfd_get_reloc_size (reloc_entry->howto)
-      > bfd_get_section_limit (abfd, input_section))
+  if (addr * bfd_octets_per_byte (abfd) + bfd_get_reloc_size (reloc_entry->howto)
+      > bfd_get_section_limit_octets (abfd, input_section))
     return bfd_reloc_outofrange;
 
   if (bfd_is_com_section (symbol_in->section))
index 21fd856ab2997825eebe08cbbff435d7521172b7..a806c5de1dc2b3f3e13f67c31c4921e2c3a994fe 100644 (file)
@@ -37,7 +37,7 @@ static bfd_reloc_status_type spu_elf_rel9 (bfd *, arelent *, asymbol *,
    array, so it must be declared in the order of that type.  */
 
 static reloc_howto_type elf_howto_table[] = {
-  HOWTO (R_SPU_NONE,       0, 0,  0, FALSE,  0, complain_overflow_dont,
+  HOWTO (R_SPU_NONE,       0, 3,  0, FALSE,  0, complain_overflow_dont,
         bfd_elf_generic_reloc, "SPU_NONE",
         FALSE, 0, 0x00000000, FALSE),
   HOWTO (R_SPU_ADDR10,     4, 2, 10, FALSE, 14, complain_overflow_bitfield,
index f29a06df00e759f6c730b724ff9c15253bd3a3bb..8bfad849938b2c6ed5e2a9ae5e1835cf8e45da15 100644 (file)
@@ -152,7 +152,7 @@ static reloc_howto_type elf32_tic6x_howto_table[] =
 {
   HOWTO (R_C6000_NONE,         /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
@@ -820,7 +820,7 @@ static reloc_howto_type elf32_tic6x_howto_table_rel[] =
 {
   HOWTO (R_C6000_NONE,         /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index 3d2bbde7eb7838dd29f0d46912585dd48c21ea30..b8c9586de32e069c64e11051d27296b6a46df5ea 100644 (file)
@@ -34,11 +34,11 @@ static reloc_howto_type tilepro_elf_howto_table [] =
   /* This reloc does nothing.  */
   HOWTO (R_TILEPRO_NONE,       /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_TILEPRO_NONE",      /* name */
         FALSE,                 /* partial_inplace */
index ea60c59e8a0abea9273e262f30cbee6a96a97ad6..2d7337a3b44185b8bf03d93be252cddd93e77c97 100644 (file)
@@ -895,11 +895,11 @@ static reloc_howto_type v850_elf_howto_table[] =
   /* This reloc does nothing.  */
   HOWTO (R_V850_NONE,                  /* Type.  */
         0,                             /* Rightshift.  */
-        2,                             /* Size (0 = byte, 1 = short, 2 = long).  */
-        32,                            /* Bitsize.  */
+        3,                             /* Size (0 = byte, 1 = short, 2 = long).  */
+        0,                             /* Bitsize.  */
         FALSE,                         /* PC_relative.  */
         0,                             /* Bitpos.  */
-        complain_overflow_bitfield,    /* Complain_on_overflow.  */
+        complain_overflow_dont,        /* Complain_on_overflow.  */
         bfd_elf_generic_reloc,         /* Special_function.  */
         "R_V850_NONE",                 /* Name.  */
         FALSE,                         /* Partial_inplace.  */
index 3282d19938916f2e8194ae9d34d971b402a467b5..8ed7215752e69bb8a9c0eeee84821bd0ba50dba4 100644 (file)
@@ -56,7 +56,7 @@ static bfd_boolean elf32_vax_print_private_bfd_data (bfd *, void *);
 static reloc_howto_type howto_table[] = {
   HOWTO (R_VAX_NONE,           /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index 5e304674cdaf97d260cd3199826258703ea66ddb..3344a42eb0a4ef953d67747bae23f00b44e0df75 100644 (file)
@@ -33,11 +33,11 @@ static reloc_howto_type visium_elf_howto_table[] = {
   /* This reloc does nothing.  */
   HOWTO (R_VISIUM_NONE,                /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield,    /* complain_on_overflow */
+        complain_overflow_dont,        /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_VISIUM_NONE",       /* name */
         FALSE,                 /* partial_inplace */
index dcce9410502d566997d695c27f666316fa8a3ca7..33fafe3606adec18ea2bfed43aa1a01c76ae6910 100644 (file)
@@ -32,11 +32,11 @@ static reloc_howto_type xc16x_elf_howto_table [] =
   /* This reloc does nothing.  */
   HOWTO (R_XC16X_NONE,         /* type */
         0,                     /* rightshift */
-        1,                     /* size (0 = byte, 1 = short, 2 = long) */
-        16,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_XC16X_NONE",        /* name */
         FALSE,                 /* partial_inplace */
index 59b0197582d94ea047ebcf3764bc44736cb0645f..555e83e2b31681caae8cfb3567ba1ef752804a70 100644 (file)
@@ -52,8 +52,8 @@ static reloc_howto_type elf_xgate_howto_table[] =
   /* This reloc does nothing.  */
   HOWTO (R_XGATE_NONE, /* type */
         0, /* rightshift */
-        2, /* size (0 = byte, 1 = short, 2 = long) */
-        32, /* bitsize */
+        3, /* size (0 = byte, 1 = short, 2 = long) */
+        0, /* bitsize */
         FALSE, /* pc_relative */
         0, /* bitpos */
         complain_overflow_dont,/* complain_on_overflow */
index 7eae51ca42cbc42255b827b4a11dab2ac47f3c56..8f47df5d571fe37ca560f5cad205116f25bb6d5d 100644 (file)
@@ -73,11 +73,11 @@ static reloc_howto_type xstormy16_elf_howto_table [] =
   /* This reloc does nothing.  */
   HOWTO (R_XSTORMY16_NONE,     /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_XSTORMY16_NONE",    /* name */
         FALSE,                 /* partial_inplace */
index 59a1c094ccfb7ca93687a7f73b28e7cb59e7b676..f7c07a84453a8368a0c70b17d996cd301d0bfa12 100644 (file)
@@ -161,7 +161,7 @@ int elf32xtensa_no_literal_movement = 1;
 \f
 static reloc_howto_type elf_howto_table[] =
 {
-  HOWTO (R_XTENSA_NONE, 0, 0, 0, FALSE, 0, complain_overflow_dont,
+  HOWTO (R_XTENSA_NONE, 0, 3, 0, FALSE, 0, complain_overflow_dont,
         bfd_elf_xtensa_reloc, "R_XTENSA_NONE",
         FALSE, 0, 0, FALSE),
   HOWTO (R_XTENSA_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
index 8f64114162da2f10674a19302fd2cd11ab52596b..680c0ec5ac2832b79253172333dea66393e2f118 100644 (file)
@@ -486,8 +486,8 @@ static reloc_howto_type elf64_alpha_howto_table[] =
 {
   HOWTO (R_ALPHA_NONE,         /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
-        8,                     /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         TRUE,                  /* pc_relative */
         0,                     /* bitpos */
         complain_overflow_dont, /* complain_on_overflow */
index 7ad872c109684b9c0ef90c738d56bd84fe60d76a..b00e462459814ee54f3bb0616d228ea3d6bbde92 100644 (file)
@@ -145,7 +145,7 @@ static reloc_howto_type mips_elf64_howto_table_rel[] =
   /* No relocation.  */
   HOWTO (R_MIPS_NONE,          /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
@@ -908,7 +908,7 @@ static reloc_howto_type mips_elf64_howto_table_rela[] =
   /* No relocation.  */
   HOWTO (R_MIPS_NONE,          /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index 244f90a7e21377e6d0e8cfc7797d250ad49a48a0..845acd7de601188d72cd25c00e28c17c7177fb96 100644 (file)
@@ -192,11 +192,11 @@ static reloc_howto_type elf_mmix_howto_table[] =
   /* This reloc does nothing.  */
   HOWTO (R_MMIX_NONE,          /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_MMIX_NONE",         /* name */
         FALSE,                 /* partial_inplace */
index 1101e3d51471765aba404c08fa41937885644442..f6a8ccb6e5b8e30e7a0f2505f1f421164800e9a7 100644 (file)
@@ -258,8 +258,8 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
   /* This reloc does nothing.  */
   HOWTO (R_PPC64_NONE,         /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
         complain_overflow_dont, /* complain_on_overflow */
index cdbe6caa5ee7c3a205c7f184d52400e5432b43ce..e002f06e4510d4135299cfb74184cf20dbfdbaa9 100644 (file)
@@ -42,7 +42,7 @@ static reloc_howto_type elf_howto_table[] =
 {
   HOWTO (R_390_NONE,           /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = 2 byte, 2 = 4 byte) */
+        3,                     /* size (0 = byte, 1 = 2 byte, 2 = 4 byte) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index bc48b0ef7b0f812515e938f5d2f619703718a7b0..7be08a970b0db9ab7dbbc93a7d584ab069887e84 100644 (file)
@@ -105,7 +105,7 @@ static reloc_howto_type sh_elf64_howto_table[] = {
   /* No relocation.  */
   HOWTO (R_SH_NONE,            /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index bf7d386bd9a133d9b749cd460a04b3e9fa4f4cc6..80136bfa5c5e4bc8d4634882278f57efc56228f6 100644 (file)
@@ -54,7 +54,7 @@
    special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset.  */
 static reloc_howto_type x86_64_elf_howto_table[] =
 {
-  HOWTO(R_X86_64_NONE, 0, 0, 0, FALSE, 0, complain_overflow_dont,
+  HOWTO(R_X86_64_NONE, 0, 3, 0, FALSE, 0, complain_overflow_dont,
        bfd_elf_generic_reloc, "R_X86_64_NONE", FALSE, 0x00000000, 0x00000000,
        FALSE),
   HOWTO(R_X86_64_64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
index 6e7726515c50268d63cfe6b42ebf284c703004eb..f2ab71d58b78276bf048f0d69a971979d55a494e 100644 (file)
@@ -10329,7 +10329,7 @@ elf_reloc_link_order (bfd *output_bfd,
 
       size = (bfd_size_type) bfd_get_reloc_size (howto);
       buf = (bfd_byte *) bfd_zmalloc (size);
-      if (buf == NULL)
+      if (buf == NULL && size != 0)
        return FALSE;
       rstat = _bfd_relocate_contents (howto, output_bfd, addend, buf);
       switch (rstat)
index 299ea4dc0b6cd16c9ef1e7e9c5ea967c35ac6d59..504c3f39c69a46340ab885e7f3ae7f52a5b9debe 100644 (file)
@@ -108,7 +108,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] =
   /* No relocation.  */
   HOWTO (R_MIPS_NONE,          /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index e5939a8bda255cd8b93454b1d0053abb98f787af..37de7fa64d58cbb82300c2b44081997b50d1f6c9 100644 (file)
@@ -296,7 +296,7 @@ static reloc_howto_type elfNN_aarch64_howto_table[] =
 #if ARCH_SIZE == 64
   HOWTO (R_AARCH64_NULL,       /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
@@ -310,7 +310,7 @@ static reloc_howto_type elfNN_aarch64_howto_table[] =
 #else
   HOWTO (R_AARCH64_NONE,       /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
@@ -1377,7 +1377,7 @@ static reloc_howto_type elfNN_aarch64_howto_table[] =
 static reloc_howto_type elfNN_aarch64_howto_none =
   HOWTO (R_AARCH64_NONE,       /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
         0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
index 25a6228713d45146ae334ac0fc2ec8c8e5bef1cf..66c03e3eeed44a7343f3db334e29308ba0ddc7b1 100644 (file)
@@ -187,6 +187,8 @@ _bfd_aarch64_elf_put_addend (bfd *abfd,
   size = bfd_get_reloc_size (howto);
   switch (size)
     {
+    case 0:
+      return status;
     case 2:
       contents = bfd_get_16 (abfd, address);
       break;
index 56d092f63aba58040c8bb442d6d78a8f34b69ffc..41a363e318ba439e393a878d1b0df6ab7c91f443 100644 (file)
@@ -91,7 +91,7 @@ ia64_elf_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc,
    TYPE field.  */
 static reloc_howto_type ia64_howto_table[] =
   {
-    IA64_HOWTO (R_IA64_NONE,       "NONE",        0, FALSE, TRUE),
+    IA64_HOWTO (R_IA64_NONE,       "NONE",        3, FALSE, TRUE),
 
     IA64_HOWTO (R_IA64_IMM14,      "IMM14",       0, FALSE, TRUE),
     IA64_HOWTO (R_IA64_IMM22,      "IMM22",       0, FALSE, TRUE),
index 2de63e1028c94acb093f6982605d88b67b9b3289..50ee9ad4ac5746b048506f2e65aefd8934889dd5 100644 (file)
@@ -6194,11 +6194,13 @@ mips_elf_obtain_contents (reloc_howto_type *howto,
                          const Elf_Internal_Rela *relocation,
                          bfd *input_bfd, bfd_byte *contents)
 {
-  bfd_vma x;
+  bfd_vma x = 0;
   bfd_byte *location = contents + relocation->r_offset;
+  unsigned int size = bfd_get_reloc_size (howto);
 
   /* Obtain the bytes.  */
-  x = bfd_get ((8 * bfd_get_reloc_size (howto)), input_bfd, location);
+  if (size != 0)
+    x = bfd_get (8 * size, input_bfd, location);
 
   return x;
 }
@@ -6223,6 +6225,7 @@ mips_elf_perform_relocation (struct bfd_link_info *info,
   bfd_vma x;
   bfd_byte *location;
   int r_type = ELF_R_TYPE (input_bfd, relocation->r_info);
+  unsigned int size;
 
   /* Figure out where the relocation is occurring.  */
   location = contents + relocation->r_offset;
@@ -6316,7 +6319,9 @@ mips_elf_perform_relocation (struct bfd_link_info *info,
     }
 
   /* Put the value into the output.  */
-  bfd_put (8 * bfd_get_reloc_size (howto), input_bfd, x, location);
+  size = bfd_get_reloc_size (howto);
+  if (size != 0)
+    bfd_put (8 * size, input_bfd, x, location);
 
   _bfd_mips_elf_reloc_shuffle (input_bfd, r_type, !info->relocatable,
                               location);
index 66f73c1a7c8650991cff8c1b870f293a95dfe90f..6fff6ad392bdd95ac1a87945ffbddb39b4995468 100644 (file)
@@ -209,7 +209,7 @@ sparc_elf_lox10_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
 
 static reloc_howto_type _bfd_sparc_elf_howto_table[] =
 {
-  HOWTO(R_SPARC_NONE,      0,0, 0,FALSE,0,complain_overflow_dont,    bfd_elf_generic_reloc,  "R_SPARC_NONE",    FALSE,0,0x00000000,TRUE),
+  HOWTO(R_SPARC_NONE,      0,3, 0,FALSE,0,complain_overflow_dont,    bfd_elf_generic_reloc,  "R_SPARC_NONE",    FALSE,0,0x00000000,TRUE),
   HOWTO(R_SPARC_8,         0,0, 8,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc,  "R_SPARC_8",       FALSE,0,0x000000ff,TRUE),
   HOWTO(R_SPARC_16,        0,1,16,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc,  "R_SPARC_16",      FALSE,0,0x0000ffff,TRUE),
   HOWTO(R_SPARC_32,        0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc,  "R_SPARC_32",      FALSE,0,0xffffffff,TRUE),
index 14fa8a90ab6d4e9f26b44f978ae94340e89e8981..e747fad18c6e7c2811de49adab92910015a28fc1 100644 (file)
@@ -72,11 +72,11 @@ static reloc_howto_type tilegx_elf_howto_table [] =
   /* This reloc does nothing.  */
   HOWTO (R_TILEGX_NONE,        /* type */
         0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        32,                    /* bitsize */
+        3,                     /* size (0 = byte, 1 = short, 2 = long) */
+        0,                     /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
-        complain_overflow_bitfield, /* complain_on_overflow */
+        complain_overflow_dont, /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_TILEGX_NONE",       /* name */
         FALSE,                 /* partial_inplace */
index ba14de3902c4b6ff90dc3f9400195afc1dd78aaf..c1a2e8232bcb9453261f08b8ffe05f441851a3d7 100644 (file)
@@ -2434,7 +2434,7 @@ _bfd_generic_reloc_link_order (bfd *abfd,
 
       size = bfd_get_reloc_size (r->howto);
       buf = (bfd_byte *) bfd_zmalloc (size);
-      if (buf == NULL)
+      if (buf == NULL && size != 0)
        return FALSE;
       rstat = _bfd_relocate_contents (r->howto, abfd,
                                      (bfd_vma) link_order->u.reloc.p->addend,
index df994674b834d4ec0bdd7d1f1329ea691b60bea0..fea776e7bbd9caea7882ad2749763a9502d0be6d 100644 (file)
@@ -49,7 +49,7 @@ enum reloc_type
 
 static reloc_howto_type nlm32_sparc_howto_table[] =
 {
-  HOWTO (R_SPARC_NONE,    0,0, 0,FALSE,0,complain_overflow_dont,    0,"R_SPARC_NONE",    FALSE,0,0x00000000,TRUE),
+  HOWTO (R_SPARC_NONE,    0,3, 0,FALSE,0,complain_overflow_dont,    0,"R_SPARC_NONE",    FALSE,0,0x00000000,TRUE),
   HOWTO (R_SPARC_8,       0,0, 8,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_8",       FALSE,0,0x000000ff,TRUE),
   HOWTO (R_SPARC_16,      0,1,16,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_16",      FALSE,0,0x0000ffff,TRUE),
   HOWTO (R_SPARC_32,      0,2,32,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_32",      FALSE,0,0xffffffff,TRUE),
index d21f850f11993dac748b96518e53db9f4e0d3d18..c559bee91e04c27ffabed5b17354d0f499c78a7b 100644 (file)
@@ -3152,7 +3152,7 @@ aout_link_reloc_link_order (struct aout_final_link_info *flaginfo,
 
       size = bfd_get_reloc_size (howto);
       buf = bfd_zmalloc (size);
-      if (buf == NULL)
+      if (buf == NULL && size != 0)
        return FALSE;
       r = MY_relocate_contents (howto, flaginfo->output_bfd,
                                pr->addend, buf);
index b018a3e87862452175de7a0fca96d9dc308a3880..5734fc8f76ca71e10b7ff8c6505ab4b7ac7971ff 100644 (file)
@@ -579,7 +579,7 @@ bfd_perform_relocation (bfd *abfd,
 {
   bfd_vma relocation;
   bfd_reloc_status_type flag = bfd_reloc_ok;
-  bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd);
+  bfd_size_type octets;
   bfd_vma output_base = 0;
   reloc_howto_type *howto = reloc_entry->howto;
   asection *reloc_target_output_section;
@@ -618,15 +618,12 @@ bfd_perform_relocation (bfd *abfd,
        return cont;
     }
 
-  /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)
-      /* PR 17512: file: c146ab8b.
-        PR 17512: file: 46dff27f.
-        Include the size of the reloc in the test for out of range addresses.  */
-      - bfd_get_reloc_size (howto)
-      /* PR 17512: file: 38e53ebf
-        Add make sure that there is enough room for the relocation to be applied.  */
-      || bfd_get_reloc_size (howto) > bfd_get_section_limit (abfd, input_section))
+  /* Is the address of the relocation really within the section?
+     Include the size of the reloc in the test for out of range addresses.
+     PR 17512: file: c146ab8b, 46dff27f, 38e53ebf.  */
+  octets = reloc_entry->address * bfd_octets_per_byte (abfd);
+  if (octets + bfd_get_reloc_size (howto)
+      > bfd_get_section_limit_octets (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targeted at and the
@@ -976,7 +973,7 @@ bfd_install_relocation (bfd *abfd,
 {
   bfd_vma relocation;
   bfd_reloc_status_type flag = bfd_reloc_ok;
-  bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd);
+  bfd_size_type octets;
   bfd_vma output_base = 0;
   reloc_howto_type *howto = reloc_entry->howto;
   asection *reloc_target_output_section;
@@ -1009,7 +1006,9 @@ bfd_install_relocation (bfd *abfd,
     }
 
   /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
+  octets = reloc_entry->address * bfd_octets_per_byte (abfd);
+  if (octets + bfd_get_reloc_size (howto)
+      > bfd_get_section_limit_octets (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targeted at and the
@@ -1344,9 +1343,11 @@ _bfd_final_link_relocate (reloc_howto_type *howto,
                          bfd_vma addend)
 {
   bfd_vma relocation;
+  bfd_size_type octets = address * bfd_octets_per_byte (input_bfd);
 
   /* Sanity check the address.  */
-  if (address > bfd_get_section_limit (input_bfd, input_section))
+  if (octets + bfd_get_reloc_size (howto)
+      > bfd_get_section_limit_octets (input_bfd, input_section))
     return bfd_reloc_outofrange;
 
   /* This function assumes that we are dealing with a basic relocation
@@ -1401,8 +1402,9 @@ _bfd_relocate_contents (reloc_howto_type *howto,
   switch (size)
     {
     default:
-    case 0:
       abort ();
+    case 0:
+      return bfd_reloc_ok;
     case 1:
       x = bfd_get_8 (input_bfd, location);
       break;
@@ -1569,8 +1571,9 @@ _bfd_clear_contents (reloc_howto_type *howto,
   switch (size)
     {
     default:
-    case 0:
       abort ();
+    case 0:
+      return;
     case 1:
       x = bfd_get_8 (input_bfd, location);
       break;
index 06ac544e0c90762fb866a05db9828f05c1f3848f..9c7da57fa8a3ba176a794e40a27fc2a2a58cdd9f 100644 (file)
@@ -5738,7 +5738,7 @@ xcoff_reloc_link_order (bfd *output_bfd,
 
       size = bfd_get_reloc_size (howto);
       buf = bfd_zmalloc (size);
-      if (buf == NULL)
+      if (buf == NULL && size != 0)
        return FALSE;
 
       rstat = _bfd_relocate_contents (howto, output_bfd, addend, buf);
This page took 0.112884 seconds and 4 git commands to generate.