]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference
authorRichard Henderson <rth@redhat.com>
Sun, 2 Jun 2002 08:35:51 +0000 (08:35 +0000)
committerRichard Henderson <rth@redhat.com>
Sun, 2 Jun 2002 08:35:51 +0000 (08:35 +0000)
        null when there are no got entries for a symbol.
        (elf64_alpha_relax_find_tls_segment): Rearrange to avoid
        uninitialized variable warning.

bfd/ChangeLog
bfd/elf64-alpha.c

index 87e62aff398503f71a548346a5265b5ed2f4c897..b768b0d5bfd602b45f665a105da3c821162e1d58 100644 (file)
@@ -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
index bdae249e63ab0a7522f1b5273f9e2a01aee48d58..8fcfeb3ac8ea23ee2336c52bd5c607f52decb954 100644 (file)
@@ -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;