Return void from linker callbacks

The ldmain.c implementation of these linker callback functions always
return true, so any code handling a false return is dead.  What's
more, some of the bfd backends abort if ever a false return is seen,
and there seems to be some confusion in gdb's compile-object-load.c.
The return value was never meant to be "oh yes, a multiple_definition
error occurred", but rather "out of memory or other catastrophic
failure".

This patch removes the status return on the callbacks that always
return true.  I kept the return status for "notice" because that one
does happen to need to return "out of memory".

include/
	* bfdlink.h (struct bfd_link_callbacks): Update comments.
	Return void from multiple_definition, multiple_common,
	add_to_set, constructor, warning, undefined_symbol,
	reloc_overflow, reloc_dangerous and unattached_reloc.
bfd/
	* aoutx.h: Adjust linker callback calls throughout file,
	removing dead code.
	* bout.c: Likewise.
	* coff-alpha.c: Likewise.
	* coff-arm.c: Likewise.
	* coff-h8300.c: Likewise.
	* coff-h8500.c: Likewise.
	* coff-i960.c: Likewise.
	* coff-mcore.c: Likewise.
	* coff-mips.c: Likewise.
	* coff-ppc.c: Likewise.
	* coff-rs6000.c: Likewise.
	* coff-sh.c: Likewise.
	* coff-tic80.c: Likewise.
	* coff-w65.c: Likewise.
	* coff-z80.c: Likewise.
	* coff-z8k.c: Likewise.
	* coff64-rs6000.c: Likewise.
	* cofflink.c: Likewise.
	* ecoff.c: Likewise.
	* elf-bfd.h: Likewise.
	* elf-m10200.c: Likewise.
	* elf-m10300.c: Likewise.
	* elf32-arc.c: Likewise.
	* elf32-arm.c: Likewise.
	* elf32-avr.c: Likewise.
	* elf32-bfin.c: Likewise.
	* elf32-cr16.c: Likewise.
	* elf32-cr16c.c: Likewise.
	* elf32-cris.c: Likewise.
	* elf32-crx.c: Likewise.
	* elf32-d10v.c: Likewise.
	* elf32-epiphany.c: Likewise.
	* elf32-fr30.c: Likewise.
	* elf32-frv.c: Likewise.
	* elf32-ft32.c: Likewise.
	* elf32-h8300.c: Likewise.
	* elf32-hppa.c: Likewise.
	* elf32-i370.c: Likewise.
	* elf32-i386.c: Likewise.
	* elf32-i860.c: Likewise.
	* elf32-ip2k.c: Likewise.
	* elf32-iq2000.c: Likewise.
	* elf32-lm32.c: Likewise.
	* elf32-m32c.c: Likewise.
	* elf32-m32r.c: Likewise.
	* elf32-m68hc1x.c: Likewise.
	* elf32-m68k.c: Likewise.
	* elf32-mep.c: Likewise.
	* elf32-metag.c: Likewise.
	* elf32-microblaze.c: Likewise.
	* elf32-moxie.c: Likewise.
	* elf32-msp430.c: Likewise.
	* elf32-mt.c: Likewise.
	* elf32-nds32.c: Likewise.
	* elf32-nios2.c: Likewise.
	* elf32-or1k.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf32-s390.c: Likewise.
	* elf32-score.c: Likewise.
	* elf32-score7.c: Likewise.
	* elf32-sh.c: Likewise.
	* elf32-sh64.c: Likewise.
	* elf32-spu.c: Likewise.
	* elf32-tic6x.c: Likewise.
	* elf32-tilepro.c: Likewise.
	* elf32-v850.c: Likewise.
	* elf32-vax.c: Likewise.
	* elf32-visium.c: Likewise.
	* elf32-xstormy16.c: Likewise.
	* elf32-xtensa.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-hppa.c: Likewise.
	* elf64-ia64-vms.c: Likewise.
	* elf64-mmix.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf64-s390.c: Likewise.
	* elf64-sh64.c: Likewise.
	* elf64-x86-64.c: Likewise.
	* elflink.c: Likewise.
	* elfnn-aarch64.c: Likewise.
	* elfnn-ia64.c: Likewise.
	* elfxx-mips.c: Likewise.
	* elfxx-sparc.c: Likewise.
	* elfxx-tilegx.c: Likewise.
	* linker.c: Likewise.
	* pdp11.c: Likewise.
	* pe-mips.c: Likewise.
	* reloc.c: Likewise.
	* reloc16.c: Likewise.
	* simple.c: Likewise.
	* vms-alpha.c: Likewise.
	* xcofflink.c: Likewise.
	* elf32-rl78.c (get_symbol_value, get_romstart, get_ramstart): Delete
	status param.  Adjust calls to these and linker callbacks throughout.
	* elf32-rx.c: (get_symbol_value, get_gp, get_romstart,
	get_ramstart): Delete status param.  Adjust calls to these and
	linker callbacks throughout.
ld/
	* ldmain.c (multiple_definition, multiple_common, add_to_set,
	constructor_callback, warning_callback, undefined_symbol,
	reloc_overflow, reloc_dangerous, unattached_reloc): Return void.
	* emultempl/elf32.em: Adjust callback calls.
gdb/
	* compile/compile-object-load.c (link_callbacks_multiple_definition,
	link_callbacks_warning, link_callbacks_undefined_symbol,
	link_callbacks_undefined_symbol, link_callbacks_reloc_overflow,
	link_callbacks_reloc_dangerous,
	link_callbacks_unattached_reloc): Return void.
This commit is contained in:
Alan Modra 2016-05-27 17:20:55 +09:30
parent d5dca95ffc
commit 1a72702bb3
102 changed files with 1026 additions and 1467 deletions

View file

@ -1,3 +1,104 @@
2016-05-28 Alan Modra <amodra@gmail.com>
* aoutx.h: Adjust linker callback calls throughout file,
removing dead code.
* bout.c: Likewise.
* coff-alpha.c: Likewise.
* coff-arm.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-i960.c: Likewise.
* coff-mcore.c: Likewise.
* coff-mips.c: Likewise.
* coff-ppc.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-sh.c: Likewise.
* coff-tic80.c: Likewise.
* coff-w65.c: Likewise.
* coff-z80.c: Likewise.
* coff-z8k.c: Likewise.
* coff64-rs6000.c: Likewise.
* cofflink.c: Likewise.
* ecoff.c: Likewise.
* elf-bfd.h: Likewise.
* elf-m10200.c: Likewise.
* elf-m10300.c: Likewise.
* elf32-arc.c: Likewise.
* elf32-arm.c: Likewise.
* elf32-avr.c: Likewise.
* elf32-bfin.c: Likewise.
* elf32-cr16.c: Likewise.
* elf32-cr16c.c: Likewise.
* elf32-cris.c: Likewise.
* elf32-crx.c: Likewise.
* elf32-d10v.c: Likewise.
* elf32-epiphany.c: Likewise.
* elf32-fr30.c: Likewise.
* elf32-frv.c: Likewise.
* elf32-ft32.c: Likewise.
* elf32-h8300.c: Likewise.
* elf32-hppa.c: Likewise.
* elf32-i370.c: Likewise.
* elf32-i386.c: Likewise.
* elf32-i860.c: Likewise.
* elf32-ip2k.c: Likewise.
* elf32-iq2000.c: Likewise.
* elf32-lm32.c: Likewise.
* elf32-m32c.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-m68hc1x.c: Likewise.
* elf32-m68k.c: Likewise.
* elf32-mep.c: Likewise.
* elf32-metag.c: Likewise.
* elf32-microblaze.c: Likewise.
* elf32-moxie.c: Likewise.
* elf32-msp430.c: Likewise.
* elf32-mt.c: Likewise.
* elf32-nds32.c: Likewise.
* elf32-nios2.c: Likewise.
* elf32-or1k.c: Likewise.
* elf32-ppc.c: Likewise.
* elf32-s390.c: Likewise.
* elf32-score.c: Likewise.
* elf32-score7.c: Likewise.
* elf32-sh.c: Likewise.
* elf32-sh64.c: Likewise.
* elf32-spu.c: Likewise.
* elf32-tic6x.c: Likewise.
* elf32-tilepro.c: Likewise.
* elf32-v850.c: Likewise.
* elf32-vax.c: Likewise.
* elf32-visium.c: Likewise.
* elf32-xstormy16.c: Likewise.
* elf32-xtensa.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-ia64-vms.c: Likewise.
* elf64-mmix.c: Likewise.
* elf64-ppc.c: Likewise.
* elf64-s390.c: Likewise.
* elf64-sh64.c: Likewise.
* elf64-x86-64.c: Likewise.
* elflink.c: Likewise.
* elfnn-aarch64.c: Likewise.
* elfnn-ia64.c: Likewise.
* elfxx-mips.c: Likewise.
* elfxx-sparc.c: Likewise.
* elfxx-tilegx.c: Likewise.
* linker.c: Likewise.
* pdp11.c: Likewise.
* pe-mips.c: Likewise.
* reloc.c: Likewise.
* reloc16.c: Likewise.
* simple.c: Likewise.
* vms-alpha.c: Likewise.
* xcofflink.c: Likewise.
* elf32-rl78.c (get_symbol_value, get_romstart, get_ramstart): Delete
status param. Adjust calls to these and linker callbacks throughout.
* elf32-rx.c: (get_symbol_value, get_gp, get_romstart,
get_ramstart): Delete status param. Adjust calls to these and
linker callbacks throughout.
2016-05-27 Maciej W. Rozycki <macro@imgtec.com> 2016-05-27 Maciej W. Rozycki <macro@imgtec.com>
* elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS16_26> * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS16_26>

View file

@ -3735,9 +3735,8 @@ aout_link_reloc_link_order (struct aout_final_link_info *flaginfo,
} }
else else
{ {
if (! ((*flaginfo->info->callbacks->unattached_reloc) (*flaginfo->info->callbacks->unattached_reloc)
(flaginfo->info, pr->u.name, NULL, NULL, (bfd_vma) 0))) (flaginfo->info, pr->u.name, NULL, NULL, (bfd_vma) 0);
return FALSE;
r_index = 0; r_index = 0;
} }
} }
@ -3832,17 +3831,13 @@ aout_link_reloc_link_order (struct aout_final_link_info *flaginfo,
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
abort (); abort ();
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*flaginfo->info->callbacks->reloc_overflow) (*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, NULL, (flaginfo->info, NULL,
(p->type == bfd_section_reloc_link_order (p->type == bfd_section_reloc_link_order
? bfd_section_name (flaginfo->output_bfd, ? bfd_section_name (flaginfo->output_bfd,
pr->u.section) pr->u.section)
: pr->u.name), : pr->u.name),
howto->name, pr->addend, NULL, NULL, (bfd_vma) 0))) howto->name, pr->addend, NULL, NULL, (bfd_vma) 0);
{
free (buf);
return FALSE;
}
break; break;
} }
ok = bfd_set_section_contents (flaginfo->output_bfd, o, (void *) buf, ok = bfd_set_section_contents (flaginfo->output_bfd, o, (void *) buf,
@ -4099,10 +4094,9 @@ aout_link_input_section_std (struct aout_final_link_info *flaginfo,
name = strings + GET_WORD (input_bfd, name = strings + GET_WORD (input_bfd,
syms[r_index].e_strx); syms[r_index].e_strx);
if (! ((*flaginfo->info->callbacks->unattached_reloc) (*flaginfo->info->callbacks->unattached_reloc)
(flaginfo->info, name, input_bfd, input_section, (flaginfo->info, name,
r_addr))) input_bfd, input_section, r_addr);
return FALSE;
r_index = 0; r_index = 0;
} }
} }
@ -4224,10 +4218,8 @@ aout_link_input_section_std (struct aout_final_link_info *flaginfo,
name = h->root.root.string; name = h->root.root.string;
else else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx); name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
if (! ((*flaginfo->info->callbacks->undefined_symbol) (*flaginfo->info->callbacks->undefined_symbol)
(flaginfo->info, name, input_bfd, input_section, (flaginfo->info, name, input_bfd, input_section, r_addr, TRUE);
r_addr, TRUE)))
return FALSE;
} }
r = MY_final_link_relocate (howto, r = MY_final_link_relocate (howto,
@ -4259,11 +4251,9 @@ aout_link_input_section_std (struct aout_final_link_info *flaginfo,
s = aout_reloc_index_to_section (input_bfd, r_index); s = aout_reloc_index_to_section (input_bfd, r_index);
name = bfd_section_name (input_bfd, s); name = bfd_section_name (input_bfd, s);
} }
if (! ((*flaginfo->info->callbacks->reloc_overflow) (*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, (h ? &h->root : NULL), name, (flaginfo->info, (h ? &h->root : NULL), name, howto->name,
howto->name, (bfd_vma) 0, input_bfd, (bfd_vma) 0, input_bfd, input_section, r_addr);
input_section, r_addr)))
return FALSE;
} }
break; break;
} }
@ -4441,10 +4431,9 @@ aout_link_input_section_ext (struct aout_final_link_info *flaginfo,
name = strings + GET_WORD (input_bfd, name = strings + GET_WORD (input_bfd,
syms[r_index].e_strx); syms[r_index].e_strx);
if (! ((*flaginfo->info->callbacks->unattached_reloc) (*flaginfo->info->callbacks->unattached_reloc)
(flaginfo->info, name, input_bfd, input_section, (flaginfo->info, name,
r_addr))) input_bfd, input_section, r_addr);
return FALSE;
r_index = 0; r_index = 0;
} }
} }
@ -4631,10 +4620,8 @@ aout_link_input_section_ext (struct aout_final_link_info *flaginfo,
name = h->root.root.string; name = h->root.root.string;
else else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx); name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
if (! ((*flaginfo->info->callbacks->undefined_symbol) (*flaginfo->info->callbacks->undefined_symbol)
(flaginfo->info, name, input_bfd, input_section, (flaginfo->info, name, input_bfd, input_section, r_addr, TRUE);
r_addr, TRUE)))
return FALSE;
} }
if (r_type != (unsigned int) RELOC_SPARC_REV32) if (r_type != (unsigned int) RELOC_SPARC_REV32)
@ -4678,11 +4665,10 @@ aout_link_input_section_ext (struct aout_final_link_info *flaginfo,
s = aout_reloc_index_to_section (input_bfd, r_index); s = aout_reloc_index_to_section (input_bfd, r_index);
name = bfd_section_name (input_bfd, s); name = bfd_section_name (input_bfd, s);
} }
if (! ((*flaginfo->info->callbacks->reloc_overflow) (*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, (h ? &h->root : NULL), name, (flaginfo->info, (h ? &h->root : NULL), name,
howto_table_ext[r_type].name, howto_table_ext[r_type].name,
r_addend, input_bfd, input_section, r_addr))) r_addend, input_bfd, input_section, r_addr);
return FALSE;
} }
break; break;
} }

View file

@ -517,11 +517,9 @@ get_value (arelent *reloc,
value = h->u.c.size; value = h->u.c.size;
else else
{ {
if (! ((*link_info->callbacks->undefined_symbol) (*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (symbol), (link_info, bfd_asymbol_name (symbol),
input_section->owner, input_section, reloc->address, input_section->owner, input_section, reloc->address, TRUE);
TRUE)))
abort ();
value = 0; value = 0;
} }
} }

View file

@ -1101,24 +1101,19 @@ alpha_ecoff_get_relocated_section_contents (bfd *abfd,
switch (r) switch (r)
{ {
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (! ((*link_info->callbacks->undefined_symbol) (*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*rel->sym_ptr_ptr), (link_info, bfd_asymbol_name (*rel->sym_ptr_ptr),
input_bfd, input_section, rel->address, TRUE))) input_bfd, input_section, rel->address, TRUE);
goto error_return;
break; break;
case bfd_reloc_dangerous: case bfd_reloc_dangerous:
if (! ((*link_info->callbacks->reloc_dangerous) (*link_info->callbacks->reloc_dangerous)
(link_info, err, input_bfd, input_section, (link_info, err, input_bfd, input_section, rel->address);
rel->address)))
goto error_return;
break; break;
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*link_info->callbacks->reloc_overflow) (*link_info->callbacks->reloc_overflow)
(link_info, NULL, (link_info, NULL, bfd_asymbol_name (*rel->sym_ptr_ptr),
bfd_asymbol_name (*rel->sym_ptr_ptr), rel->howto->name, rel->addend, input_bfd,
rel->howto->name, rel->addend, input_bfd, input_section, rel->address);
input_section, rel->address)))
goto error_return;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
default: default:
@ -1696,10 +1691,9 @@ alpha_relocate_section (bfd *output_bfd,
do not have a meaningful number for the do not have a meaningful number for the
location within the section that is being location within the section that is being
relocated. */ relocated. */
if (! ((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd,
input_section, (bfd_vma) 0, TRUE))) input_section, (bfd_vma) 0, TRUE);
return FALSE;
addend = 0; addend = 0;
} }
} }
@ -1712,10 +1706,9 @@ alpha_relocate_section (bfd *output_bfd,
/* This symbol is not being written out. Pass /* This symbol is not being written out. Pass
the address as 0, as with undefined_symbol, the address as 0, as with undefined_symbol,
above. */ above. */
if (! ((*info->callbacks->unattached_reloc) (*info->callbacks->unattached_reloc)
(info, h->root.root.string, input_bfd, (info, h->root.root.string,
input_section, (bfd_vma) 0))) input_bfd, input_section, (bfd_vma) 0);
return FALSE;
} }
addend = alpha_convert_external_reloc (output_bfd, info, addend = alpha_convert_external_reloc (output_bfd, info,
@ -1839,10 +1832,9 @@ alpha_relocate_section (bfd *output_bfd,
&& h->indx == -1) && h->indx == -1)
{ {
/* This symbol is not being written out. */ /* This symbol is not being written out. */
if (! ((*info->callbacks->unattached_reloc) (*info->callbacks->unattached_reloc)
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd,
input_section, r_vaddr - input_section->vma))) input_section, r_vaddr - input_section->vma);
return FALSE;
} }
relocation = alpha_convert_external_reloc (output_bfd, relocation = alpha_convert_external_reloc (output_bfd,
@ -1896,11 +1888,9 @@ alpha_relocate_section (bfd *output_bfd,
} }
else else
{ {
if (! ((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd, input_section,
input_section, r_vaddr - input_section->vma, TRUE);
r_vaddr - input_section->vma, TRUE)))
return FALSE;
relocation = 0; relocation = 0;
} }
} }
@ -1942,12 +1932,10 @@ alpha_relocate_section (bfd *output_bfd,
else else
name = bfd_section_name (input_bfd, name = bfd_section_name (input_bfd,
symndx_to_section[r_symndx]); symndx_to_section[r_symndx]);
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, NULL, name, (info, NULL, name, alpha_howto_table[r_type].name,
alpha_howto_table[r_type].name, (bfd_vma) 0, input_bfd, input_section,
(bfd_vma) 0, input_bfd, input_section, r_vaddr - input_section->vma);
r_vaddr - input_section->vma)))
return FALSE;
} }
break; break;
} }
@ -1967,10 +1955,9 @@ alpha_relocate_section (bfd *output_bfd,
if (gp_usedp && gp_undefined) if (gp_usedp && gp_undefined)
{ {
if (! ((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, _("GP relative relocation used when GP not defined"), (info, _("GP relative relocation used when GP not defined"),
input_bfd, input_section, r_vaddr - input_section->vma))) input_bfd, input_section, r_vaddr - input_section->vma);
return FALSE;
/* Only give the error once per link. */ /* Only give the error once per link. */
gp = 4; gp = 4;
_bfd_set_gp_value (output_bfd, gp); _bfd_set_gp_value (output_bfd, gp);

View file

@ -1562,12 +1562,9 @@ coff_arm_relocate_section (bfd *output_bfd,
} }
else if (! bfd_link_relocatable (info)) else if (! bfd_link_relocatable (info))
{ (*info->callbacks->undefined_symbol)
if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section,
(info, h->root.root.string, input_bfd, input_section, rel->r_vaddr - input_section->vma, TRUE);
rel->r_vaddr - input_section->vma, TRUE)))
return FALSE;
}
} }
/* Emit a reloc if the backend thinks it needs it. */ /* Emit a reloc if the backend thinks it needs it. */
@ -1764,11 +1761,10 @@ coff_arm_relocate_section (bfd *output_bfd,
return FALSE; return FALSE;
} }
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section,
rel->r_vaddr - input_section->vma))) rel->r_vaddr - input_section->vma);
return FALSE;
} }
} }
} }

View file

@ -647,14 +647,10 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* Sanity check. */ /* Sanity check. */
if (gap < -128 || gap > 126) if (gap < -128 || gap > 126)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
/* Everything looks OK. Apply the relocation and update the /* Everything looks OK. Apply the relocation and update the
src/dst address appropriately. */ src/dst address appropriately. */
@ -679,14 +675,10 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* Sanity check. */ /* Sanity check. */
if (gap > 32766 || gap < -32768) if (gap > 32766 || gap < -32768)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
/* Everything looks OK. Apply the relocation and update the /* Everything looks OK. Apply the relocation and update the
src/dst address appropriately. */ src/dst address appropriately. */
@ -769,14 +761,10 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
src_address += 4; src_address += 4;
} }
else else
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
break; break;
/* A 16-bit absolute branch that is now an 8-bit pc-relative branch. */ /* A 16-bit absolute branch that is now an 8-bit pc-relative branch. */
@ -793,14 +781,10 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* Sanity check. */ /* Sanity check. */
if (gap < -128 || gap > 126) if (gap < -128 || gap > 126)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
/* Now fix the instruction itself. */ /* Now fix the instruction itself. */
switch (data[dst_address - 1]) switch (data[dst_address - 1])
@ -840,14 +824,10 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* Sanity check. */ /* Sanity check. */
if (gap < -128 || gap > 126) if (gap < -128 || gap > 126)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
/* Now fix the instruction. */ /* Now fix the instruction. */
switch (data[dst_address - 2]) switch (data[dst_address - 2])
@ -1040,14 +1020,10 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* Sanity check. */ /* Sanity check. */
if (gap < -128 || gap > 126) if (gap < -128 || gap > 126)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
/* Everything looks OK. Fix the condition in the instruction, apply /* Everything looks OK. Fix the condition in the instruction, apply
the relocation, and update the src/dst address appropriately. */ the relocation, and update the src/dst address appropriately. */
@ -1123,14 +1099,10 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
src_address += 1; src_address += 1;
} }
else else
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
break; break;
} }

View file

@ -244,14 +244,11 @@ extra_case (bfd *in_abfd,
word and the pc's been incremented. */ word and the pc's been incremented. */
if (gap > 128 || gap < -128) if (gap > 128 || gap < -128)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
bfd_put_8 (in_abfd, gap, data + *dst_ptr); bfd_put_8 (in_abfd, gap, data + *dst_ptr);
(*dst_ptr)++; (*dst_ptr)++;
(*src_ptr)++; (*src_ptr)++;
@ -268,14 +265,11 @@ extra_case (bfd *in_abfd,
word and the pc's been incremented. */ word and the pc's been incremented. */
if (gap > 32767 || gap < -32768) if (gap > 32767 || gap < -32768)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
bfd_put_16 (in_abfd, (bfd_vma) gap, data + *dst_ptr); bfd_put_16 (in_abfd, (bfd_vma) gap, data + *dst_ptr);
(*dst_ptr) += 2; (*dst_ptr) += 2;
(*src_ptr) += 2; (*src_ptr) += 2;

View file

@ -448,12 +448,9 @@ coff_i960_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
+ sec->output_offset); + sec->output_offset);
} }
else if (! bfd_link_relocatable (info)) else if (! bfd_link_relocatable (info))
{ (*info->callbacks->undefined_symbol)
if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section,
(info, h->root.root.string, input_bfd, input_section, rel->r_vaddr - input_section->vma, TRUE);
rel->r_vaddr - input_section->vma, TRUE)))
return FALSE;
}
} }
done = FALSE; done = FALSE;
@ -473,12 +470,11 @@ coff_i960_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
/* This symbol is apparently not from a COFF input file. /* This symbol is apparently not from a COFF input file.
We warn, and then assume that it is not a leaf We warn, and then assume that it is not a leaf
function. */ function. */
if (! ((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, (info,
_("uncertain calling convention for non-COFF symbol"), _("uncertain calling convention for non-COFF symbol"),
input_bfd, input_section, input_bfd, input_section,
rel->r_vaddr - input_section->vma))) rel->r_vaddr - input_section->vma);
return FALSE;
break; break;
case C_LEAFSTAT: case C_LEAFSTAT:
case C_LEAFEXT: case C_LEAFEXT:
@ -555,11 +551,10 @@ coff_i960_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
return FALSE; return FALSE;
} }
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section,
rel->r_vaddr - input_section->vma))) rel->r_vaddr - input_section->vma);
return FALSE;
} }
} }
} }

View file

@ -454,12 +454,9 @@ coff_mcore_relocate_section (bfd * output_bfd,
+ sec->output_offset); + sec->output_offset);
} }
else else
{ (*info->callbacks->undefined_symbol)
if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section,
(info, h->root.root.string, input_bfd, input_section, rel->r_vaddr - input_section->vma, TRUE);
rel->r_vaddr - input_section->vma, TRUE)))
return FALSE;
}
my_name = h->root.root.string; my_name = h->root.root.string;
} }
@ -519,11 +516,10 @@ coff_mcore_relocate_section (bfd * output_bfd,
break; break;
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), my_name, howto->name, (info, (h ? &h->root : NULL), my_name, howto->name,
(bfd_vma) 0, input_bfd, (bfd_vma) 0, input_bfd,
input_section, rel->r_vaddr - input_section->vma))) input_section, rel->r_vaddr - input_section->vma);
return FALSE;
} }
} }

View file

@ -940,11 +940,10 @@ mips_relocate_section (bfd *output_bfd,
{ {
if (gp_undefined) if (gp_undefined)
{ {
if (! ((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, _("GP relative relocation used when GP not defined"), (info, _("GP relative relocation used when GP not defined"),
input_bfd, input_section, input_bfd, input_section,
int_rel.r_vaddr - input_section->vma))) int_rel.r_vaddr - input_section->vma);
return FALSE;
/* Only give the error once per link. */ /* Only give the error once per link. */
gp = 4; gp = 4;
_bfd_set_gp_value (output_bfd, gp); _bfd_set_gp_value (output_bfd, gp);
@ -1075,11 +1074,9 @@ mips_relocate_section (bfd *output_bfd,
if (int_rel.r_symndx == -1) if (int_rel.r_symndx == -1)
{ {
/* This symbol is not being written out. */ /* This symbol is not being written out. */
if (! ((*info->callbacks->unattached_reloc) (*info->callbacks->unattached_reloc)
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd, input_section,
input_section, int_rel.r_vaddr - input_section->vma);
int_rel.r_vaddr - input_section->vma)))
return FALSE;
int_rel.r_symndx = 0; int_rel.r_symndx = 0;
} }
relocation = 0; relocation = 0;
@ -1151,11 +1148,9 @@ mips_relocate_section (bfd *output_bfd,
} }
else else
{ {
if (! ((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd, input_section,
input_section, int_rel.r_vaddr - input_section->vma, TRUE);
int_rel.r_vaddr - input_section->vma, TRUE)))
return FALSE;
relocation = 0; relocation = 0;
} }
} }
@ -1223,11 +1218,10 @@ mips_relocate_section (bfd *output_bfd,
name = NULL; name = NULL;
else else
name = bfd_section_name (input_bfd, s); name = bfd_section_name (input_bfd, s);
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section,
int_rel.r_vaddr - input_section->vma))) int_rel.r_vaddr - input_section->vma);
return FALSE;
} }
break; break;
} }

View file

@ -1026,12 +1026,9 @@ coff_ppc_relocate_section (bfd *output_bfd,
+ sec->output_offset); + sec->output_offset);
} }
else else
{ (*info->callbacks->undefined_symbol)
if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.root.string, input_bfd, input_section,
(info, h->root.root.root.string, input_bfd, input_section, rel->r_vaddr - input_section->vma, TRUE);
rel->r_vaddr - input_section->vma, TRUE)))
return FALSE;
}
} }
rstat = bfd_reloc_ok; rstat = bfd_reloc_ok;
@ -1423,11 +1420,10 @@ coff_ppc_relocate_section (bfd *output_bfd,
name = buf; name = buf;
} }
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root.root : NULL), name, howto->name, (info, (h ? &h->root.root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, (bfd_vma) 0, input_bfd, input_section,
input_section, rel->r_vaddr - input_section->vma))) rel->r_vaddr - input_section->vma);
return FALSE;
} }
} }
} }

View file

@ -3367,15 +3367,12 @@ xcoff_ppc_relocate_section (bfd *output_bfd,
{ {
if (info->unresolved_syms_in_objects != RM_IGNORE if (info->unresolved_syms_in_objects != RM_IGNORE
&& (h->flags & XCOFF_WAS_UNDEFINED) != 0) && (h->flags & XCOFF_WAS_UNDEFINED) != 0)
{ (*info->callbacks->undefined_symbol)
if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string,
(info, h->root.root.string, input_bfd, input_section,
input_bfd, input_section, rel->r_vaddr - input_section->vma,
rel->r_vaddr - input_section->vma, info->unresolved_syms_in_objects == RM_GENERATE_ERROR);
(info->unresolved_syms_in_objects
== RM_GENERATE_ERROR))))
return FALSE;
}
if (h->root.type == bfd_link_hash_defined if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak) || h->root.type == bfd_link_hash_defweak)
{ {
@ -3455,11 +3452,10 @@ xcoff_ppc_relocate_section (bfd *output_bfd,
} }
sprintf (reloc_type_name, "0x%02x", rel->r_type); sprintf (reloc_type_name, "0x%02x", rel->r_type);
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, reloc_type_name, (info, (h ? &h->root : NULL), name, reloc_type_name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section,
rel->r_vaddr - input_section->vma))) rel->r_vaddr - input_section->vma);
return FALSE;
} }
/* Add RELOCATION to the right bits of VALUE_TO_RELOCATE. */ /* Add RELOCATION to the right bits of VALUE_TO_RELOCATE. */

View file

@ -2837,12 +2837,9 @@ sh_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
+ sec->output_offset); + sec->output_offset);
} }
else if (! bfd_link_relocatable (info)) else if (! bfd_link_relocatable (info))
{ (*info->callbacks->undefined_symbol)
if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section,
(info, h->root.root.string, input_bfd, input_section, rel->r_vaddr - input_section->vma, TRUE);
rel->r_vaddr - input_section->vma, TRUE)))
return FALSE;
}
} }
rstat = _bfd_final_link_relocate (howto, input_bfd, input_section, rstat = _bfd_final_link_relocate (howto, input_bfd, input_section,
@ -2875,11 +2872,10 @@ sh_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
name = buf; name = buf;
} }
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section,
rel->r_vaddr - input_section->vma))) rel->r_vaddr - input_section->vma);
return FALSE;
} }
} }
} }

View file

@ -563,12 +563,9 @@ coff_tic80_relocate_section (bfd *output_bfd,
} }
else if (! bfd_link_relocatable (info)) else if (! bfd_link_relocatable (info))
{ (*info->callbacks->undefined_symbol)
if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section,
(info, h->root.root.string, input_bfd, input_section, rel->r_vaddr - input_section->vma, TRUE);
rel->r_vaddr - input_section->vma, TRUE)))
return FALSE;
}
} }
addr = rel->r_vaddr - input_section->vma; addr = rel->r_vaddr - input_section->vma;
@ -688,11 +685,10 @@ coff_tic80_relocate_section (bfd *output_bfd,
return FALSE; return FALSE;
} }
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section,
rel->r_vaddr - input_section->vma))) rel->r_vaddr - input_section->vma);
return FALSE;
} }
} }
} }

View file

@ -315,14 +315,11 @@ w65_reloc16_extra_cases (bfd *abfd,
gap -= dot + 1; gap -= dot + 1;
if (gap < -128 || gap > 127) if (gap < -128 || gap > 127)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
bfd_put_8 (abfd, gap, data + dst_address); bfd_put_8 (abfd, gap, data + dst_address);
dst_address += 1; dst_address += 1;
src_address += 1; src_address += 1;
@ -340,14 +337,10 @@ w65_reloc16_extra_cases (bfd *abfd,
/* This wraps within the page, so ignore the relativeness, look at the /* This wraps within the page, so ignore the relativeness, look at the
high part. */ high part. */
if ((gap & 0xf0000) != (dot & 0xf0000)) if ((gap & 0xf0000) != (dot & 0xf0000))
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
gap -= dot + 2; gap -= dot + 2;
bfd_put_16 (abfd, gap, data + dst_address); bfd_put_16 (abfd, gap, data + dst_address);

View file

@ -188,14 +188,11 @@ extra_case (bfd *in_abfd,
val = bfd_coff_reloc16_get_value (reloc, link_info, val = bfd_coff_reloc16_get_value (reloc, link_info,
input_section); input_section);
if (val>127 || val<-128) /* Test for overflow. */ if (val>127 || val<-128) /* Test for overflow. */
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
bfd_put_8 (in_abfd, val, data + *dst_ptr); bfd_put_8 (in_abfd, val, data + *dst_ptr);
(*dst_ptr) += 1; (*dst_ptr) += 1;
(*src_ptr) += 1; (*src_ptr) += 1;
@ -247,14 +244,11 @@ extra_case (bfd *in_abfd,
the offset. */ the offset. */
if (gap >= 128 || gap < -128) if (gap >= 128 || gap < -128)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
bfd_put_8 (in_abfd, gap, data + *dst_ptr); bfd_put_8 (in_abfd, gap, data + *dst_ptr);
(*dst_ptr)++; (*dst_ptr)++;
(*src_ptr)++; (*src_ptr)++;

View file

@ -264,14 +264,11 @@ extra_case (bfd *in_abfd,
abort (); abort ();
gap /= 2; gap /= 2;
if (gap > 128 || gap < -128) if (gap > 128 || gap < -128)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
bfd_put_8 (in_abfd, gap, data + *dst_ptr); bfd_put_8 (in_abfd, gap, data + *dst_ptr);
(*dst_ptr)++; (*dst_ptr)++;
(*src_ptr)++; (*src_ptr)++;
@ -293,14 +290,11 @@ extra_case (bfd *in_abfd,
gap /= 2; gap /= 2;
if (gap > 0 || gap < -127) if (gap > 0 || gap < -127)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
bfd_put_8 (in_abfd, bfd_put_8 (in_abfd,
(bfd_get_8 ( in_abfd, data + *dst_ptr) & 0x80) + (-gap & 0x7f), (bfd_get_8 ( in_abfd, data + *dst_ptr) & 0x80) + (-gap & 0x7f),
data + *dst_ptr); data + *dst_ptr);
@ -321,14 +315,11 @@ extra_case (bfd *in_abfd,
if (gap & 1) if (gap & 1)
abort (); abort ();
if (gap > 4096 || gap < -4095) if (gap > 4096 || gap < -4095)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
gap /= 2; gap /= 2;
bfd_put_16 (in_abfd, bfd_put_16 (in_abfd,
(bfd_get_16 ( in_abfd, data + *dst_ptr) & 0xf000) | (-gap & 0x0fff), (bfd_get_16 ( in_abfd, data + *dst_ptr) & 0xf000) | (-gap & 0x0fff),
@ -348,14 +339,11 @@ extra_case (bfd *in_abfd,
int gap = dst - dot - 2; int gap = dst - dot - 2;
if (gap > 32767 || gap < -32768) if (gap > 32767 || gap < -32768)
{ (*link_info->callbacks->reloc_overflow)
if (! ((*link_info->callbacks->reloc_overflow) (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
(link_info, NULL, reloc->howto->name, reloc->addend, input_section->owner,
bfd_asymbol_name (*reloc->sym_ptr_ptr), input_section, reloc->address);
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
bfd_put_16 (in_abfd, (bfd_vma) gap, data + *dst_ptr); bfd_put_16 (in_abfd, (bfd_vma) gap, data + *dst_ptr);
(*dst_ptr) += 2; (*dst_ptr) += 2;
(*src_ptr) += 2; (*src_ptr) += 2;

View file

@ -1250,15 +1250,11 @@ xcoff64_ppc_relocate_section (bfd *output_bfd,
{ {
if (info->unresolved_syms_in_objects != RM_IGNORE if (info->unresolved_syms_in_objects != RM_IGNORE
&& (h->flags & XCOFF_WAS_UNDEFINED) != 0) && (h->flags & XCOFF_WAS_UNDEFINED) != 0)
{ (*info->callbacks->undefined_symbol)
if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section,
(info, h->root.root.string, rel->r_vaddr - input_section->vma,
input_bfd, input_section, info->unresolved_syms_in_objects == RM_GENERATE_ERROR);
rel->r_vaddr - input_section->vma,
(info->unresolved_syms_in_objects
== RM_GENERATE_ERROR))))
return FALSE;
}
if (h->root.type == bfd_link_hash_defined if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak) || h->root.type == bfd_link_hash_defweak)
{ {
@ -1337,11 +1333,10 @@ xcoff64_ppc_relocate_section (bfd *output_bfd,
} }
sprintf (reloc_type_name, "0x%02x", rel->r_type); sprintf (reloc_type_name, "0x%02x", rel->r_type);
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, reloc_type_name, (info, (h ? &h->root : NULL), name, reloc_type_name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section,
rel->r_vaddr - input_section->vma))) rel->r_vaddr - input_section->vma);
return FALSE;
} }
/* Add RELOCATION to the right bits of VALUE_TO_RELOCATE. */ /* Add RELOCATION to the right bits of VALUE_TO_RELOCATE. */

View file

@ -2515,10 +2515,8 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *flaginfo, bfd *input_bfd)
if (name == NULL) if (name == NULL)
return FALSE; return FALSE;
if (! ((*flaginfo->info->callbacks->unattached_reloc) (*flaginfo->info->callbacks->unattached_reloc)
(flaginfo->info, name, input_bfd, o, (flaginfo->info, name, input_bfd, o, irel->r_vaddr);
irel->r_vaddr)))
return FALSE;
} }
} }
} }
@ -2834,18 +2832,14 @@ _bfd_coff_reloc_link_order (bfd *output_bfd,
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
abort (); abort ();
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*flaginfo->info->callbacks->reloc_overflow) (*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, NULL, (flaginfo->info, NULL,
(link_order->type == bfd_section_reloc_link_order (link_order->type == bfd_section_reloc_link_order
? bfd_section_name (output_bfd, ? bfd_section_name (output_bfd,
link_order->u.reloc.p->u.section) link_order->u.reloc.p->u.section)
: link_order->u.reloc.p->u.name), : link_order->u.reloc.p->u.name),
howto->name, link_order->u.reloc.p->addend, howto->name, link_order->u.reloc.p->addend,
(bfd *) NULL, (asection *) NULL, (bfd_vma) 0))) (bfd *) NULL, (asection *) NULL, (bfd_vma) 0);
{
free (buf);
return FALSE;
}
break; break;
} }
loc = link_order->offset * bfd_octets_per_byte (output_bfd); loc = link_order->offset * bfd_octets_per_byte (output_bfd);
@ -2901,10 +2895,9 @@ _bfd_coff_reloc_link_order (bfd *output_bfd,
} }
else else
{ {
if (! ((*flaginfo->info->callbacks->unattached_reloc) (*flaginfo->info->callbacks->unattached_reloc)
(flaginfo->info, link_order->u.reloc.p->u.name, (bfd *) NULL, (flaginfo->info, link_order->u.reloc.p->u.name,
(asection *) NULL, (bfd_vma) 0))) (bfd *) NULL, (asection *) NULL, (bfd_vma) 0);
return FALSE;
irel->r_symndx = 0; irel->r_symndx = 0;
} }
} }
@ -3069,12 +3062,9 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
} }
else if (! bfd_link_relocatable (info)) else if (! bfd_link_relocatable (info))
{ (*info->callbacks->undefined_symbol)
if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section,
(info, h->root.root.string, input_bfd, input_section, rel->r_vaddr - input_section->vma, TRUE);
rel->r_vaddr - input_section->vma, TRUE)))
return FALSE;
}
} }
/* If the input section defining the symbol has been discarded /* If the input section defining the symbol has been discarded
@ -3144,11 +3134,10 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
return FALSE; return FALSE;
} }
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section,
rel->r_vaddr - input_section->vma))) rel->r_vaddr - input_section->vma);
return FALSE;
} }
} }
} }

View file

@ -4015,17 +4015,12 @@ ecoff_reloc_link_order (bfd *output_bfd,
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
abort (); abort ();
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, NULL, (info, NULL,
(link_order->type == bfd_section_reloc_link_order (link_order->type == bfd_section_reloc_link_order
? bfd_section_name (output_bfd, section) ? bfd_section_name (output_bfd, section)
: link_order->u.reloc.p->u.name), : link_order->u.reloc.p->u.name),
rel.howto->name, addend, NULL, rel.howto->name, addend, NULL, NULL, (bfd_vma) 0);
NULL, (bfd_vma) 0)))
{
free (buf);
return FALSE;
}
break; break;
} }
ok = bfd_set_section_contents (output_bfd, output_section, (void *) buf, ok = bfd_set_section_contents (output_bfd, output_section, (void *) buf,
@ -4055,10 +4050,8 @@ ecoff_reloc_link_order (bfd *output_bfd,
in.r_symndx = h->indx; in.r_symndx = h->indx;
else else
{ {
if (! ((*info->callbacks->unattached_reloc) (*info->callbacks->unattached_reloc)
(info, link_order->u.reloc.p->u.name, NULL, (info, link_order->u.reloc.p->u.name, NULL, NULL, (bfd_vma) 0);
NULL, (bfd_vma) 0)))
return FALSE;
in.r_symndx = 0; in.r_symndx = 0;
} }
in.r_extern = 1; in.r_extern = 1;

View file

@ -2594,12 +2594,11 @@ extern asection _bfd_elf_large_com_section;
bfd_boolean err; \ bfd_boolean err; \
err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR \ err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR \
|| ELF_ST_VISIBILITY (h->other) != STV_DEFAULT); \ || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT); \
if (!info->callbacks->undefined_symbol (info, \ (*info->callbacks->undefined_symbol) (info, \
h->root.root.string, \ h->root.root.string, \
input_bfd, \ input_bfd, \
input_section, \ input_section, \
rel->r_offset, err)) \ rel->r_offset, err); \
return FALSE; \
warned = TRUE; \ warned = TRUE; \
} \ } \
(void) unresolved_reloc; \ (void) unresolved_reloc; \

View file

@ -410,18 +410,15 @@ mn10200_elf_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol) (info, name, input_bfd,
(info, name, input_bfd, input_section, input_section,
rel->r_offset, TRUE))) rel->r_offset, TRUE);
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -441,10 +438,8 @@ mn10200_elf_relocate_section (bfd *output_bfd,
/* fall through */ /* fall through */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -2151,18 +2151,14 @@ mn10300_elf_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root.root : NULL), name, (info, (h ? &h->root.root : NULL), name, howto->name,
howto->name, (bfd_vma) 0, input_bfd, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
input_section, rel->r_offset)))
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:

View file

@ -1462,25 +1462,19 @@ elf_arc_relocate_section (bfd * output_bfd,
{ {
/* Fail if it is linking for PIE and the symbol is /* Fail if it is linking for PIE and the symbol is
undefined. */ undefined. */
if (bfd_link_executable (info) if (bfd_link_executable (info))
&& !(*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section, (info, h->root.root.string, input_bfd, input_section,
rel->r_offset, TRUE)) rel->r_offset, TRUE);
{
return FALSE;
}
reloc_data.sym_value = h->plt.offset; reloc_data.sym_value = h->plt.offset;
reloc_data.sym_section = htab->splt; reloc_data.sym_section = htab->splt;
reloc_data.should_relocate = TRUE; reloc_data.should_relocate = TRUE;
} }
else if (!bfd_link_pic (info) else if (!bfd_link_pic (info))
&& !(*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section, (info, h->root.root.string, input_bfd, input_section,
rel->r_offset, TRUE)) rel->r_offset, TRUE);
{
return FALSE;
}
} }
if (h->got.glist != NULL) if (h->got.glist != NULL)

View file

@ -11509,14 +11509,11 @@ elf32_arm_relocate_section (bfd * output_bfd,
&& r_symndx != STN_UNDEF && r_symndx != STN_UNDEF
&& bfd_is_und_section (sec) && bfd_is_und_section (sec)
&& ELF_ST_BIND (sym->st_info) != STB_WEAK) && ELF_ST_BIND (sym->st_info) != STB_WEAK)
{ (*info->callbacks->undefined_symbol)
if (!info->callbacks->undefined_symbol (info, bfd_elf_string_from_elf_section
(info, bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name),
(input_bfd, symtab_hdr->sh_link, sym->st_name), input_bfd, input_section,
input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE))
return FALSE;
}
if (globals->use_rel) if (globals->use_rel)
{ {
@ -11736,20 +11733,15 @@ elf32_arm_relocate_section (bfd * output_bfd,
/* If the overflowing reloc was to an undefined symbol, /* If the overflowing reloc was to an undefined symbol,
we have already printed one error message and there we have already printed one error message and there
is no point complaining again. */ is no point complaining again. */
if ((! h || if (!h || h->root.type != bfd_link_hash_undefined)
h->root.type != bfd_link_hash_undefined) (*info->callbacks->reloc_overflow)
&& (!((*info->callbacks->reloc_overflow) (info, (h ? &h->root : NULL), name, howto->name,
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
(bfd_vma) 0, input_bfd, input_section,
rel->r_offset))))
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -11770,10 +11762,8 @@ elf32_arm_relocate_section (bfd * output_bfd,
common_error: common_error:
BFD_ASSERT (error_message != NULL); BFD_ASSERT (error_message != NULL);
if (!((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, error_message, input_bfd, input_section, (info, error_message, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -1487,14 +1487,13 @@ elf32_avr_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), (info, (h ? &h->root : NULL), name, howto->name,
name, howto->name, (bfd_vma) 0, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE); (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break; break;
@ -1516,11 +1515,8 @@ elf32_avr_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -1623,12 +1623,9 @@ bfin_relocate_section (bfd * output_bfd,
} }
if (r == bfd_reloc_overflow) if (r == bfd_reloc_overflow)
{ (*info->callbacks->reloc_overflow)
if (!(info->callbacks->reloc_overflow (info, (h ? &h->root : NULL), name, howto->name,
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
(bfd_vma) 0, input_bfd, input_section, rel->r_offset)))
return FALSE;
}
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
@ -3209,13 +3206,13 @@ bfinfdpic_relocate_section (bfd * output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE); (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break; break;
@ -3237,11 +3234,8 @@ bfinfdpic_relocate_section (bfd * output_bfd,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -1472,18 +1472,14 @@ elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (!((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -1503,10 +1499,8 @@ elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
/* Fall through. */ /* Fall through. */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -765,18 +765,14 @@ elf32_cr16c_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (!((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -796,10 +792,8 @@ elf32_cr16c_relocate_section (bfd *output_bfd,
/* fall through */ /* fall through */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -1973,7 +1973,7 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), symname, howto->name, (info, (h ? &h->root : NULL), symname, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
if (additional_relocation_error_msg_count > 0) if (additional_relocation_error_msg_count > 0)
@ -2010,9 +2010,8 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, symname, input_bfd, input_section, rel->r_offset, (info, symname, input_bfd, input_section, rel->r_offset, TRUE);
TRUE);
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -2033,11 +2032,8 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, symname, input_bfd,
(info, msg, symname, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -909,18 +909,14 @@ elf32_crx_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (!((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -940,10 +936,8 @@ elf32_crx_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
/* Fall through. */ /* Fall through. */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -498,18 +498,14 @@ elf32_d10v_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (!((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -529,10 +525,8 @@ elf32_d10v_relocate_section (bfd *output_bfd,
/* fall through */ /* fall through */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -547,13 +547,13 @@ epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE); (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break; break;
@ -578,11 +578,8 @@ epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -576,15 +576,14 @@ fr30_elf_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
TRUE);
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -605,11 +604,8 @@ fr30_elf_relocate_section (bfd *output_bfd,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -4031,13 +4031,13 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE); (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break; break;
@ -4065,9 +4065,6 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
input_bfd, input_section, rel->r_offset, name, msg); input_bfd, input_section, rel->r_offset, name, msg);
return FALSE; return FALSE;
} }
if (! r)
return FALSE;
} }
} }

View file

@ -320,15 +320,14 @@ ft32_elf_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
TRUE);
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -349,11 +348,8 @@ ft32_elf_relocate_section (bfd *output_bfd,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -507,18 +507,14 @@ elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -538,10 +534,8 @@ elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
/* fall through */ /* fall through */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -3733,10 +3733,9 @@ elf32_hppa_relocate_section (bfd *output_bfd,
&& ELF_ST_VISIBILITY (eh->other) == STV_DEFAULT && ELF_ST_VISIBILITY (eh->other) == STV_DEFAULT
&& eh->type == STT_PARISC_MILLI) && eh->type == STT_PARISC_MILLI)
{ {
if (! info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, eh_name (eh), input_bfd, (info, eh_name (eh), input_bfd,
input_section, rela->r_offset, FALSE)) input_section, rela->r_offset, FALSE);
return FALSE;
warned_undef = TRUE; warned_undef = TRUE;
} }
} }
@ -4311,12 +4310,9 @@ elf32_hppa_relocate_section (bfd *output_bfd,
} }
} }
else else
{ (*info->callbacks->reloc_overflow)
if (!((*info->callbacks->reloc_overflow) (info, (hh ? &hh->eh.root : NULL), sym_name, howto->name,
(info, (hh ? &hh->eh.root : NULL), sym_name, howto->name, (bfd_vma) 0, input_bfd, input_section, rela->r_offset);
(bfd_vma) 0, input_bfd, input_section, rela->r_offset)))
return FALSE;
}
} }
return TRUE; return TRUE;

View file

@ -1137,15 +1137,13 @@ i370_elf_relocate_section (bfd *output_bfd,
; ;
else if (!bfd_link_relocatable (info)) else if (!bfd_link_relocatable (info))
{ {
if ((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd,
input_section, rel->r_offset, input_section, rel->r_offset,
(info->unresolved_syms_in_objects == RM_GENERATE_ERROR (info->unresolved_syms_in_objects == RM_GENERATE_ERROR
|| ELF_ST_VISIBILITY (h->other)))) || ELF_ST_VISIBILITY (h->other)));
{ ret = FALSE;
ret = FALSE; continue;
continue;
}
} }
} }

View file

@ -4961,13 +4961,9 @@ check_relocation_error:
} }
if (r == bfd_reloc_overflow) if (r == bfd_reloc_overflow)
{ (*info->callbacks->reloc_overflow)
if (! ((*info->callbacks->reloc_overflow) (info, (h ? &h->root : NULL), name, howto->name,
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
(bfd_vma) 0, input_bfd, input_section,
rel->r_offset)))
return FALSE;
}
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)

View file

@ -1196,13 +1196,13 @@ elf32_i860_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE); (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break; break;
@ -1224,11 +1224,8 @@ elf32_i860_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -1458,13 +1458,13 @@ ip2k_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE); (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break; break;
@ -1489,11 +1489,8 @@ ip2k_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -678,13 +678,13 @@ iq2000_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE); (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break; break;
@ -706,11 +706,8 @@ iq2000_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -1149,17 +1149,14 @@ lm32_elf_relocate_section (bfd *output_bfd,
if ((h != NULL) if ((h != NULL)
&& (h->root.type == bfd_link_hash_undefweak)) && (h->root.type == bfd_link_hash_undefweak))
break; break;
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset))) (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -1179,10 +1176,8 @@ lm32_elf_relocate_section (bfd *output_bfd,
/* fall through */ /* fall through */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -478,12 +478,9 @@ m32c_elf_relocate_section
else if (h->root.type == bfd_link_hash_undefweak) else if (h->root.type == bfd_link_hash_undefweak)
; ;
else if (!bfd_link_relocatable (info)) else if (!bfd_link_relocatable (info))
{ (*info->callbacks->undefined_symbol) (info, h->root.root.string,
if (! ((*info->callbacks->undefined_symbol) input_bfd, input_section,
(info, h->root.root.string, input_bfd, rel->r_offset, TRUE);
input_section, rel->r_offset, TRUE)))
return FALSE;
}
} }
if (sec != NULL && discarded_section (sec)) if (sec != NULL && discarded_section (sec))
@ -613,15 +610,14 @@ m32c_elf_relocate_section
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
TRUE);
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -642,11 +638,8 @@ m32c_elf_relocate_section
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -2580,14 +2580,11 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
; ;
else if (!bfd_link_relocatable (info)) else if (!bfd_link_relocatable (info))
{ (*info->callbacks->undefined_symbol)
if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd,
(info, h->root.root.string, input_bfd, input_section, offset,
input_section, offset, (info->unresolved_syms_in_objects == RM_GENERATE_ERROR
(info->unresolved_syms_in_objects == RM_GENERATE_ERROR || ELF_ST_VISIBILITY (h->other)));
|| ELF_ST_VISIBILITY (h->other)))))
return FALSE;
}
} }
if (sec != NULL && discarded_section (sec)) if (sec != NULL && discarded_section (sec))
@ -3062,17 +3059,14 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, offset))) (bfd_vma) 0, input_bfd, input_section, offset);
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, (info, name, input_bfd, input_section, offset, TRUE);
offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -3092,10 +3086,8 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
/* fall through */ /* fall through */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, errmsg, name, input_bfd,
(info, errmsg, name, input_bfd, input_section, input_section, offset);
offset)))
return FALSE;
break; break;
} }
} }

View file

@ -958,7 +958,6 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
bfd_vma val; bfd_vma val;
const char * msg; const char * msg;
char * buf; char * buf;
bfd_boolean res;
r_symndx = ELF32_R_SYM (rel->r_info); r_symndx = ELF32_R_SYM (rel->r_info);
r_type = ELF32_R_TYPE (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info);
@ -1121,8 +1120,8 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
buf = xmalloc (strlen (msg) + strlen (name) + 10); buf = xmalloc (strlen (msg) + strlen (name) + 10);
sprintf (buf, msg, name); sprintf (buf, msg, name);
(* info->callbacks->warning) (*info->callbacks->warning)
(info, buf, name, input_bfd, NULL, rel->r_offset); (info, buf, name, input_bfd, NULL, rel->r_offset);
free (buf); free (buf);
} }
@ -1156,11 +1155,9 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
"code."); "code.");
buf = xmalloc (strlen (msg) + 128); buf = xmalloc (strlen (msg) + 128);
sprintf (buf, msg, phys_addr); sprintf (buf, msg, phys_addr);
res = (*info->callbacks->warning) (info, buf, name, input_bfd, (*info->callbacks->warning) (info, buf, name, input_bfd,
input_section, insn_addr); input_section, insn_addr);
free (buf); free (buf);
if (! res)
return FALSE;
break; break;
} }
} }
@ -1176,11 +1173,9 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
(long) (relocation + rel->r_addend), (long) (relocation + rel->r_addend),
insn_page, m68hc11_phys_addr (pinfo, insn_addr), insn_page, m68hc11_phys_addr (pinfo, insn_addr),
(long) (insn_addr)); (long) (insn_addr));
res = (*info->callbacks->warning) (*info->callbacks->warning) (info, buf, name, input_bfd,
(info, buf, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
free (buf); free (buf);
if (! res)
return FALSE;
break; break;
} }
@ -1190,12 +1185,9 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
"normal address space at %04lx"); "normal address space at %04lx");
buf = xmalloc (strlen (msg) + 128); buf = xmalloc (strlen (msg) + 128);
sprintf (buf, msg, phys_page, phys_addr, insn_addr); sprintf (buf, msg, phys_page, phys_addr, insn_addr);
res = (*info->callbacks->warning) (*info->callbacks->warning) (info, buf, name, input_bfd,
(info, buf, name, input_bfd, input_section, insn_addr); input_section, insn_addr);
free (buf); free (buf);
if (! res)
return FALSE;
relocation = phys_addr; relocation = phys_addr;
break; break;
} }
@ -1235,11 +1227,9 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
"offset the address in your code"); "offset the address in your code");
buf = xmalloc (strlen (msg) + 128); buf = xmalloc (strlen (msg) + 128);
sprintf (buf, msg, phys_addr); sprintf (buf, msg, phys_addr);
res = (*info->callbacks->warning) (info, buf, name, input_bfd, (*info->callbacks->warning) (info, buf, name, input_bfd,
input_section, insn_addr); input_section, insn_addr);
free (buf); free (buf);
if (! res)
return FALSE;
break; break;
} }
} }
@ -1262,17 +1252,14 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (!((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, NULL, name, howto->name, (bfd_vma) 0, (info, NULL, name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset))) input_bfd, input_section, rel->r_offset);
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -1292,10 +1279,8 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
/* fall through */ /* fall through */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -4185,13 +4185,9 @@ elf_m68k_relocate_section (bfd *output_bfd,
} }
if (r == bfd_reloc_overflow) if (r == bfd_reloc_overflow)
{ (*info->callbacks->reloc_overflow)
if (!(info->callbacks->reloc_overflow (info, (h ? &h->root : NULL), name, howto->name,
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
(bfd_vma) 0, input_bfd, input_section,
rel->r_offset)))
return FALSE;
}
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)

View file

@ -508,13 +508,13 @@ mep_elf_relocate_section
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE); (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break; break;
@ -536,11 +536,8 @@ mep_elf_relocate_section
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -1988,15 +1988,14 @@ elf_metag_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (hh ? &hh->eh.root : NULL), name, howto->name, (info, (hh ? &hh->eh.root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
TRUE);
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -2017,11 +2016,8 @@ elf_metag_relocate_section (bfd *output_bfd,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -1556,16 +1556,14 @@ microblaze_elf_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (!((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, offset))) (bfd_vma) 0, input_bfd, input_section, offset);
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, offset, TRUE))) (info, name, input_bfd, input_section, offset, TRUE);
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -1584,9 +1582,8 @@ microblaze_elf_relocate_section (bfd *output_bfd,
errmsg = _("internal error: unknown error"); errmsg = _("internal error: unknown error");
/* Fall through. */ /* Fall through. */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, errmsg, name, input_bfd,
(info, errmsg, name, input_bfd, input_section, offset))) input_section, offset);
return FALSE;
break; break;
} }
} }

View file

@ -270,15 +270,14 @@ moxie_elf_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
TRUE);
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -299,11 +298,8 @@ moxie_elf_relocate_section (bfd *output_bfd,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -1341,15 +1341,14 @@ elf32_msp430_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE); (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -1370,11 +1369,8 @@ elf32_msp430_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (!r)
return FALSE;
} }
} }

View file

@ -385,13 +385,13 @@ mt_elf_relocate_section
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE); (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break; break;
@ -409,11 +409,8 @@ mt_elf_relocate_section
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -5424,16 +5424,14 @@ check_reloc:
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (!((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, offset))) (bfd_vma) 0, input_bfd, input_section, offset);
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, offset, TRUE))) (info, name, input_bfd, input_section, offset, TRUE);
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -5452,10 +5450,9 @@ check_reloc:
errmsg = _("internal error: unknown error"); errmsg = _("internal error: unknown error");
/* Fall through. */ /* Fall through. */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, errmsg, name, input_bfd,
(info, errmsg, name, input_bfd, input_section, offset))) input_section, offset);
return FALSE;
break; break;
} }
} }
@ -13059,25 +13056,22 @@ nds32_elf_get_relocated_section_contents (bfd *abfd,
switch (r) switch (r)
{ {
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*link_info->callbacks->undefined_symbol) (*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr), (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
input_bfd, input_section, (*parent)->address, TRUE))) input_bfd, input_section, (*parent)->address, TRUE);
goto error_return;
break; break;
case bfd_reloc_dangerous: case bfd_reloc_dangerous:
BFD_ASSERT (error_message != NULL); BFD_ASSERT (error_message != NULL);
if (!((*link_info->callbacks->reloc_dangerous) (*link_info->callbacks->reloc_dangerous)
(link_info, error_message, input_bfd, input_section, (link_info, error_message,
(*parent)->address))) input_bfd, input_section, (*parent)->address);
goto error_return;
break; break;
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (!((*link_info->callbacks->reloc_overflow) (*link_info->callbacks->reloc_overflow)
(link_info, NULL, (link_info, NULL,
bfd_asymbol_name (*(*parent)->sym_ptr_ptr), bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
(*parent)->howto->name, (*parent)->addend, (*parent)->howto->name, (*parent)->addend,
input_bfd, input_section, (*parent)->address))) input_bfd, input_section, (*parent)->address);
goto error_return;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
/* PR ld/13730: /* PR ld/13730:

View file

@ -4480,16 +4480,16 @@ nios2_elf32_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (info, NULL, name, (*info->callbacks->reloc_overflow) (info, NULL, name,
howto->name, (bfd_vma) 0, howto->name, (bfd_vma) 0,
input_bfd, input_section, input_bfd, input_section,
rel->r_offset); rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (info, name, input_bfd, (*info->callbacks->undefined_symbol) (info, name, input_bfd,
input_section, input_section,
rel->r_offset, TRUE); rel->r_offset, TRUE);
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -4515,8 +4515,8 @@ nios2_elf32_relocate_section (bfd *output_bfd,
if (msg) if (msg)
{ {
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
return FALSE; return FALSE;
} }
} }

View file

@ -1249,13 +1249,13 @@ or1k_elf_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE); (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break; break;
@ -1277,11 +1277,8 @@ or1k_elf_relocate_section (bfd *output_bfd,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (!r)
return FALSE;
} }
} }

View file

@ -8567,13 +8567,12 @@ ppc_elf_relocate_section (bfd *output_bfd,
at a symbol not in this object. */ at a symbol not in this object. */
if (unresolved_reloc) if (unresolved_reloc)
{ {
if (! (*info->callbacks->undefined_symbol) (info, (*info->callbacks->undefined_symbol) (info,
h->root.root.string, h->root.root.string,
input_bfd, input_bfd,
input_section, input_section,
rel->r_offset, rel->r_offset,
TRUE)) TRUE);
return FALSE;
goto copy_reloc; goto copy_reloc;
} }
break; break;
@ -9509,13 +9508,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
&& (h->root.type == bfd_link_hash_undefweak && (h->root.type == bfd_link_hash_undefweak
|| h->root.type == bfd_link_hash_undefined) || h->root.type == bfd_link_hash_undefined)
&& is_branch_reloc (r_type))) && is_branch_reloc (r_type)))
{ info->callbacks->reloc_overflow
if (!((*info->callbacks->reloc_overflow) (info, (h ? &h->root : NULL), sym_name, howto->name,
(info, (h ? &h->root : NULL), sym_name, rel->r_addend, input_bfd, input_section, rel->r_offset);
howto->name, rel->r_addend,
input_bfd, input_section, rel->r_offset)))
return FALSE;
}
} }
else else
{ {

View file

@ -295,7 +295,6 @@ rl78_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
static bfd_vma static bfd_vma
get_symbol_value (const char * name, get_symbol_value (const char * name,
bfd_reloc_status_type * status,
struct bfd_link_info * info, struct bfd_link_info * info,
bfd * input_bfd, bfd * input_bfd,
asection * input_section, asection * input_section,
@ -312,12 +311,8 @@ get_symbol_value (const char * name,
|| (h->type != bfd_link_hash_defined || (h->type != bfd_link_hash_defined
&& h->type != bfd_link_hash_defweak)) && h->type != bfd_link_hash_defweak))
{ {
bfd_reloc_status_type res; (*info->callbacks->undefined_symbol)
res = info->callbacks->undefined_symbol
(info, name, input_bfd, input_section, offset, TRUE); (info, name, input_bfd, input_section, offset, TRUE);
if (status)
* status = res;
return 0; return 0;
} }
@ -327,44 +322,36 @@ get_symbol_value (const char * name,
} }
static bfd_vma static bfd_vma
get_romstart (bfd_reloc_status_type * status, get_romstart (struct bfd_link_info * info,
struct bfd_link_info * info,
bfd * abfd, bfd * abfd,
asection * sec, asection * sec,
int offset) int offset)
{ {
static bfd_boolean cached = FALSE; static bfd_boolean cached = FALSE;
static bfd_vma cached_value = 0; static bfd_vma cached_value = 0;
static bfd_reloc_status_type cached_status;
if (!cached) if (!cached)
{ {
cached_value = get_symbol_value ("_start", & cached_status, info, abfd, sec, offset); cached_value = get_symbol_value ("_start", info, abfd, sec, offset);
cached = TRUE; cached = TRUE;
} }
if (status)
* status = cached_status;
return cached_value; return cached_value;
} }
static bfd_vma static bfd_vma
get_ramstart (bfd_reloc_status_type * status, get_ramstart (struct bfd_link_info * info,
struct bfd_link_info * info,
bfd * abfd, bfd * abfd,
asection * sec, asection * sec,
int offset) int offset)
{ {
static bfd_boolean cached = FALSE; static bfd_boolean cached = FALSE;
static bfd_vma cached_value = 0; static bfd_vma cached_value = 0;
static bfd_reloc_status_type cached_status;
if (!cached) if (!cached)
{ {
cached_value = get_symbol_value ("__datastart", & cached_status, info, abfd, sec, offset); cached_value = get_symbol_value ("__datastart", info, abfd, sec, offset);
cached = TRUE; cached = TRUE;
} }
if (status)
* status = cached_status;
return cached_value; return cached_value;
} }
@ -573,12 +560,12 @@ rl78_special_reloc (bfd * input_bfd,
break; break;
case R_RL78_OPromtop: case R_RL78_OPromtop:
relocation = get_romstart (&r, NULL, input_bfd, input_section, relocation = get_romstart (NULL, input_bfd, input_section,
reloc->address); reloc->address);
break; break;
case R_RL78_OPramtop: case R_RL78_OPramtop:
relocation = get_ramstart (&r, NULL, input_bfd, input_section, relocation = get_ramstart (NULL, input_bfd, input_section,
reloc->address); reloc->address);
break; break;
} }
@ -1068,12 +1055,12 @@ rl78_elf_relocate_section
break; break;
case R_RL78_OPromtop: case R_RL78_OPromtop:
relocation = get_romstart (&r, info, input_bfd, input_section, rel->r_offset); relocation = get_romstart (info, input_bfd, input_section, rel->r_offset);
(void) rl78_compute_complex_reloc (r_type, relocation, input_section); (void) rl78_compute_complex_reloc (r_type, relocation, input_section);
break; break;
case R_RL78_OPramtop: case R_RL78_OPramtop:
relocation = get_ramstart (&r, info, input_bfd, input_section, rel->r_offset); relocation = get_ramstart (info, input_bfd, input_section, rel->r_offset);
(void) rl78_compute_complex_reloc (r_type, relocation, input_section); (void) rl78_compute_complex_reloc (r_type, relocation, input_section);
break; break;
@ -1094,15 +1081,14 @@ rl78_elf_relocate_section
if (r_type == R_RL78_DIR24S_PCREL) if (r_type == R_RL78_DIR24S_PCREL)
msg = _("%B(%A): error: call to undefined function '%s'"); msg = _("%B(%A): error: call to undefined function '%s'");
else else
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
TRUE);
break; break;
case bfd_reloc_other: case bfd_reloc_other:
@ -1128,9 +1114,6 @@ rl78_elf_relocate_section
if (msg) if (msg)
_bfd_error_handler (msg, input_bfd, input_section, name); _bfd_error_handler (msg, input_bfd, input_section, name);
if (! r)
return FALSE;
} }
} }
@ -1932,12 +1915,12 @@ rl78_offset_for_reloc (bfd * abfd,
break; break;
case R_RL78_OPromtop: case R_RL78_OPromtop:
symval = get_romstart (NULL, info, input_bfd, input_section, rel->r_offset); symval = get_romstart (info, input_bfd, input_section, rel->r_offset);
(void) rl78_compute_complex_reloc (r_type, symval, input_section); (void) rl78_compute_complex_reloc (r_type, symval, input_section);
break; break;
case R_RL78_OPramtop: case R_RL78_OPramtop:
symval = get_ramstart (NULL, info, input_bfd, input_section, rel->r_offset); symval = get_ramstart (info, input_bfd, input_section, rel->r_offset);
(void) rl78_compute_complex_reloc (r_type, symval, input_section); (void) rl78_compute_complex_reloc (r_type, symval, input_section);
break; break;

View file

@ -317,7 +317,6 @@ rx_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
static bfd_vma static bfd_vma
get_symbol_value (const char * name, get_symbol_value (const char * name,
bfd_reloc_status_type * status,
struct bfd_link_info * info, struct bfd_link_info * info,
bfd * input_bfd, bfd * input_bfd,
asection * input_section, asection * input_section,
@ -331,7 +330,7 @@ get_symbol_value (const char * name,
if (h == NULL if (h == NULL
|| (h->type != bfd_link_hash_defined || (h->type != bfd_link_hash_defined
&& h->type != bfd_link_hash_defweak)) && h->type != bfd_link_hash_defweak))
* status = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, offset, TRUE); (info, name, input_bfd, input_section, offset, TRUE);
else else
value = (h->u.def.value value = (h->u.def.value
@ -340,6 +339,7 @@ get_symbol_value (const char * name,
return value; return value;
} }
static bfd_vma static bfd_vma
get_symbol_value_maybe (const char * name, get_symbol_value_maybe (const char * name,
struct bfd_link_info * info) struct bfd_link_info * info)
@ -362,8 +362,7 @@ get_symbol_value_maybe (const char * name,
} }
static bfd_vma static bfd_vma
get_gp (bfd_reloc_status_type * status, get_gp (struct bfd_link_info * info,
struct bfd_link_info * info,
bfd * abfd, bfd * abfd,
asection * sec, asection * sec,
int offset) int offset)
@ -373,15 +372,14 @@ get_gp (bfd_reloc_status_type * status,
if (!cached) if (!cached)
{ {
cached_value = get_symbol_value ("__gp", status, info, abfd, sec, offset); cached_value = get_symbol_value ("__gp", info, abfd, sec, offset);
cached = TRUE; cached = TRUE;
} }
return cached_value; return cached_value;
} }
static bfd_vma static bfd_vma
get_romstart (bfd_reloc_status_type * status, get_romstart (struct bfd_link_info * info,
struct bfd_link_info * info,
bfd * abfd, bfd * abfd,
asection * sec, asection * sec,
int offset) int offset)
@ -391,15 +389,14 @@ get_romstart (bfd_reloc_status_type * status,
if (!cached) if (!cached)
{ {
cached_value = get_symbol_value ("_start", status, info, abfd, sec, offset); cached_value = get_symbol_value ("_start", info, abfd, sec, offset);
cached = TRUE; cached = TRUE;
} }
return cached_value; return cached_value;
} }
static bfd_vma static bfd_vma
get_ramstart (bfd_reloc_status_type * status, get_ramstart (struct bfd_link_info * info,
struct bfd_link_info * info,
bfd * abfd, bfd * abfd,
asection * sec, asection * sec,
int offset) int offset)
@ -409,7 +406,7 @@ get_ramstart (bfd_reloc_status_type * status,
if (!cached) if (!cached)
{ {
cached_value = get_symbol_value ("__datastart", status, info, abfd, sec, offset); cached_value = get_symbol_value ("__datastart", info, abfd, sec, offset);
cached = TRUE; cached = TRUE;
} }
return cached_value; return cached_value;
@ -553,7 +550,6 @@ rx_elf_relocate_section
bfd_vma entry_vma; bfd_vma entry_vma;
int idx; int idx;
char *buf; char *buf;
bfd_reloc_status_type tstat = 0;
if (table_default_cache != name) if (table_default_cache != name)
{ {
@ -571,18 +567,14 @@ rx_elf_relocate_section
buf = (char *) malloc (13 + strlen (name + 20)); buf = (char *) malloc (13 + strlen (name + 20));
sprintf (buf, "$tablestart$%s", name + 20); sprintf (buf, "$tablestart$%s", name + 20);
tstat = 0;
table_start_cache = get_symbol_value (buf, table_start_cache = get_symbol_value (buf,
&tstat,
info, info,
input_bfd, input_bfd,
input_section, input_section,
rel->r_offset); rel->r_offset);
sprintf (buf, "$tableend$%s", name + 20); sprintf (buf, "$tableend$%s", name + 20);
tstat = 0;
table_end_cache = get_symbol_value (buf, table_end_cache = get_symbol_value (buf,
&tstat,
info, info,
input_bfd, input_bfd,
input_section, input_section,
@ -956,7 +948,7 @@ rx_elf_relocate_section
case R_RX_RH_GPRELB: case R_RX_RH_GPRELB:
WARN_REDHAT ("RX_RH_GPRELB"); WARN_REDHAT ("RX_RH_GPRELB");
relocation -= get_gp (&r, info, input_bfd, input_section, rel->r_offset); relocation -= get_gp (info, input_bfd, input_section, rel->r_offset);
RANGE (0, 65535); RANGE (0, 65535);
#if RX_OPCODE_BIG_ENDIAN #if RX_OPCODE_BIG_ENDIAN
OP (1) = relocation; OP (1) = relocation;
@ -969,7 +961,7 @@ rx_elf_relocate_section
case R_RX_RH_GPRELW: case R_RX_RH_GPRELW:
WARN_REDHAT ("RX_RH_GPRELW"); WARN_REDHAT ("RX_RH_GPRELW");
relocation -= get_gp (&r, info, input_bfd, input_section, rel->r_offset); relocation -= get_gp (info, input_bfd, input_section, rel->r_offset);
ALIGN (1); ALIGN (1);
relocation >>= 1; relocation >>= 1;
RANGE (0, 65535); RANGE (0, 65535);
@ -984,7 +976,7 @@ rx_elf_relocate_section
case R_RX_RH_GPRELL: case R_RX_RH_GPRELL:
WARN_REDHAT ("RX_RH_GPRELL"); WARN_REDHAT ("RX_RH_GPRELL");
relocation -= get_gp (&r, info, input_bfd, input_section, rel->r_offset); relocation -= get_gp (info, input_bfd, input_section, rel->r_offset);
ALIGN (3); ALIGN (3);
relocation >>= 2; relocation >>= 2;
RANGE (0, 65535); RANGE (0, 65535);
@ -1407,11 +1399,11 @@ rx_elf_relocate_section
break; break;
case R_RX_OPromtop: case R_RX_OPromtop:
RX_STACK_PUSH (get_romstart (&r, info, input_bfd, input_section, rel->r_offset)); RX_STACK_PUSH (get_romstart (info, input_bfd, input_section, rel->r_offset));
break; break;
case R_RX_OPramtop: case R_RX_OPramtop:
RX_STACK_PUSH (get_ramstart (&r, info, input_bfd, input_section, rel->r_offset)); RX_STACK_PUSH (get_ramstart (info, input_bfd, input_section, rel->r_offset));
break; break;
default: default:
@ -1431,15 +1423,14 @@ rx_elf_relocate_section
if (r_type == R_RX_DIR24S_PCREL) if (r_type == R_RX_DIR24S_PCREL)
msg = _("%B(%A): error: call to undefined function '%s'"); msg = _("%B(%A): error: call to undefined function '%s'");
else else
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
TRUE);
break; break;
case bfd_reloc_other: case bfd_reloc_other:
@ -1465,9 +1456,6 @@ rx_elf_relocate_section
if (msg) if (msg)
_bfd_error_handler (msg, input_bfd, input_section, name); _bfd_error_handler (msg, input_bfd, input_section, name);
if (! r)
return FALSE;
} }
} }
@ -1902,11 +1890,11 @@ rx_offset_for_reloc (bfd * abfd,
break; break;
case R_RX_OPromtop: case R_RX_OPromtop:
RX_STACK_PUSH (get_romstart (&r, info, input_bfd, input_section, rel->r_offset)); RX_STACK_PUSH (get_romstart (info, input_bfd, input_section, rel->r_offset));
break; break;
case R_RX_OPramtop: case R_RX_OPramtop:
RX_STACK_PUSH (get_ramstart (&r, info, input_bfd, input_section, rel->r_offset)); RX_STACK_PUSH (get_ramstart (info, input_bfd, input_section, rel->r_offset));
break; break;
case R_RX_DIR16UL: case R_RX_DIR16UL:
@ -1941,6 +1929,8 @@ rx_offset_for_reloc (bfd * abfd,
rel ++; rel ++;
} }
/* FIXME. */
(void) r;
} }
static void static void

View file

@ -3442,14 +3442,9 @@ elf_s390_relocate_section (bfd *output_bfd,
} }
if (r == bfd_reloc_overflow) if (r == bfd_reloc_overflow)
{ (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name,
if (! ((*info->callbacks->reloc_overflow) (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
(info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section,
rel->r_offset)))
return FALSE;
}
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)

View file

@ -2667,12 +2667,11 @@ s3_bfd_score_elf_relocate_section (bfd *output_bfd,
} }
else if (!bfd_link_relocatable (info)) else if (!bfd_link_relocatable (info))
{ {
if (! ((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd, (info, h->root.root.root.string, input_bfd,
input_section, rel->r_offset, input_section, rel->r_offset,
(info->unresolved_syms_in_objects == RM_GENERATE_ERROR) (info->unresolved_syms_in_objects == RM_GENERATE_ERROR)
|| ELF_ST_VISIBILITY (h->root.other)))) || ELF_ST_VISIBILITY (h->root.other));
return bfd_reloc_undefined;
relocation = 0; relocation = 0;
} }
} }
@ -2718,16 +2717,14 @@ s3_bfd_score_elf_relocate_section (bfd *output_bfd,
/* If the overflowing reloc was to an undefined symbol, /* If the overflowing reloc was to an undefined symbol,
we have already printed one error message and there we have already printed one error message and there
is no point complaining again. */ is no point complaining again. */
if (((!h) || (h->root.root.type != bfd_link_hash_undefined)) if (!h || h->root.root.type != bfd_link_hash_undefined)
&& (!((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, NULL, name, howto->name, (bfd_vma) 0, (info, NULL, name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset)))) input_bfd, input_section, rel->r_offset);
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE))) (info, name, input_bfd, input_section, rel->r_offset, TRUE);
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -2752,9 +2749,8 @@ s3_bfd_score_elf_relocate_section (bfd *output_bfd,
/* fall through */ /* fall through */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset))) input_section, rel->r_offset);
return FALSE;
break; break;
} }
} }

View file

@ -2440,12 +2440,11 @@ s7_bfd_score_elf_relocate_section (bfd *output_bfd,
} }
else if (!bfd_link_relocatable (info)) else if (!bfd_link_relocatable (info))
{ {
if (! ((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd, (info, h->root.root.root.string, input_bfd,
input_section, rel->r_offset, input_section, rel->r_offset,
(info->unresolved_syms_in_objects == RM_GENERATE_ERROR) (info->unresolved_syms_in_objects == RM_GENERATE_ERROR)
|| ELF_ST_VISIBILITY (h->root.other)))) || ELF_ST_VISIBILITY (h->root.other));
return bfd_reloc_undefined;
relocation = 0; relocation = 0;
} }
} }
@ -2528,16 +2527,14 @@ s7_bfd_score_elf_relocate_section (bfd *output_bfd,
/* If the overflowing reloc was to an undefined symbol, /* If the overflowing reloc was to an undefined symbol,
we have already printed one error message and there we have already printed one error message and there
is no point complaining again. */ is no point complaining again. */
if (((!h) || (h->root.root.type != bfd_link_hash_undefined)) if (!h || h->root.root.type != bfd_link_hash_undefined)
&& (!((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, NULL, name, howto->name, (bfd_vma) 0, (info, NULL, name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset)))) input_bfd, input_section, rel->r_offset);
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE))) (info, name, input_bfd, input_section, rel->r_offset, TRUE);
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -2557,9 +2554,8 @@ s7_bfd_score_elf_relocate_section (bfd *output_bfd,
/* fall through */ /* fall through */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset))) input_section, rel->r_offset);
return FALSE;
break; break;
} }
} }

View file

@ -3952,10 +3952,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
datalabel processing here. Make sure this does not change datalabel processing here. Make sure this does not change
without notice. */ without notice. */
if ((sym->st_other & STO_SH5_ISA32) != 0) if ((sym->st_other & STO_SH5_ISA32) != 0)
((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, (info,
_("Unexpected STO_SH5_ISA32 on local symbol is not handled"), _("Unexpected STO_SH5_ISA32 on local symbol is not handled"),
input_bfd, input_section, rel->r_offset)); input_bfd, input_section, rel->r_offset);
if (sec != NULL && discarded_section (sec)) if (sec != NULL && discarded_section (sec))
/* Handled below. */ /* Handled below. */
@ -4141,14 +4141,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
; ;
else if (!bfd_link_relocatable (info)) else if (!bfd_link_relocatable (info))
{ (*info->callbacks->undefined_symbol)
if (! info->callbacks->undefined_symbol (info, h->root.root.string, input_bfd,
(info, h->root.root.string, input_bfd, input_section, rel->r_offset,
input_section, rel->r_offset, (info->unresolved_syms_in_objects == RM_GENERATE_ERROR
(info->unresolved_syms_in_objects == RM_GENERATE_ERROR || ELF_ST_VISIBILITY (h->other)));
|| ELF_ST_VISIBILITY (h->other))))
return FALSE;
}
} }
if (sec != NULL && discarded_section (sec)) if (sec != NULL && discarded_section (sec))
@ -5520,11 +5517,9 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
if (*name == '\0') if (*name == '\0')
name = bfd_section_name (input_bfd, sec); name = bfd_section_name (input_bfd, sec);
} }
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
} }
break; break;
} }

View file

@ -530,11 +530,9 @@ shmedia_prepare_reloc (struct bfd_link_info *info, bfd *abfd,
&& ((*relocation + rel->r_addend) & 1) == 0) && ((*relocation + rel->r_addend) & 1) == 0)
msg = _("PTA mismatch: a SHcompact address (bit 0 == 0)"); msg = _("PTA mismatch: a SHcompact address (bit 0 == 0)");
if (msg != NULL if (msg != NULL)
&& ! ((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, msg, abfd, input_section, (info, msg, abfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
} }
else else
{ {

View file

@ -4908,12 +4908,11 @@ spu_elf_relocate_section (bfd *output_bfd,
bfd_boolean err; bfd_boolean err;
err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR
|| ELF_ST_VISIBILITY (h->other) != STV_DEFAULT); || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT);
if (!info->callbacks->undefined_symbol (info, (*info->callbacks->undefined_symbol) (info,
h->root.root.string, h->root.root.string,
input_bfd, input_bfd,
input_section, input_section,
rel->r_offset, err)) rel->r_offset, err);
return FALSE;
} }
sym_name = h->root.root.string; sym_name = h->root.root.string;
} }
@ -5050,17 +5049,14 @@ spu_elf_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (!((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), sym_name, howto->name, (info, (h ? &h->root : NULL), sym_name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset))) (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, sym_name, input_bfd, input_section, (info, sym_name, input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -5081,10 +5077,8 @@ spu_elf_relocate_section (bfd *output_bfd,
common_error: common_error:
ret = FALSE; ret = FALSE;
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, msg, sym_name, input_bfd,
(info, msg, sym_name, input_bfd, input_section, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -2719,20 +2719,16 @@ elf32_tic6x_relocate_section (bfd *output_bfd,
/* If the overflowing reloc was to an undefined symbol, /* If the overflowing reloc was to an undefined symbol,
we have already printed one error message and there we have already printed one error message and there
is no point complaining again. */ is no point complaining again. */
if ((! h || if (!h || h->root.type != bfd_link_hash_undefined)
h->root.type != bfd_link_hash_undefined) (*info->callbacks->reloc_overflow)
&& (!((*info->callbacks->reloc_overflow) (info, (h ? &h->root : NULL), name, howto->name,
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
(bfd_vma) 0, input_bfd, input_section,
rel->r_offset))))
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol) (info, name, input_bfd,
(info, name, input_bfd, input_section, input_section,
rel->r_offset, TRUE))) rel->r_offset, TRUE);
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -2753,10 +2749,8 @@ elf32_tic6x_relocate_section (bfd *output_bfd,
common_error: common_error:
BFD_ASSERT (error_message != NULL); BFD_ASSERT (error_message != NULL);
if (!((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, error_message, input_bfd, input_section, (info, error_message, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -3657,15 +3657,14 @@ tilepro_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
TRUE);
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -3686,11 +3685,8 @@ tilepro_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -2271,18 +2271,14 @@ v850_elf_relocate_section (bfd *output_bfd,
switch ((int) r) switch ((int) r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -2314,10 +2310,8 @@ v850_elf_relocate_section (bfd *output_bfd,
/* fall through */ /* fall through */
common_error: common_error:
if (!((*info->callbacks->warning) (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -1738,11 +1738,9 @@ elf_vax_relocate_section (bfd *output_bfd,
if (*name == '\0') if (*name == '\0')
name = bfd_section_name (input_bfd, sec); name = bfd_section_name (input_bfd, sec);
} }
if (!(info->callbacks->reloc_overflow info->callbacks->reloc_overflow
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
} }
break; break;
} }

View file

@ -662,13 +662,13 @@ visium_elf_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset); input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE); (info, name, input_bfd, input_section, rel->r_offset, TRUE);
break; break;
@ -690,11 +690,8 @@ visium_elf_relocate_section (bfd *output_bfd,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (!r)
return FALSE;
} }
} }

View file

@ -920,15 +920,14 @@ xstormy16_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNU
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
TRUE);
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -949,11 +948,8 @@ xstormy16_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNU
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -2702,12 +2702,10 @@ elf_xtensa_relocate_section (bfd *output_bfd,
r = contract_asm_expansion (contents, input_size, rel, r = contract_asm_expansion (contents, input_size, rel,
&error_message); &error_message);
if (r != bfd_reloc_ok) if (r != bfd_reloc_ok)
{ (*info->callbacks->reloc_dangerous)
if (!((*info->callbacks->reloc_dangerous) (info, error_message,
(info, error_message, input_bfd, input_section, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
}
r_type = ELF32_R_TYPE (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info);
} }
@ -2759,12 +2757,9 @@ elf_xtensa_relocate_section (bfd *output_bfd,
} }
} }
if (r != bfd_reloc_ok) if (r != bfd_reloc_ok)
{ (*info->callbacks->reloc_dangerous)
if (!((*info->callbacks->reloc_dangerous) (info, error_message,
(info, error_message, input_bfd, input_section, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
}
/* Done with work for relocatable link; continue with next reloc. */ /* Done with work for relocatable link; continue with next reloc. */
continue; continue;
@ -2864,10 +2859,9 @@ elf_xtensa_relocate_section (bfd *output_bfd,
{ {
error_message = error_message =
_("dynamic relocation in read-only section"); _("dynamic relocation in read-only section");
if (!((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, error_message, input_bfd, input_section, (info, error_message,
rel->r_offset))) input_bfd, input_section, rel->r_offset);
return FALSE;
} }
if (dynamic_symbol) if (dynamic_symbol)
@ -2961,10 +2955,9 @@ elf_xtensa_relocate_section (bfd *output_bfd,
{ {
error_message = error_message =
_("TLS relocation invalid without dynamic sections"); _("TLS relocation invalid without dynamic sections");
if (!((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, error_message, input_bfd, input_section, (info, error_message,
rel->r_offset))) input_bfd, input_section, rel->r_offset);
return FALSE;
} }
else else
{ {
@ -2985,10 +2978,9 @@ elf_xtensa_relocate_section (bfd *output_bfd,
{ {
error_message = error_message =
_("dynamic relocation in read-only section"); _("dynamic relocation in read-only section");
if (!((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, error_message, input_bfd, input_section, (info, error_message,
rel->r_offset))) input_bfd, input_section, rel->r_offset);
return FALSE;
} }
indx = h && h->dynindx != -1 ? h->dynindx : 0; indx = h && h->dynindx != -1 ? h->dynindx : 0;
@ -3030,12 +3022,9 @@ elf_xtensa_relocate_section (bfd *output_bfd,
(h && elf_xtensa_hash_entry (h) == htab->tlsbase); (h && elf_xtensa_hash_entry (h) == htab->tlsbase);
if (! replace_tls_insn (rel, input_bfd, input_section, contents, if (! replace_tls_insn (rel, input_bfd, input_section, contents,
is_ld_model, &error_message)) is_ld_model, &error_message))
{ (*info->callbacks->reloc_dangerous)
if (!((*info->callbacks->reloc_dangerous) (info, error_message,
(info, error_message, input_bfd, input_section, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
}
if (r_type != R_XTENSA_TLS_ARG || is_ld_model) if (r_type != R_XTENSA_TLS_ARG || is_ld_model)
{ {
@ -3054,10 +3043,8 @@ elf_xtensa_relocate_section (bfd *output_bfd,
error_message = error_message =
vsprint_msg ("invalid relocation for dynamic symbol", ": %s", vsprint_msg ("invalid relocation for dynamic symbol", ": %s",
strlen (name) + 2, name); strlen (name) + 2, name);
if (!((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, error_message, input_bfd, input_section, (info, error_message, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
continue; continue;
} }
break; break;
@ -3105,10 +3092,8 @@ elf_xtensa_relocate_section (bfd *output_bfd,
strlen (name) + 22, strlen (name) + 22,
name, (int) rel->r_addend); name, (int) rel->r_addend);
if (!((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, error_message, input_bfd, input_section, (info, error_message, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
} }
} }

View file

@ -4825,11 +4825,9 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
if (*name == '\0') if (*name == '\0')
name = bfd_section_name (input_bfd, sec); name = bfd_section_name (input_bfd, sec);
} }
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root.root : NULL), name, howto->name, (info, (h ? &h->root.root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
ret_val = FALSE;
} }
break; break;

View file

@ -3908,12 +3908,11 @@ elf64_hppa_relocate_section (bfd *output_bfd,
bfd_boolean err; bfd_boolean err;
err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR
|| ELF_ST_VISIBILITY (eh->other) != STV_DEFAULT); || ELF_ST_VISIBILITY (eh->other) != STV_DEFAULT);
if (!info->callbacks->undefined_symbol (info, (*info->callbacks->undefined_symbol) (info,
eh->root.root.string, eh->root.root.string,
input_bfd, input_bfd,
input_section, input_section,
rel->r_offset, err)) rel->r_offset, err);
return FALSE;
} }
if (!bfd_link_relocatable (info) if (!bfd_link_relocatable (info)
@ -3925,12 +3924,9 @@ elf64_hppa_relocate_section (bfd *output_bfd,
if (info->unresolved_syms_in_objects == RM_IGNORE if (info->unresolved_syms_in_objects == RM_IGNORE
&& ELF_ST_VISIBILITY (eh->other) == STV_DEFAULT && ELF_ST_VISIBILITY (eh->other) == STV_DEFAULT
&& eh->type == STT_PARISC_MILLI) && eh->type == STT_PARISC_MILLI)
{ (*info->callbacks->undefined_symbol)
if (! info->callbacks->undefined_symbol (info, eh_name (eh), input_bfd,
(info, eh_name (eh), input_bfd, input_section, rel->r_offset, FALSE);
input_section, rel->r_offset, FALSE))
return FALSE;
}
} }
} }
@ -3969,11 +3965,9 @@ elf64_hppa_relocate_section (bfd *output_bfd,
sym_name = bfd_section_name (input_bfd, sym_sec); sym_name = bfd_section_name (input_bfd, sym_sec);
} }
if (!((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (eh ? &eh->root : NULL), sym_name, (info, (eh ? &eh->root : NULL), sym_name, howto->name,
howto->name, (bfd_vma) 0, input_bfd, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
input_section, rel->r_offset)))
return FALSE;
} }
break; break;
} }

View file

@ -3902,10 +3902,9 @@ elf64_ia64_relocate_section (bfd *output_bfd,
else else
name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym,
sym_sec); sym_sec);
if (!(*info->callbacks->warning) (info, _("unsupported reloc"), (*info->callbacks->warning) (info, _("unsupported reloc"),
name, input_bfd, name, input_bfd,
input_section, rel->r_offset)) input_section, rel->r_offset);
return FALSE;
ret_val = FALSE; ret_val = FALSE;
} }
break; break;
@ -3960,15 +3959,14 @@ elf64_ia64_relocate_section (bfd *output_bfd,
break; break;
} }
default: default:
if (!(*info->callbacks->reloc_overflow) (info, (*info->callbacks->reloc_overflow) (info,
&h->root, &h->root,
name, name,
howto->name, howto->name,
(bfd_vma) 0, (bfd_vma) 0,
input_bfd, input_bfd,
input_section, input_section,
rel->r_offset)) rel->r_offset);
return FALSE;
break; break;
} }

View file

@ -1516,13 +1516,12 @@ mmix_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
if (r != bfd_reloc_ok) if (r != bfd_reloc_ok)
{ {
bfd_boolean check_ok = TRUE;
const char * msg = (const char *) NULL; const char * msg = (const char *) NULL;
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
check_ok = info->callbacks->reloc_overflow info->callbacks->reloc_overflow
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
@ -1530,9 +1529,8 @@ mmix_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
case bfd_reloc_undefined: case bfd_reloc_undefined:
/* We may have sent this message above. */ /* We may have sent this message above. */
if (! undefined_signalled) if (! undefined_signalled)
check_ok = info->callbacks->undefined_symbol info->callbacks->undefined_symbol
(info, name, input_bfd, input_section, rel->r_offset, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
TRUE);
undefined_signalled = TRUE; undefined_signalled = TRUE;
break; break;
@ -1554,11 +1552,8 @@ mmix_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
} }
if (msg) if (msg)
check_ok = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! check_ok)
return FALSE;
} }
} }

View file

@ -15144,13 +15144,11 @@ ppc64_elf_relocate_section (bfd *output_bfd,
&& (h->elf.root.type == bfd_link_hash_undefweak && (h->elf.root.type == bfd_link_hash_undefweak
|| h->elf.root.type == bfd_link_hash_undefined) || h->elf.root.type == bfd_link_hash_undefined)
&& is_branch_reloc (r_type)))) && is_branch_reloc (r_type))))
{ info->callbacks->reloc_overflow (info, &h->elf.root,
if (!((*info->callbacks->reloc_overflow) sym_name, reloc_name,
(info, &h->elf.root, sym_name, orig_rel.r_addend,
reloc_name, orig_rel.r_addend, input_bfd, input_section,
input_bfd, input_section, rel->r_offset))) rel->r_offset);
return FALSE;
}
} }
else else
{ {

View file

@ -3357,14 +3357,9 @@ elf_s390_relocate_section (bfd *output_bfd,
} }
if (r == bfd_reloc_overflow) if (r == bfd_reloc_overflow)
{ (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name,
if (! ((*info->callbacks->reloc_overflow) (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
(info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section,
rel->r_offset)))
return FALSE;
}
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)

View file

@ -1508,10 +1508,10 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
datalabel processing here. Make sure this does not change datalabel processing here. Make sure this does not change
without notice. */ without notice. */
if ((sym->st_other & STO_SH5_ISA32) != 0) if ((sym->st_other & STO_SH5_ISA32) != 0)
((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, (info,
_("Unexpected STO_SH5_ISA32 on local symbol is not handled"), _("Unexpected STO_SH5_ISA32 on local symbol is not handled"),
input_bfd, input_section, rel->r_offset)); input_bfd, input_section, rel->r_offset);
if (sec != NULL && discarded_section (sec)) if (sec != NULL && discarded_section (sec))
/* Handled below. */ /* Handled below. */
@ -1650,14 +1650,11 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
; ;
else if (!bfd_link_relocatable (info)) else if (!bfd_link_relocatable (info))
{ (*info->callbacks->undefined_symbol)
if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd,
(info, h->root.root.string, input_bfd, input_section, rel->r_offset,
input_section, rel->r_offset, (info->unresolved_syms_in_objects == RM_GENERATE_ERROR
(info->unresolved_syms_in_objects == RM_GENERATE_ERROR || ELF_ST_VISIBILITY (h->other)));
|| ELF_ST_VISIBILITY (h->other)))))
return FALSE;
}
} }
if (sec != NULL && discarded_section (sec)) if (sec != NULL && discarded_section (sec))
@ -2081,11 +2078,9 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
if (*name == '\0') if (*name == '\0')
name = bfd_section_name (input_bfd, sec); name = bfd_section_name (input_bfd, sec);
} }
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
} }
break; break;
} }

View file

@ -5372,13 +5372,9 @@ check_relocation_error:
} }
if (r == bfd_reloc_overflow) if (r == bfd_reloc_overflow)
{ (*info->callbacks->reloc_overflow)
if (! ((*info->callbacks->reloc_overflow) (info, (h ? &h->root : NULL), name, howto->name,
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
(bfd_vma) 0, input_bfd, input_section,
rel->r_offset)))
return FALSE;
}
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)

View file

@ -1481,10 +1481,8 @@ _bfd_elf_merge_symbol (bfd *abfd,
the old symbol override the new one as normally happens with the old symbol override the new one as normally happens with
symbols defined in dynamic objects. */ symbols defined in dynamic objects. */
if (! ((*info->callbacks->multiple_common) (*info->callbacks->multiple_common) (info, &h->root, abfd,
(info, &h->root, abfd, bfd_link_hash_common, sym->st_size))) bfd_link_hash_common, sym->st_size);
return FALSE;
if (sym->st_size > h->size) if (sym->st_size > h->size)
h->size = sym->st_size; h->size = sym->st_size;
@ -1642,9 +1640,8 @@ _bfd_elf_merge_symbol (bfd *abfd,
/* It would be best if we could set the hash table entry to a /* It would be best if we could set the hash table entry to a
common symbol, but we don't know what to use for the section common symbol, but we don't know what to use for the section
or the alignment. */ or the alignment. */
if (! ((*info->callbacks->multiple_common) (*info->callbacks->multiple_common) (info, &h->root, abfd,
(info, &h->root, abfd, bfd_link_hash_common, sym->st_size))) bfd_link_hash_common, sym->st_size);
return FALSE;
/* If the presumed common symbol in the dynamic object is /* If the presumed common symbol in the dynamic object is
larger, pretend that the new symbol has its size. */ larger, pretend that the new symbol has its size. */
@ -9235,19 +9232,11 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
&& (!h->ref_regular || flinfo->info->gc_sections) && (!h->ref_regular || flinfo->info->gc_sections)
&& !elf_link_check_versioned_symbol (flinfo->info, bed, h) && !elf_link_check_versioned_symbol (flinfo->info, bed, h)
&& flinfo->info->unresolved_syms_in_shared_libs != RM_IGNORE) && flinfo->info->unresolved_syms_in_shared_libs != RM_IGNORE)
{ (*flinfo->info->callbacks->undefined_symbol)
if (!(flinfo->info->callbacks->undefined_symbol (flinfo->info, h->root.root.string,
(flinfo->info, h->root.root.string, h->ref_regular ? NULL : h->root.u.undef.abfd,
h->ref_regular ? NULL : h->root.u.undef.abfd, NULL, 0,
NULL, 0, flinfo->info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR);
(flinfo->info->unresolved_syms_in_shared_libs
== RM_GENERATE_ERROR))))
{
bfd_set_error (bfd_error_bad_value);
eoinfo->failed = TRUE;
return FALSE;
}
}
/* Strip a global symbol defined in a discarded section. */ /* Strip a global symbol defined in a discarded section. */
if (h->indx == -3) if (h->indx == -3)
@ -10761,9 +10750,8 @@ elf_reloc_link_order (bfd *output_bfd,
} }
else else
{ {
if (! ((*info->callbacks->unattached_reloc) (*info->callbacks->unattached_reloc)
(info, link_order->u.reloc.p->u.name, NULL, NULL, 0))) (info, link_order->u.reloc.p->u.name, NULL, NULL, 0);
return FALSE;
indx = 0; indx = 0;
} }
} }
@ -10798,13 +10786,9 @@ elf_reloc_link_order (bfd *output_bfd,
link_order->u.reloc.p->u.section); link_order->u.reloc.p->u.section);
else else
sym_name = link_order->u.reloc.p->u.name; sym_name = link_order->u.reloc.p->u.name;
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow) (info, NULL, sym_name,
(info, NULL, sym_name, howto->name, addend, NULL, howto->name, addend, NULL, NULL,
NULL, (bfd_vma) 0))) (bfd_vma) 0);
{
free (buf);
return FALSE;
}
break; break;
} }

View file

@ -6063,13 +6063,10 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
if (r_type != R_AARCH64_NONE && r_type != R_AARCH64_NULL if (r_type != R_AARCH64_NONE && r_type != R_AARCH64_NULL
&& bfd_is_und_section (sec) && bfd_is_und_section (sec)
&& ELF_ST_BIND (sym->st_info) != STB_WEAK) && ELF_ST_BIND (sym->st_info) != STB_WEAK)
{ (*info->callbacks->undefined_symbol)
if (!info->callbacks->undefined_symbol (info, bfd_elf_string_from_elf_section
(info, bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name),
(input_bfd, symtab_hdr->sh_link, sym->st_name), input_bfd, input_section, rel->r_offset, TRUE);
input_bfd, input_section, rel->r_offset, TRUE))
return FALSE;
}
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
@ -6411,10 +6408,9 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (!(*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset)) input_bfd, input_section, rel->r_offset);
return FALSE;
if (real_r_type == BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15 if (real_r_type == BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15
|| real_r_type == BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14) || real_r_type == BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14)
{ {
@ -6456,10 +6452,8 @@ alignment than was declared where it was defined."),
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
rel->r_offset, TRUE)))
return FALSE;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -6480,10 +6474,8 @@ alignment than was declared where it was defined."),
common_error: common_error:
BFD_ASSERT (error_message != NULL); BFD_ASSERT (error_message != NULL);
if (!((*info->callbacks->reloc_dangerous) (*info->callbacks->reloc_dangerous)
(info, error_message, input_bfd, input_section, (info, error_message, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
break; break;
} }
} }

View file

@ -4428,10 +4428,9 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
else else
name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym,
sym_sec); sym_sec);
if (!(*info->callbacks->warning) (info, _("unsupported reloc"), (*info->callbacks->warning) (info, _("unsupported reloc"),
name, input_bfd, name, input_bfd,
input_section, rel->r_offset)) input_section, rel->r_offset);
return FALSE;
ret_val = FALSE; ret_val = FALSE;
} }
break; break;
@ -4487,15 +4486,14 @@ missing_tls_sec:
break; break;
} }
default: default:
if (!(*info->callbacks->reloc_overflow) (info, (*info->callbacks->reloc_overflow) (info,
&h->root, &h->root,
name, name,
howto->name, howto->name,
(bfd_vma) 0, (bfd_vma) 0,
input_bfd, input_bfd,
input_section, input_section,
rel->r_offset)) rel->r_offset);
return FALSE;
break; break;
} }

View file

@ -5410,17 +5410,14 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf */ http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf */
symbol = 0; symbol = 0;
} }
else if ((*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
input_section, relocation->r_offset,
(info->unresolved_syms_in_objects == RM_GENERATE_ERROR)
|| ELF_ST_VISIBILITY (h->root.other)))
{
return bfd_reloc_undefined;
}
else else
{ {
return bfd_reloc_notsupported; (*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
input_section, relocation->r_offset,
(info->unresolved_syms_in_objects == RM_GENERATE_ERROR)
|| ELF_ST_VISIBILITY (h->root.other));
return bfd_reloc_undefined;
} }
target_is_16_bit_code_p = ELF_ST_IS_MIPS16 (h->root.other); target_is_16_bit_code_p = ELF_ST_IS_MIPS16 (h->root.other);
@ -10250,10 +10247,9 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
htab->small_data_overflow_reported = TRUE; htab->small_data_overflow_reported = TRUE;
(*info->callbacks->einfo) ("%P: %s\n", msg); (*info->callbacks->einfo) ("%P: %s\n", msg);
} }
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, NULL, name, howto->name, (bfd_vma) 0, (info, NULL, name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset))) input_bfd, input_section, rel->r_offset);
return FALSE;
} }
break; break;
@ -12929,25 +12925,22 @@ _bfd_elf_mips_get_relocated_section_contents
switch (r) switch (r)
{ {
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*link_info->callbacks->undefined_symbol) (*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr), (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
input_bfd, input_section, (*parent)->address, TRUE))) input_bfd, input_section, (*parent)->address, TRUE);
goto error_return;
break; break;
case bfd_reloc_dangerous: case bfd_reloc_dangerous:
BFD_ASSERT (error_message != NULL); BFD_ASSERT (error_message != NULL);
if (!((*link_info->callbacks->reloc_dangerous) (*link_info->callbacks->reloc_dangerous)
(link_info, error_message, input_bfd, input_section, (link_info, error_message,
(*parent)->address))) input_bfd, input_section, (*parent)->address);
goto error_return;
break; break;
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (!((*link_info->callbacks->reloc_overflow) (*link_info->callbacks->reloc_overflow)
(link_info, NULL, (link_info, NULL,
bfd_asymbol_name (*(*parent)->sym_ptr_ptr), bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
(*parent)->howto->name, (*parent)->addend, (*parent)->howto->name, (*parent)->addend,
input_bfd, input_section, (*parent)->address))) input_bfd, input_section, (*parent)->address);
goto error_return;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
default: default:

View file

@ -4199,11 +4199,9 @@ do_relocation:
if (*name == '\0') if (*name == '\0')
name = bfd_section_name (input_bfd, sec); name = bfd_section_name (input_bfd, sec);
} }
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
rel->r_offset)))
return FALSE;
} }
break; break;
} }

View file

@ -4044,15 +4044,14 @@ tilegx_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
switch (r) switch (r)
{ {
case bfd_reloc_overflow: case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name, (info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset); (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break; break;
case bfd_reloc_undefined: case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, (info, name, input_bfd, input_section, rel->r_offset, TRUE);
TRUE);
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
@ -4073,11 +4072,8 @@ tilegx_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
} }
if (msg) if (msg)
r = info->callbacks->warning (*info->callbacks->warning) (info, msg, name, input_bfd,
(info, msg, name, input_bfd, input_section, rel->r_offset); input_section, rel->r_offset);
if (! r)
return FALSE;
} }
} }

View file

@ -1544,9 +1544,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
/* We have found a definition for a symbol which was /* We have found a definition for a symbol which was
previously common. */ previously common. */
BFD_ASSERT (h->type == bfd_link_hash_common); BFD_ASSERT (h->type == bfd_link_hash_common);
if (! ((*info->callbacks->multiple_common) (*info->callbacks->multiple_common) (info, h, abfd,
(info, h, abfd, bfd_link_hash_defined, 0))) bfd_link_hash_defined, 0);
return FALSE;
/* Fall through. */ /* Fall through. */
case DEF: case DEF:
case DEFW: case DEFW:
@ -1603,10 +1602,9 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
if (oldtype == bfd_link_hash_defweak) if (oldtype == bfd_link_hash_defweak)
abort (); abort ();
if (! ((*info->callbacks->constructor) (*info->callbacks->constructor) (info, c == 'I',
(info, c == 'I', h->root.string, abfd,
h->root.string, abfd, section, value))) section, value);
return FALSE;
} }
} }
} }
@ -1675,9 +1673,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
already had a common definition. Use the maximum of the already had a common definition. Use the maximum of the
two sizes, and use the section required by the larger symbol. */ two sizes, and use the section required by the larger symbol. */
BFD_ASSERT (h->type == bfd_link_hash_common); BFD_ASSERT (h->type == bfd_link_hash_common);
if (! ((*info->callbacks->multiple_common) (*info->callbacks->multiple_common) (info, h, abfd,
(info, h, abfd, bfd_link_hash_common, value))) bfd_link_hash_common, value);
return FALSE;
if (value > h->u.c.size) if (value > h->u.c.size)
{ {
unsigned int power; unsigned int power;
@ -1715,9 +1712,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
case CREF: case CREF:
/* We have found a common definition for a symbol which /* We have found a common definition for a symbol which
was already defined. */ was already defined. */
if (! ((*info->callbacks->multiple_common) (*info->callbacks->multiple_common) (info, h, abfd,
(info, h, abfd, bfd_link_hash_common, value))) bfd_link_hash_common, value);
return FALSE;
break; break;
case MIND: case MIND:
@ -1728,17 +1724,15 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
/* Fall through. */ /* Fall through. */
case MDEF: case MDEF:
/* Handle a multiple definition. */ /* Handle a multiple definition. */
if (! ((*info->callbacks->multiple_definition) (*info->callbacks->multiple_definition) (info, h,
(info, h, abfd, section, value))) abfd, section, value);
return FALSE;
break; break;
case CIND: case CIND:
/* Create an indirect symbol from an existing common symbol. */ /* Create an indirect symbol from an existing common symbol. */
BFD_ASSERT (h->type == bfd_link_hash_common); BFD_ASSERT (h->type == bfd_link_hash_common);
if (! ((*info->callbacks->multiple_common) (*info->callbacks->multiple_common) (info, h, abfd,
(info, h, abfd, bfd_link_hash_indirect, 0))) bfd_link_hash_indirect, 0);
return FALSE;
/* Fall through. */ /* Fall through. */
case IND: case IND:
if (inh->type == bfd_link_hash_indirect if (inh->type == bfd_link_hash_indirect
@ -1779,9 +1773,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
case SET: case SET:
/* Add an entry to a set. */ /* Add an entry to a set. */
if (! (*info->callbacks->add_to_set) (info, h, BFD_RELOC_CTOR, (*info->callbacks->add_to_set) (info, h, BFD_RELOC_CTOR,
abfd, section, value)) abfd, section, value);
return FALSE;
break; break;
case WARNC: case WARNC:
@ -1790,10 +1783,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
if (h->u.i.warning != NULL if (h->u.i.warning != NULL
&& (abfd->flags & BFD_PLUGIN) == 0) && (abfd->flags & BFD_PLUGIN) == 0)
{ {
if (! (*info->callbacks->warning) (info, h->u.i.warning, (*info->callbacks->warning) (info, h->u.i.warning,
h->root.string, abfd, h->root.string, abfd, NULL, 0);
NULL, 0))
return FALSE;
/* Only issue a warning once. */ /* Only issue a warning once. */
h->u.i.warning = NULL; h->u.i.warning = NULL;
} }
@ -1819,9 +1810,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
&& (h->u.undef.next != NULL || info->hash->undefs_tail == h)) && (h->u.undef.next != NULL || info->hash->undefs_tail == h))
|| h->non_ir_ref) || h->non_ir_ref)
{ {
if (! (*info->callbacks->warning) (info, string, h->root.string, (*info->callbacks->warning) (info, string, h->root.string,
hash_entry_bfd (h), NULL, 0)) hash_entry_bfd (h), NULL, 0);
return FALSE;
break; break;
} }
/* Fall through. */ /* Fall through. */
@ -2412,9 +2402,8 @@ _bfd_generic_reloc_link_order (bfd *abfd,
if (h == NULL if (h == NULL
|| ! h->written) || ! h->written)
{ {
if (! ((*info->callbacks->unattached_reloc) (*info->callbacks->unattached_reloc)
(info, link_order->u.reloc.p->u.name, NULL, NULL, 0))) (info, link_order->u.reloc.p->u.name, NULL, NULL, 0);
return FALSE;
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -2448,17 +2437,13 @@ _bfd_generic_reloc_link_order (bfd *abfd,
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
abort (); abort ();
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow) (*info->callbacks->reloc_overflow)
(info, NULL, (info, NULL,
(link_order->type == bfd_section_reloc_link_order (link_order->type == bfd_section_reloc_link_order
? bfd_section_name (abfd, link_order->u.reloc.p->u.section) ? bfd_section_name (abfd, link_order->u.reloc.p->u.section)
: link_order->u.reloc.p->u.name), : link_order->u.reloc.p->u.name),
r->howto->name, link_order->u.reloc.p->addend, r->howto->name, link_order->u.reloc.p->addend,
NULL, NULL, 0))) NULL, NULL, 0);
{
free (buf);
return FALSE;
}
break; break;
} }
loc = link_order->offset * bfd_octets_per_byte (abfd); loc = link_order->offset * bfd_octets_per_byte (abfd);

View file

@ -3070,9 +3070,8 @@ aout_link_reloc_link_order (struct aout_final_link_info *flaginfo,
} }
else else
{ {
if (! ((*flaginfo->info->callbacks->unattached_reloc) (*flaginfo->info->callbacks->unattached_reloc)
(flaginfo->info, pr->u.name, NULL, NULL, (bfd_vma) 0))) (flaginfo->info, pr->u.name, NULL, NULL, (bfd_vma) 0);
return FALSE;
r_index = 0; r_index = 0;
} }
} }
@ -3167,18 +3166,14 @@ aout_link_reloc_link_order (struct aout_final_link_info *flaginfo,
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
abort (); abort ();
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*flaginfo->info->callbacks->reloc_overflow) (*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, NULL, (flaginfo->info, NULL,
(p->type == bfd_section_reloc_link_order (p->type == bfd_section_reloc_link_order
? bfd_section_name (flaginfo->output_bfd, ? bfd_section_name (flaginfo->output_bfd,
pr->u.section) pr->u.section)
: pr->u.name), : pr->u.name),
howto->name, pr->addend, NULL, howto->name, pr->addend, NULL,
(asection *) NULL, (bfd_vma) 0))) (asection *) NULL, (bfd_vma) 0);
{
free (buf);
return FALSE;
}
break; break;
} }
ok = bfd_set_section_contents (flaginfo->output_bfd, o, ok = bfd_set_section_contents (flaginfo->output_bfd, o,
@ -3355,10 +3350,9 @@ pdp11_aout_link_input_section (struct aout_final_link_info *flaginfo,
name = strings + GET_WORD (input_bfd, name = strings + GET_WORD (input_bfd,
syms[r_index].e_strx); syms[r_index].e_strx);
if (! ((*flaginfo->info->callbacks->unattached_reloc) (*flaginfo->info->callbacks->unattached_reloc)
(flaginfo->info, name, input_bfd, input_section, (flaginfo->info, name, input_bfd, input_section,
r_addr))) r_addr);
return FALSE;
r_index = 0; r_index = 0;
} }
} }
@ -3469,10 +3463,9 @@ pdp11_aout_link_input_section (struct aout_final_link_info *flaginfo,
name = h->root.root.string; name = h->root.root.string;
else else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx); name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
if (! ((*flaginfo->info->callbacks->undefined_symbol) (*flaginfo->info->callbacks->undefined_symbol)
(flaginfo->info, name, input_bfd, input_section, (flaginfo->info, name, input_bfd, input_section,
r_addr, TRUE))) r_addr, TRUE);
return FALSE;
} }
r = MY_final_link_relocate (howto, r = MY_final_link_relocate (howto,
@ -3504,11 +3497,9 @@ pdp11_aout_link_input_section (struct aout_final_link_info *flaginfo,
s = aout_reloc_type_to_section (input_bfd, r_type); s = aout_reloc_type_to_section (input_bfd, r_type);
name = bfd_section_name (input_bfd, s); name = bfd_section_name (input_bfd, s);
} }
if (! ((*flaginfo->info->callbacks->reloc_overflow) (*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, (h ? &h->root : NULL), name, (flaginfo->info, (h ? &h->root : NULL), name, howto->name,
howto->name, (bfd_vma) 0, input_bfd, (bfd_vma) 0, input_bfd, input_section, r_addr);
input_section, r_addr)))
return FALSE;
} }
break; break;
} }

View file

@ -702,12 +702,9 @@ coff_pe_mips_relocate_section (bfd *output_bfd,
} }
else if (! bfd_link_relocatable (info)) else if (! bfd_link_relocatable (info))
{ (*info->callbacks->undefined_symbol)
if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section,
(info, h->root.root.string, input_bfd, input_section, rel->r_vaddr - input_section->vma, TRUE);
rel->r_vaddr - input_section->vma, TRUE)))
return FALSE;
}
} }
src = rel->r_vaddr + input_section->output_section->vma src = rel->r_vaddr + input_section->output_section->vma

View file

@ -8001,26 +8001,22 @@ bfd_generic_get_relocated_section_contents (bfd *abfd,
switch (r) switch (r)
{ {
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (!((*link_info->callbacks->undefined_symbol) (*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr), (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
input_bfd, input_section, (*parent)->address, input_bfd, input_section, (*parent)->address, TRUE);
TRUE)))
goto error_return;
break; break;
case bfd_reloc_dangerous: case bfd_reloc_dangerous:
BFD_ASSERT (error_message != NULL); BFD_ASSERT (error_message != NULL);
if (!((*link_info->callbacks->reloc_dangerous) (*link_info->callbacks->reloc_dangerous)
(link_info, error_message, input_bfd, input_section, (link_info, error_message,
(*parent)->address))) input_bfd, input_section, (*parent)->address);
goto error_return;
break; break;
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (!((*link_info->callbacks->reloc_overflow) (*link_info->callbacks->reloc_overflow)
(link_info, NULL, (link_info, NULL,
bfd_asymbol_name (*(*parent)->sym_ptr_ptr), bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
(*parent)->howto->name, (*parent)->addend, (*parent)->howto->name, (*parent)->addend,
input_bfd, input_section, (*parent)->address))) input_bfd, input_section, (*parent)->address);
goto error_return;
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
/* PR ld/13730: /* PR ld/13730:

View file

@ -80,11 +80,9 @@ bfd_coff_reloc16_get_value (arelent *reloc,
value = 0; value = 0;
else else
{ {
if (!((*link_info->callbacks->undefined_symbol) (*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (symbol), (link_info, bfd_asymbol_name (symbol),
input_section->owner, input_section, reloc->address, input_section->owner, input_section, reloc->address, TRUE);
TRUE)))
abort ();
value = 0; value = 0;
} }
} }

View file

@ -24,7 +24,7 @@
#include "libbfd.h" #include "libbfd.h"
#include "bfdlink.h" #include "bfdlink.h"
static bfd_boolean static void
simple_dummy_warning (struct bfd_link_info *link_info ATTRIBUTE_UNUSED, simple_dummy_warning (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
const char *warning ATTRIBUTE_UNUSED, const char *warning ATTRIBUTE_UNUSED,
const char *symbol ATTRIBUTE_UNUSED, const char *symbol ATTRIBUTE_UNUSED,
@ -32,10 +32,9 @@ simple_dummy_warning (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
asection *section ATTRIBUTE_UNUSED, asection *section ATTRIBUTE_UNUSED,
bfd_vma address ATTRIBUTE_UNUSED) bfd_vma address ATTRIBUTE_UNUSED)
{ {
return TRUE;
} }
static bfd_boolean static void
simple_dummy_undefined_symbol (struct bfd_link_info *link_info ATTRIBUTE_UNUSED, simple_dummy_undefined_symbol (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED, const char *name ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED, bfd *abfd ATTRIBUTE_UNUSED,
@ -43,10 +42,9 @@ simple_dummy_undefined_symbol (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
bfd_vma address ATTRIBUTE_UNUSED, bfd_vma address ATTRIBUTE_UNUSED,
bfd_boolean fatal ATTRIBUTE_UNUSED) bfd_boolean fatal ATTRIBUTE_UNUSED)
{ {
return TRUE;
} }
static bfd_boolean static void
simple_dummy_reloc_overflow (struct bfd_link_info *link_info ATTRIBUTE_UNUSED, simple_dummy_reloc_overflow (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
struct bfd_link_hash_entry *entry ATTRIBUTE_UNUSED, struct bfd_link_hash_entry *entry ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED, const char *name ATTRIBUTE_UNUSED,
@ -56,37 +54,33 @@ simple_dummy_reloc_overflow (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
asection *section ATTRIBUTE_UNUSED, asection *section ATTRIBUTE_UNUSED,
bfd_vma address ATTRIBUTE_UNUSED) bfd_vma address ATTRIBUTE_UNUSED)
{ {
return TRUE;
} }
static bfd_boolean static void
simple_dummy_reloc_dangerous (struct bfd_link_info *link_info ATTRIBUTE_UNUSED, simple_dummy_reloc_dangerous (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
const char *message ATTRIBUTE_UNUSED, const char *message ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED, bfd *abfd ATTRIBUTE_UNUSED,
asection *section ATTRIBUTE_UNUSED, asection *section ATTRIBUTE_UNUSED,
bfd_vma address ATTRIBUTE_UNUSED) bfd_vma address ATTRIBUTE_UNUSED)
{ {
return TRUE;
} }
static bfd_boolean static void
simple_dummy_unattached_reloc (struct bfd_link_info *link_info ATTRIBUTE_UNUSED, simple_dummy_unattached_reloc (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED, const char *name ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED, bfd *abfd ATTRIBUTE_UNUSED,
asection *section ATTRIBUTE_UNUSED, asection *section ATTRIBUTE_UNUSED,
bfd_vma address ATTRIBUTE_UNUSED) bfd_vma address ATTRIBUTE_UNUSED)
{ {
return TRUE;
} }
static bfd_boolean static void
simple_dummy_multiple_definition (struct bfd_link_info *link_info ATTRIBUTE_UNUSED, simple_dummy_multiple_definition (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
struct bfd_link_hash_entry *h ATTRIBUTE_UNUSED, struct bfd_link_hash_entry *h ATTRIBUTE_UNUSED,
bfd *nbfd ATTRIBUTE_UNUSED, bfd *nbfd ATTRIBUTE_UNUSED,
asection *nsec ATTRIBUTE_UNUSED, asection *nsec ATTRIBUTE_UNUSED,
bfd_vma nval ATTRIBUTE_UNUSED) bfd_vma nval ATTRIBUTE_UNUSED)
{ {
return TRUE;
} }
static void static void

View file

@ -1641,9 +1641,8 @@ _bfd_vms_get_value (bfd *abfd, const unsigned char *ascic,
*vma = 0; *vma = 0;
else else
{ {
if (!(*info->callbacks->undefined_symbol) (*info->callbacks->undefined_symbol)
(info, name, abfd, PRIV (image_section), PRIV (image_offset), TRUE)) (info, name, abfd, PRIV (image_section), PRIV (image_offset), TRUE);
abort ();
*vma = 0; *vma = 0;
} }
} }

View file

@ -1992,9 +1992,10 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
sure the XCOFF linker is wholly prepared to sure the XCOFF linker is wholly prepared to
handle them, and that would only be a warning, handle them, and that would only be a warning,
not an error. */ not an error. */
if (! ((*info->callbacks->multiple_definition) (*info->callbacks->multiple_definition) (info,
(info, &(*sym_hash)->root, NULL, NULL, (bfd_vma) 0))) &(*sym_hash)->root,
goto error_return; NULL, NULL,
(bfd_vma) 0);
/* Try not to give this error too many times. */ /* Try not to give this error too many times. */
(*sym_hash)->flags &= ~XCOFF_MULTIPLY_DEFINED; (*sym_hash)->flags &= ~XCOFF_MULTIPLY_DEFINED;
} }
@ -3117,11 +3118,8 @@ bfd_xcoff_import_symbol (bfd *output_bfd,
if (h->root.type == bfd_link_hash_defined if (h->root.type == bfd_link_hash_defined
&& (! bfd_is_abs_section (h->root.u.def.section) && (! bfd_is_abs_section (h->root.u.def.section)
|| h->root.u.def.value != val)) || h->root.u.def.value != val))
{ (*info->callbacks->multiple_definition) (info, &h->root, output_bfd,
if (! ((*info->callbacks->multiple_definition) bfd_abs_section_ptr, val);
(info, &h->root, output_bfd, bfd_abs_section_ptr, val)))
return FALSE;
}
h->root.type = bfd_link_hash_defined; h->root.type = bfd_link_hash_defined;
h->root.u.def.section = bfd_abs_section_ptr; h->root.u.def.section = bfd_abs_section_ptr;
@ -4942,10 +4940,9 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
if (name == NULL) if (name == NULL)
return FALSE; return FALSE;
if (!(*flinfo->info->callbacks->unattached_reloc) (*flinfo->info->callbacks->unattached_reloc)
(flinfo->info, name, input_bfd, o, (flinfo->info, name,
irel->r_vaddr)) input_bfd, o, irel->r_vaddr);
return FALSE;
} }
} }
} }
@ -5712,9 +5709,8 @@ xcoff_reloc_link_order (bfd *output_bfd,
FALSE, FALSE, TRUE)); FALSE, FALSE, TRUE));
if (h == NULL) if (h == NULL)
{ {
if (! ((*flinfo->info->callbacks->unattached_reloc) (*flinfo->info->callbacks->unattached_reloc)
(flinfo->info, link_order->u.reloc.p->u.name, NULL, NULL, (bfd_vma) 0))) (flinfo->info, link_order->u.reloc.p->u.name, NULL, NULL, (bfd_vma) 0);
return FALSE;
return TRUE; return TRUE;
} }
@ -5752,13 +5748,9 @@ xcoff_reloc_link_order (bfd *output_bfd,
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
abort (); abort ();
case bfd_reloc_overflow: case bfd_reloc_overflow:
if (! ((*flinfo->info->callbacks->reloc_overflow) (*flinfo->info->callbacks->reloc_overflow)
(flinfo->info, NULL, link_order->u.reloc.p->u.name, (flinfo->info, NULL, link_order->u.reloc.p->u.name,
howto->name, addend, NULL, NULL, (bfd_vma) 0))) howto->name, addend, NULL, NULL, (bfd_vma) 0);
{
free (buf);
return FALSE;
}
break; break;
} }
ok = bfd_set_section_contents (output_bfd, output_section, (void *) buf, ok = bfd_set_section_contents (output_bfd, output_section, (void *) buf,
@ -6282,10 +6274,9 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
{ {
if ((*rel_hash)->indx < 0) if ((*rel_hash)->indx < 0)
{ {
if (! ((*info->callbacks->unattached_reloc) (*info->callbacks->unattached_reloc)
(info, (*rel_hash)->root.root.string, (info, (*rel_hash)->root.root.string,
NULL, o, irel->r_vaddr))) NULL, o, irel->r_vaddr);
goto error_return;
(*rel_hash)->indx = 0; (*rel_hash)->indx = 0;
} }
irel->r_symndx = (*rel_hash)->indx; irel->r_symndx = (*rel_hash)->indx;
@ -6298,10 +6289,9 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
{ {
if (toc_rel_hash->h->u.toc_indx < 0) if (toc_rel_hash->h->u.toc_indx < 0)
{ {
if (! ((*info->callbacks->unattached_reloc) (*info->callbacks->unattached_reloc)
(info, toc_rel_hash->h->root.root.string, (info, toc_rel_hash->h->root.root.string,
NULL, o, toc_rel_hash->rel->r_vaddr))) NULL, o, toc_rel_hash->rel->r_vaddr);
goto error_return;
toc_rel_hash->h->u.toc_indx = 0; toc_rel_hash->h->u.toc_indx = 0;
} }
toc_rel_hash->rel->r_symndx = toc_rel_hash->h->u.toc_indx; toc_rel_hash->rel->r_symndx = toc_rel_hash->h->u.toc_indx;

View file

@ -1,3 +1,11 @@
2016-05-28 Alan Modra <amodra@gmail.com>
* compile/compile-object-load.c (link_callbacks_multiple_definition,
link_callbacks_warning, link_callbacks_undefined_symbol,
link_callbacks_undefined_symbol, link_callbacks_reloc_overflow,
link_callbacks_reloc_dangerous,
link_callbacks_unattached_reloc): Return void.
2016-05-27 Andrew Burgess <andrew.burgess@embecosm.com> 2016-05-27 Andrew Burgess <andrew.burgess@embecosm.com>
* opencl-lang.c (evaluate_subexp_opencl): If * opencl-lang.c (evaluate_subexp_opencl): If

View file

@ -198,7 +198,7 @@ setup_sections (bfd *abfd, asection *sect, void *data_voidp)
/* Helper for link_callbacks callbacks vector. */ /* Helper for link_callbacks callbacks vector. */
static bfd_boolean static void
link_callbacks_multiple_definition (struct bfd_link_info *link_info, link_callbacks_multiple_definition (struct bfd_link_info *link_info,
struct bfd_link_hash_entry *h, bfd *nbfd, struct bfd_link_hash_entry *h, bfd *nbfd,
asection *nsec, bfd_vma nval) asection *nsec, bfd_vma nval)
@ -206,15 +206,14 @@ link_callbacks_multiple_definition (struct bfd_link_info *link_info,
bfd *abfd = link_info->input_bfds; bfd *abfd = link_info->input_bfds;
if (link_info->allow_multiple_definition) if (link_info->allow_multiple_definition)
return TRUE; return;
warning (_("Compiled module \"%s\": multiple symbol definitions: %s"), warning (_("Compiled module \"%s\": multiple symbol definitions: %s"),
bfd_get_filename (abfd), h->root.string); bfd_get_filename (abfd), h->root.string);
return FALSE;
} }
/* Helper for link_callbacks callbacks vector. */ /* Helper for link_callbacks callbacks vector. */
static bfd_boolean static void
link_callbacks_warning (struct bfd_link_info *link_info, const char *xwarning, link_callbacks_warning (struct bfd_link_info *link_info, const char *xwarning,
const char *symbol, bfd *abfd, asection *section, const char *symbol, bfd *abfd, asection *section,
bfd_vma address) bfd_vma address)
@ -222,13 +221,11 @@ link_callbacks_warning (struct bfd_link_info *link_info, const char *xwarning,
warning (_("Compiled module \"%s\" section \"%s\": warning: %s"), warning (_("Compiled module \"%s\" section \"%s\": warning: %s"),
bfd_get_filename (abfd), bfd_get_section_name (abfd, section), bfd_get_filename (abfd), bfd_get_section_name (abfd, section),
xwarning); xwarning);
/* Maybe permit running as a module? */
return FALSE;
} }
/* Helper for link_callbacks callbacks vector. */ /* Helper for link_callbacks callbacks vector. */
static bfd_boolean static void
link_callbacks_undefined_symbol (struct bfd_link_info *link_info, link_callbacks_undefined_symbol (struct bfd_link_info *link_info,
const char *name, bfd *abfd, asection *section, const char *name, bfd *abfd, asection *section,
bfd_vma address, bfd_boolean is_fatal) bfd_vma address, bfd_boolean is_fatal)
@ -236,25 +233,22 @@ link_callbacks_undefined_symbol (struct bfd_link_info *link_info,
warning (_("Cannot resolve relocation to \"%s\" " warning (_("Cannot resolve relocation to \"%s\" "
"from compiled module \"%s\" section \"%s\"."), "from compiled module \"%s\" section \"%s\"."),
name, bfd_get_filename (abfd), bfd_get_section_name (abfd, section)); name, bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
return FALSE;
} }
/* Helper for link_callbacks callbacks vector. */ /* Helper for link_callbacks callbacks vector. */
static bfd_boolean static void
link_callbacks_reloc_overflow (struct bfd_link_info *link_info, link_callbacks_reloc_overflow (struct bfd_link_info *link_info,
struct bfd_link_hash_entry *entry, struct bfd_link_hash_entry *entry,
const char *name, const char *reloc_name, const char *name, const char *reloc_name,
bfd_vma addend, bfd *abfd, asection *section, bfd_vma addend, bfd *abfd, asection *section,
bfd_vma address) bfd_vma address)
{ {
/* TRUE is required for intra-module relocations. */
return TRUE;
} }
/* Helper for link_callbacks callbacks vector. */ /* Helper for link_callbacks callbacks vector. */
static bfd_boolean static void
link_callbacks_reloc_dangerous (struct bfd_link_info *link_info, link_callbacks_reloc_dangerous (struct bfd_link_info *link_info,
const char *message, bfd *abfd, const char *message, bfd *abfd,
asection *section, bfd_vma address) asection *section, bfd_vma address)
@ -263,12 +257,11 @@ link_callbacks_reloc_dangerous (struct bfd_link_info *link_info,
"relocation: %s\n"), "relocation: %s\n"),
bfd_get_filename (abfd), bfd_get_section_name (abfd, section), bfd_get_filename (abfd), bfd_get_section_name (abfd, section),
message); message);
return FALSE;
} }
/* Helper for link_callbacks callbacks vector. */ /* Helper for link_callbacks callbacks vector. */
static bfd_boolean static void
link_callbacks_unattached_reloc (struct bfd_link_info *link_info, link_callbacks_unattached_reloc (struct bfd_link_info *link_info,
const char *name, bfd *abfd, asection *section, const char *name, bfd *abfd, asection *section,
bfd_vma address) bfd_vma address)
@ -277,7 +270,6 @@ link_callbacks_unattached_reloc (struct bfd_link_info *link_info,
"relocation: %s\n"), "relocation: %s\n"),
bfd_get_filename (abfd), bfd_get_section_name (abfd, section), bfd_get_filename (abfd), bfd_get_section_name (abfd, section),
name); name);
return FALSE;
} }
/* Helper for link_callbacks callbacks vector. */ /* Helper for link_callbacks callbacks vector. */

View file

@ -1,3 +1,10 @@
2016-05-28 Alan Modra <amodra@gmail.com>
* bfdlink.h (struct bfd_link_callbacks): Update comments.
Return void from multiple_definition, multiple_common,
add_to_set, constructor, warning, undefined_symbol,
reloc_overflow, reloc_dangerous and unattached_reloc.
2016-05-26 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> 2016-05-26 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* opcode/metag.h: wrap declarations in extern "C". * opcode/metag.h: wrap declarations in extern "C".

View file

@ -609,11 +609,7 @@ struct bfd_link_info
}; };
/* This structures holds a set of callback functions. These are called /* This structures holds a set of callback functions. These are called
by the BFD linker routines. Except for the info functions, the first by the BFD linker routines. */
argument to each callback function is the bfd_link_info structure
being used and each function returns a boolean value. If the
function returns FALSE, then the BFD function which called it should
return with a failure indication. */
struct bfd_link_callbacks struct bfd_link_callbacks
{ {
@ -622,14 +618,15 @@ struct bfd_link_callbacks
name of the symbol which caused the archive element to be pulled name of the symbol which caused the archive element to be pulled
in. This function may set *SUBSBFD to point to an alternative in. This function may set *SUBSBFD to point to an alternative
BFD from which symbols should in fact be added in place of the BFD from which symbols should in fact be added in place of the
original BFD's symbols. */ original BFD's symbols. Returns TRUE if the object should be
added, FALSE if it should be skipped. */
bfd_boolean (*add_archive_element) bfd_boolean (*add_archive_element)
(struct bfd_link_info *, bfd *abfd, const char *name, bfd **subsbfd); (struct bfd_link_info *, bfd *abfd, const char *name, bfd **subsbfd);
/* A function which is called when a symbol is found with multiple /* A function which is called when a symbol is found with multiple
definitions. H is the symbol which is defined multiple times. definitions. H is the symbol which is defined multiple times.
NBFD is the new BFD, NSEC is the new section, and NVAL is the new NBFD is the new BFD, NSEC is the new section, and NVAL is the new
value. NSEC may be bfd_com_section or bfd_ind_section. */ value. NSEC may be bfd_com_section or bfd_ind_section. */
bfd_boolean (*multiple_definition) void (*multiple_definition)
(struct bfd_link_info *, struct bfd_link_hash_entry *h, (struct bfd_link_info *, struct bfd_link_hash_entry *h,
bfd *nbfd, asection *nsec, bfd_vma nval); bfd *nbfd, asection *nsec, bfd_vma nval);
/* A function which is called when a common symbol is defined /* A function which is called when a common symbol is defined
@ -638,7 +635,7 @@ struct bfd_link_callbacks
symbol, one of bfd_link_hash_defined, bfd_link_hash_common, or symbol, one of bfd_link_hash_defined, bfd_link_hash_common, or
bfd_link_hash_indirect. If NTYPE is bfd_link_hash_common, NSIZE bfd_link_hash_indirect. If NTYPE is bfd_link_hash_common, NSIZE
is the size of the new symbol. */ is the size of the new symbol. */
bfd_boolean (*multiple_common) void (*multiple_common)
(struct bfd_link_info *, struct bfd_link_hash_entry *h, (struct bfd_link_info *, struct bfd_link_hash_entry *h,
bfd *nbfd, enum bfd_link_hash_type ntype, bfd_vma nsize); bfd *nbfd, enum bfd_link_hash_type ntype, bfd_vma nsize);
/* A function which is called to add a symbol to a set. ENTRY is /* A function which is called to add a symbol to a set. ENTRY is
@ -647,7 +644,7 @@ struct bfd_link_callbacks
the set when generating a relocatable file, and is also used to the set when generating a relocatable file, and is also used to
get the size of the entry when generating an executable file. get the size of the entry when generating an executable file.
ABFD, SEC and VALUE identify the value to add to the set. */ ABFD, SEC and VALUE identify the value to add to the set. */
bfd_boolean (*add_to_set) void (*add_to_set)
(struct bfd_link_info *, struct bfd_link_hash_entry *entry, (struct bfd_link_info *, struct bfd_link_hash_entry *entry,
bfd_reloc_code_real_type reloc, bfd *abfd, asection *sec, bfd_vma value); bfd_reloc_code_real_type reloc, bfd *abfd, asection *sec, bfd_vma value);
/* A function which is called when the name of a g++ constructor or /* A function which is called when the name of a g++ constructor or
@ -656,7 +653,7 @@ struct bfd_link_callbacks
destructor. This will use BFD_RELOC_CTOR when generating a destructor. This will use BFD_RELOC_CTOR when generating a
relocatable file. NAME is the name of the symbol found. ABFD, relocatable file. NAME is the name of the symbol found. ABFD,
SECTION and VALUE are the value of the symbol. */ SECTION and VALUE are the value of the symbol. */
bfd_boolean (*constructor) void (*constructor)
(struct bfd_link_info *, bfd_boolean constructor, const char *name, (struct bfd_link_info *, bfd_boolean constructor, const char *name,
bfd *abfd, asection *sec, bfd_vma value); bfd *abfd, asection *sec, bfd_vma value);
/* A function which is called to issue a linker warning. For /* A function which is called to issue a linker warning. For
@ -666,7 +663,7 @@ struct bfd_link_callbacks
there is none. ABFD, SECTION and ADDRESS identify the location there is none. ABFD, SECTION and ADDRESS identify the location
which trigerred the warning; either ABFD or SECTION or both may which trigerred the warning; either ABFD or SECTION or both may
be NULL if the location is not known. */ be NULL if the location is not known. */
bfd_boolean (*warning) void (*warning)
(struct bfd_link_info *, const char *warning, const char *symbol, (struct bfd_link_info *, const char *warning, const char *symbol,
bfd *abfd, asection *section, bfd_vma address); bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a relocation is attempted against /* A function which is called when a relocation is attempted against
@ -674,7 +671,7 @@ struct bfd_link_callbacks
ABFD, SECTION and ADDRESS identify the location from which the ABFD, SECTION and ADDRESS identify the location from which the
reference is made. IS_FATAL indicates whether an undefined symbol is reference is made. IS_FATAL indicates whether an undefined symbol is
a fatal error or not. In some cases SECTION may be NULL. */ a fatal error or not. In some cases SECTION may be NULL. */
bfd_boolean (*undefined_symbol) void (*undefined_symbol)
(struct bfd_link_info *, const char *name, bfd *abfd, (struct bfd_link_info *, const char *name, bfd *abfd,
asection *section, bfd_vma address, bfd_boolean is_fatal); asection *section, bfd_vma address, bfd_boolean is_fatal);
/* A function which is called when a reloc overflow occurs. ENTRY is /* A function which is called when a reloc overflow occurs. ENTRY is
@ -685,7 +682,7 @@ struct bfd_link_callbacks
location at which the overflow occurs; if this is the result of a location at which the overflow occurs; if this is the result of a
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
ABFD will be NULL. */ ABFD will be NULL. */
bfd_boolean (*reloc_overflow) void (*reloc_overflow)
(struct bfd_link_info *, struct bfd_link_hash_entry *entry, (struct bfd_link_info *, struct bfd_link_hash_entry *entry,
const char *name, const char *reloc_name, bfd_vma addend, const char *name, const char *reloc_name, bfd_vma addend,
bfd *abfd, asection *section, bfd_vma address); bfd *abfd, asection *section, bfd_vma address);
@ -695,7 +692,7 @@ struct bfd_link_callbacks
problem occurred; if this is the result of a problem occurred; if this is the result of a
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
ABFD will be NULL. */ ABFD will be NULL. */
bfd_boolean (*reloc_dangerous) void (*reloc_dangerous)
(struct bfd_link_info *, const char *message, (struct bfd_link_info *, const char *message,
bfd *abfd, asection *section, bfd_vma address); bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a reloc is found to be attached /* A function which is called when a reloc is found to be attached
@ -704,7 +701,7 @@ struct bfd_link_callbacks
the reloc; if this is the result of a the reloc; if this is the result of a
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
ABFD will be NULL. */ ABFD will be NULL. */
bfd_boolean (*unattached_reloc) void (*unattached_reloc)
(struct bfd_link_info *, const char *name, (struct bfd_link_info *, const char *name,
bfd *abfd, asection *section, bfd_vma address); bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a symbol in notice_hash is /* A function which is called when a symbol in notice_hash is

View file

@ -1,3 +1,10 @@
2016-05-28 Alan Modra <amodra@gmail.com>
* ldmain.c (multiple_definition, multiple_common, add_to_set,
constructor_callback, warning_callback, undefined_symbol,
reloc_overflow, reloc_dangerous, unattached_reloc): Return void.
* emultempl/elf32.em: Adjust callback calls.
2016-05-27 Maciej W. Rozycki <macro@imgtec.com> 2016-05-27 Maciej W. Rozycki <macro@imgtec.com>
* testsuite/ld-mips-elf/unaligned-jalx-addend-0.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-addend-0.d: New test.

Some files were not shown because too many files have changed in this diff Show more