diff options
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r-- | bfd/elf64-ppc.c | 96 |
1 files changed, 45 insertions, 51 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 2922103..cd3aaac 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -2402,8 +2402,7 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd, sym = *r->sym_ptr_ptr; if (!sym_exists_at (syms, opdsymend, symcount, - sym->section->id, sym->value + r->addend) - && syms[i]->name != NULL) + sym->section->id, sym->value + r->addend)) { ++count; size += sizeof (asymbol); @@ -2441,8 +2440,7 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd, sym = *r->sym_ptr_ptr; if (!sym_exists_at (syms, opdsymend, symcount, - sym->section->id, sym->value + r->addend) - && syms[i]->name != NULL) + sym->section->id, sym->value + r->addend)) { size_t len; @@ -2493,8 +2491,7 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd, continue; ent = bfd_get_64 (abfd, contents + syms[i]->value); - if (!sym_exists_at (syms, opdsymend, symcount, -1, ent) - && syms[i]->name != NULL) + if (!sym_exists_at (syms, opdsymend, symcount, -1, ent)) { ++count; size += sizeof (asymbol); @@ -2582,12 +2579,11 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd, p = relplt->relocation; for (i = 0; i < plt_count; i++, p++) - if ((*p->sym_ptr_ptr)->name != NULL) - { - size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt"); - if (p->addend != 0) - size += sizeof ("+0x") - 1 + 16; - } + { + size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt"); + if (p->addend != 0) + size += sizeof ("+0x") - 1 + 16; + } } } @@ -2607,8 +2603,7 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd, continue; ent = bfd_get_64 (abfd, contents + syms[i]->value); - if (!sym_exists_at (syms, opdsymend, symcount, -1, ent) - && syms[i]->name != NULL) + if (!sym_exists_at (syms, opdsymend, symcount, -1, ent)) { size_t lo, hi; size_t len; @@ -2696,43 +2691,42 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd, for pending shared library loads. */ p = relplt->relocation; for (i = 0; i < plt_count; i++, p++) - if ((*p->sym_ptr_ptr)->name != NULL) - { - size_t len; - - *s = **p->sym_ptr_ptr; - /* Undefined syms won't have BSF_LOCAL or BSF_GLOBAL set. Since - we are defining a symbol, ensure one of them is set. */ - if ((s->flags & BSF_LOCAL) == 0) - s->flags |= BSF_GLOBAL; - s->flags |= BSF_SYNTHETIC; - s->section = glink; - s->value = glink_vma - glink->vma; - s->name = names; - s->udata.p = NULL; - len = strlen ((*p->sym_ptr_ptr)->name); - memcpy (names, (*p->sym_ptr_ptr)->name, len); - names += len; - if (p->addend != 0) - { - memcpy (names, "+0x", sizeof ("+0x") - 1); - names += sizeof ("+0x") - 1; - bfd_sprintf_vma (abfd, names, p->addend); - names += strlen (names); - } - memcpy (names, "@plt", sizeof ("@plt")); - names += sizeof ("@plt"); - s++; - if (abi < 2) - { - glink_vma += 8; - if (i >= 0x8000) - glink_vma += 4; - } - else - glink_vma += 4; - count++; - } + { + size_t len; + + *s = **p->sym_ptr_ptr; + /* Undefined syms won't have BSF_LOCAL or BSF_GLOBAL set. Since + we are defining a symbol, ensure one of them is set. */ + if ((s->flags & BSF_LOCAL) == 0) + s->flags |= BSF_GLOBAL; + s->flags |= BSF_SYNTHETIC; + s->section = glink; + s->value = glink_vma - glink->vma; + s->name = names; + s->udata.p = NULL; + len = strlen ((*p->sym_ptr_ptr)->name); + memcpy (names, (*p->sym_ptr_ptr)->name, len); + names += len; + if (p->addend != 0) + { + memcpy (names, "+0x", sizeof ("+0x") - 1); + names += sizeof ("+0x") - 1; + bfd_sprintf_vma (abfd, names, p->addend); + names += strlen (names); + } + memcpy (names, "@plt", sizeof ("@plt")); + names += sizeof ("@plt"); + s++; + if (abi < 2) + { + glink_vma += 8; + if (i >= 0x8000) + glink_vma += 4; + } + else + glink_vma += 4; + } + count += plt_count; } } |