diff options
author | Richard Henderson <rth@redhat.com> | 2002-06-02 08:35:51 +0000 |
---|---|---|
committer | Richard Henderson <rth@redhat.com> | 2002-06-02 08:35:51 +0000 |
commit | 048d873d6955915e73916ff8b17d8ba291d0d288 (patch) | |
tree | 50b82eef24e7a8a868fdb8f47aff3c7ae042999b /bfd | |
parent | f4f1b9f1029e0b2645a9ed13f6241518f7df1e0a (diff) | |
download | gdb-048d873d6955915e73916ff8b17d8ba291d0d288.zip gdb-048d873d6955915e73916ff8b17d8ba291d0d288.tar.gz gdb-048d873d6955915e73916ff8b17d8ba291d0d288.tar.bz2 |
* elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference
null when there are no got entries for a symbol.
(elf64_alpha_relax_find_tls_segment): Rearrange to avoid
uninitialized variable warning.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf64-alpha.c | 24 |
2 files changed, 19 insertions, 12 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 87e62af..b768b0d 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2002-06-02 Richard Henderson <rth@redhat.com> + + * elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference + null when there are no got entries for a symbol. + (elf64_alpha_relax_find_tls_segment): Rearrange to avoid + uninitialized variable warning. + 2002-06-01 Richard Henderson <rth@redhat.com> * elf64-alpha.c (elf64_alpha_relax_with_lituse): Don't test for diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index bdae249..8fcfeb3 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -1988,24 +1988,21 @@ elf64_alpha_relax_find_tls_segment (info, seg) struct elf_link_tls_segment *seg; { bfd *output_bfd = info->sec->output_section->owner; - asection *first_tls_sec = NULL, *o; + asection *o; unsigned int align; bfd_vma base, end; for (o = output_bfd->sections; o ; o = o->next) if ((o->flags & SEC_THREAD_LOCAL) != 0 && (o->flags & SEC_LOAD) != 0) - { - first_tls_sec = o; - break; - } - if (!first_tls_sec) + break; + if (!o) return NULL; - base = first_tls_sec->vma; + base = o->vma; align = 0; - for (o = first_tls_sec; o && (o->flags & SEC_THREAD_LOCAL); o = o->next) + do { bfd_vma size; @@ -2021,7 +2018,9 @@ elf64_alpha_relax_find_tls_segment (info, seg) size = lo->offset + lo->size; } end = o->vma + size; + o = o->next; } + while (o && (o->flags & SEC_THREAD_LOCAL)); seg->start = base; seg->size = end - base; @@ -4366,10 +4365,11 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, /* Need to adjust local GOT entries' addends for SEC_MERGE unless it has been done already. */ if ((sec->flags & SEC_MERGE) - && ELF_ST_TYPE (sym->st_info) == STT_SECTION - && (elf_section_data (sec)->sec_info_type - == ELF_INFO_TYPE_MERGE) - && !gotent->reloc_xlated) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION + && (elf_section_data (sec)->sec_info_type + == ELF_INFO_TYPE_MERGE) + && gotent + && !gotent->reloc_xlated) { struct alpha_elf_got_entry *ent; asection *msec; |