summaryrefslogtreecommitdiff
path: root/bfd/elf32-score.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2006-09-27 04:07:57 +0000
committerAlan Modra <amodra@gmail.com>2006-09-27 04:07:57 +0000
commitf36b9bcd93570f658ebfe3c6946409eed2533e6d (patch)
tree376958e4138c5ad511dfe98824f32678f8fb274f /bfd/elf32-score.c
parentf2320d6ad57c2f624c7d3356ceeaa232bf4e5ffe (diff)
* elf32-score.c (_bfd_score_elf_relocate_section): Move assignment
to "name" so that compiler realizes it is never uninitialized. Use bfd_elf_sym_name.
Diffstat (limited to 'bfd/elf32-score.c')
-rw-r--r--bfd/elf32-score.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c
index c84763aa28..779375416c 100644
--- a/bfd/elf32-score.c
+++ b/bfd/elf32-score.c
@@ -2308,9 +2308,13 @@ _bfd_score_elf_relocate_section (bfd *output_bfd,
{
sym = local_syms + r_symndx;
sec = local_sections[r_symndx];
- relocation = (sec->output_section->vma + sec->output_offset + sym->st_value);
+ relocation = (sec->output_section->vma
+ + sec->output_offset
+ + sym->st_value);
+ name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, sec);
- if ((sec->flags & SEC_MERGE) && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ if ((sec->flags & SEC_MERGE)
+ && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
{
asection *msec;
bfd_vma addend, value;
@@ -2432,13 +2436,6 @@ _bfd_score_elf_relocate_section (bfd *output_bfd,
}
}
- if (h == NULL)
- {
- name = (bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name));
- if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
- }
-
r = score_elf_final_link_relocate (howto, input_bfd, output_bfd,
input_section, contents, rel, relocs,
relocation, info, sec, name,