+2000-03-01 H.J. Lu <hjl@gnu.org>
+
+ * aoutx.h (aout_link_input_section_std): Pass "true" to
+ the undefined_symbol callback.
+ (aout_link_input_section_ext): Likewise.
+ * bout.c (get_value): Likewise.
+ * coff-a29k.c (coff_a29k_relocate_section): Likewise.
+ * coff-alpha.c (alpha_ecoff_get_relocated_section_conten):
+ Likewise.
+ (alpha_relocate_section): Likewise.
+ * coff-arm.c (coff_arm_relocate_section): Likewise.
+ * coff-i960.c (coff_i960_relocate_section): Likewise.
+ * coff-mcore.c (coff_mcore_relocate_section): Likewise.
+ * coff-mips.c (mips_relocate_section): Likewise.
+ * coff-ppc.c (coff_ppc_relocate_section): Likewise.
+ * coff-sh.c (sh_relocate_section): Likewise.
+ * coff-tic80.c (coff_tic80_relocate_section): Likewise.
+ * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
+ * elf-m10200.c (mn10200_elf_relocate_section): Likewise.
+ * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
+ * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
+ * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
+ * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
+ * elf32-i370.c (i370_elf_relocate_section): Likewise.
+ * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
+ * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
+ * elf32-sh.c (sh_elf_relocate_section): Likewise.
+ * elf32-v850.c (v850_elf_relocate_section): Likewise.
+ * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise.
+ * elflink.h (elf_link_output_extsym): Likewise.
+ * pe-mips.c (coff_pe_mips_relocate_section): Likewise.
+ * reloc.c (bfd_generic_get_relocated_section_conten): Likewise.
+ * reloc16.c (_bfd_ppc_xcoff_relocate_section): Likewise.
+
+ * elf-hppa.h (elf_hppa_relocate_section): Pass "false" to the
+ undefined_symbol callback when building shared library with
+ -Bsymbolic and undefined symbols are allowed. Otherwise, pass
+ "true".
+ * elf32-arm.h (elf32_arm_relocate_section): Likewise.
+ * elf32-i386.c (elf_i386_relocate_section): Likewise.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-mips.c (mips_elf_calculate_relocation): Likewise.
+ (elf32_mips_get_relocated_section_content): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+
2000-02-28 Nick Clifton <nickc@cygnus.com>
* Makefile.am: Add rules to build pe[i]-{sh|mips}.lo objects.
else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
if (! ((*finfo->info->callbacks->undefined_symbol)
- (finfo->info, name, input_bfd, input_section, r_addr)))
+ (finfo->info, name, input_bfd, input_section,
+ r_addr, true)))
return false;
}
else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
if (! ((*finfo->info->callbacks->undefined_symbol)
- (finfo->info, name, input_bfd, input_section, r_addr)))
+ (finfo->info, name, input_bfd, input_section,
+ r_addr, true)))
return false;
}
{
if (! ((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (symbol),
- input_section->owner, input_section, reloc->address)))
+ input_section->owner, input_section, reloc->address,
+ true)))
abort ();
value = 0;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
case bfd_reloc_undefined:
if (! ((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*rel->sym_ptr_ptr),
- input_bfd, input_section, rel->address)))
+ input_bfd, input_section, rel->address, true)))
goto error_return;
break;
case bfd_reloc_dangerous:
relocated. */
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, (bfd_vma) 0)))
+ input_section, (bfd_vma) 0, true)))
return false;
addend = 0;
}
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
input_section,
- r_vaddr - input_section->vma)))
+ r_vaddr - input_section->vma, true)))
return false;
relocation = 0;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
input_section,
- int_rel.r_vaddr - input_section->vma)))
+ int_rel.r_vaddr - input_section->vma, true)))
return false;
relocation = 0;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
relocation = 0;
}
/* Allow undefined symbols in shared libraries. */
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared && !info->no_undefined)
{
+ if (info->symbolic)
+ (*info->callbacks->undefined_symbol)
+ (info, h->root.root.string, input_bfd,
+ input_section, rel->r_offset, false);
+
/* If this symbol has an entry in the PA64 dynamic hash
table, then get it. */
dyn_name = get_dyn_name (input_bfd, h, rel,
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
break;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
relocation = 0;
}
case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- rel->r_offset)))
+ rel->r_offset, true)))
return false;
break;
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
relocation = 0;
}
case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- rel->r_offset)))
+ rel->r_offset, true)))
return false;
break;
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined))))
return false;
relocation = 0;
}
case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- rel->r_offset)))
+ rel->r_offset, true)))
return false;
break;
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
relocation = 0;
}
case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- rel->r_offset)))
+ rel->r_offset, true)))
return false;
break;
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
#if 0
fprintf (stderr, "unknown: name: %s\n", name);
case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol
- (info, name, input_bfd, input_section, rel->r_offset);
+ (info, name, input_bfd, input_section, rel->r_offset,
+ true);
break;
case bfd_reloc_outofrange:
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
break;
}
case bfd_reloc_notsupported:
if (!((*info->callbacks->undefined_symbol)
(info, "$global$", input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
return false;
case bfd_reloc_dangerous:
h->root.root.string,
input_bfd,
input_section,
- rel->r_offset);
+ rel->r_offset,
+ true);
ret = false;
continue;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined))))
return false;
relocation = 0;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, offset)))
+ input_section, offset, true)))
return false;
relocation = 0;
}
case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- offset)))
+ offset, true)))
return false;
break;
{
if (!(info->callbacks->undefined_symbol
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined))))
return false;
relocation = 0;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
ret = false;
}
else
{
- (*info->callbacks->undefined_symbol)
- (info, h->root.root.root.string, input_bfd,
- input_section, relocation->r_offset);
- return bfd_reloc_undefined;
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, h->root.root.root.string, input_bfd,
+ input_section, relocation->r_offset,
+ (!info->shared || info->no_undefined))))
+ return bfd_reloc_undefined;
+ symbol = 0;
}
target_is_16_bit_code_p = (h->root.other == STO_MIPS16);
case bfd_reloc_undefined:
if (!((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
- input_bfd, input_section, (*parent)->address)))
+ input_bfd, input_section, (*parent)->address,
+ true)))
goto error_return;
break;
case bfd_reloc_dangerous:
h->root.root.string,
input_bfd,
input_section,
- rel->r_offset))
+ rel->r_offset,
+ (!info->shared
+ || info->no_undefined)))
return false;
relocation = 0;
}
h->root.root.string,
input_bfd,
input_section,
- rel->r_offset))
+ rel->r_offset,
+ true))
return false;
continue;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
relocation = 0;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined))))
return false;
relocation = 0;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
#if 0
fprintf (stderr, "unknown: name: %s\n", h->root.root.string);
case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- rel->r_offset)))
+ rel->r_offset, true)))
return false;
break;
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined))))
return false;
relocation = 0;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined))))
return false;
relocation = 0;
}
const char * name = h->root.root.string;
(*info->callbacks->undefined_symbol)
- (info, name, abfd, bfd_und_section_ptr, 0);
+ (info, name, abfd, bfd_und_section_ptr, 0, true);
}
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
}
/* That wrote out all the local symbols. Finish up the symbol table
- with the global symbols. */
+ with the global symbols. Even if we want to strip everything we
+ can, we still need to deal with those global symbols that got
+ converted to local in a version script. */
if (info->shared)
{
{
if (! ((*finfo->info->callbacks->undefined_symbol)
(finfo->info, h->root.root.string, h->root.u.undef.abfd,
- (asection *) NULL, 0)))
+ (asection *) NULL, 0, true)))
{
eoinfo->failed = true;
return false;
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
case bfd_reloc_undefined:
if (!((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
- input_bfd, input_section, (*parent)->address)))
+ input_bfd, input_section, (*parent)->address,
+ true)))
goto error_return;
break;
case bfd_reloc_dangerous:
{
if (! ((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (symbol),
- input_section->owner, input_section, reloc->address)))
+ input_section->owner, input_section, reloc->address,
+ true)))
abort ();
value = 0;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
/* Don't try to process the reloc. It can't help, and