+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
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;
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;
/* 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;