mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 19:50:13 +08:00
* elf64-ppc.c (ppc64_elf_edit_toc): Always adjust local syms in
.toc section, even when none are used in relocs.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2010-07-29 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* elf64-ppc.c (ppc64_elf_edit_toc): Always adjust local syms in
|
||||||
|
.toc section, even when none are used in relocs.
|
||||||
|
|
||||||
2010-07-27 Maciej W. Rozycki <macro@codesourcery.com>
|
2010-07-27 Maciej W. Rozycki <macro@codesourcery.com>
|
||||||
|
|
||||||
* elfxx-mips.h: Include "elf/mips.h".
|
* elfxx-mips.h: Include "elf/mips.h".
|
||||||
|
@ -8248,6 +8248,7 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
|
|||||||
{
|
{
|
||||||
bfd_byte *contents, *src;
|
bfd_byte *contents, *src;
|
||||||
unsigned long off;
|
unsigned long off;
|
||||||
|
Elf_Internal_Sym *sym;
|
||||||
bfd_boolean local_toc_syms = FALSE;
|
bfd_boolean local_toc_syms = FALSE;
|
||||||
|
|
||||||
/* Shuffle the toc contents, and at the same time convert the
|
/* Shuffle the toc contents, and at the same time convert the
|
||||||
@ -8292,7 +8293,6 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
|
|||||||
unsigned long r_symndx;
|
unsigned long r_symndx;
|
||||||
asection *sym_sec;
|
asection *sym_sec;
|
||||||
struct elf_link_hash_entry *h;
|
struct elf_link_hash_entry *h;
|
||||||
Elf_Internal_Sym *sym;
|
|
||||||
bfd_vma val;
|
bfd_vma val;
|
||||||
|
|
||||||
r_type = ELF64_R_TYPE (rel->r_info);
|
r_type = ELF64_R_TYPE (rel->r_info);
|
||||||
@ -8371,10 +8371,6 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
|
|||||||
|
|
||||||
/* We shouldn't have local or global symbols defined in the TOC,
|
/* We shouldn't have local or global symbols defined in the TOC,
|
||||||
but handle them anyway. */
|
but handle them anyway. */
|
||||||
if (local_toc_syms)
|
|
||||||
{
|
|
||||||
Elf_Internal_Sym *sym;
|
|
||||||
|
|
||||||
for (sym = local_syms;
|
for (sym = local_syms;
|
||||||
sym < local_syms + symtab_hdr->sh_info;
|
sym < local_syms + symtab_hdr->sh_info;
|
||||||
++sym)
|
++sym)
|
||||||
@ -8390,6 +8386,7 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
|
|||||||
|
|
||||||
if ((skip[i] & (ref_from_discarded | can_optimize)) != 0)
|
if ((skip[i] & (ref_from_discarded | can_optimize)) != 0)
|
||||||
{
|
{
|
||||||
|
if (local_toc_syms)
|
||||||
(*_bfd_error_handler)
|
(*_bfd_error_handler)
|
||||||
(_("%s defined on removed toc entry"),
|
(_("%s defined on removed toc entry"),
|
||||||
bfd_elf_sym_name (ibfd, symtab_hdr, sym, NULL));
|
bfd_elf_sym_name (ibfd, symtab_hdr, sym, NULL));
|
||||||
@ -8402,7 +8399,6 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
|
|||||||
sym->st_value -= skip[i];
|
sym->st_value -= skip[i];
|
||||||
symtab_hdr->contents = (unsigned char *) local_syms;
|
symtab_hdr->contents = (unsigned char *) local_syms;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Adjust any global syms defined in this toc input section. */
|
/* Adjust any global syms defined in this toc input section. */
|
||||||
if (toc_inf.global_toc_syms)
|
if (toc_inf.global_toc_syms)
|
||||||
|
Reference in New Issue
Block a user