2001-06-20 H.J. Lu <hjl@gnu.org>
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 20 Jun 2001 18:54:52 +0000 (18:54 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 20 Jun 2001 18:54:52 +0000 (18:54 +0000)
* elf32-i386.c (elf_i386_size_dynamic_sections): Always
allocate local .got space.

bfd/ChangeLog
bfd/elf32-i386.c

index 2739ca4b9864460c72c9c27646b8021c37325533..32e923fff9189f5ff505c29689a7bbc38e2fdd2d 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-20  H.J. Lu  <hjl@gnu.org>
+
+       * elf32-i386.c (elf_i386_size_dynamic_sections): Always
+       allocate local .got space.
+
 2001-06-19  Andreas Jaeger  <aj@suse.de>
 
        * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix creation of
index b79eb0d30c63b396eeac7b9dcb563db2523a8894..8388295d7b3a0d2e4103cc0349812ea51a4c389d 100644 (file)
@@ -1190,6 +1190,7 @@ elf_i386_size_dynamic_sections (output_bfd, info)
   asection *s;
   boolean relocs;
   boolean reltext;
+  bfd *i;
 
   htab = elf_i386_hash_table (info);
   dynobj = htab->root.dynobj;
@@ -1197,7 +1198,6 @@ elf_i386_size_dynamic_sections (output_bfd, info)
 
   if (htab->root.dynamic_sections_created)
     {
-      bfd *i;
 
       /* Set the contents of the .interp section to the interpreter.  */
       if (! info->shared)
@@ -1207,40 +1207,40 @@ elf_i386_size_dynamic_sections (output_bfd, info)
          s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
          s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
        }
+    }
 
-      /* Set up .got offsets for local syms.  */
-      for (i = info->input_bfds; i; i = i->link_next)
-       {
-         bfd_signed_vma *local_got;
-         bfd_signed_vma *end_local_got;
-         bfd_size_type locsymcount;
-         Elf_Internal_Shdr *symtab_hdr;
-         asection *srel;
+  /* Set up .got offsets for local syms.  */
+  for (i = info->input_bfds; i; i = i->link_next)
+    {
+      bfd_signed_vma *local_got;
+      bfd_signed_vma *end_local_got;
+      bfd_size_type locsymcount;
+      Elf_Internal_Shdr *symtab_hdr;
+      asection *srel;
 
-         if (bfd_get_flavour (i) != bfd_target_elf_flavour)
-           continue;
+      if (bfd_get_flavour (i) != bfd_target_elf_flavour)
+       continue;
 
-         local_got = elf_local_got_refcounts (i);
-         if (!local_got)
-           continue;
+      local_got = elf_local_got_refcounts (i);
+      if (!local_got)
+       continue;
 
-         symtab_hdr = &elf_tdata (i)->symtab_hdr;
-         locsymcount = symtab_hdr->sh_info;
-         end_local_got = local_got + locsymcount;
-         s = htab->sgot;
-         srel = htab->srelgot;
-         for (; local_got < end_local_got; ++local_got)
+      symtab_hdr = &elf_tdata (i)->symtab_hdr;
+      locsymcount = symtab_hdr->sh_info;
+      end_local_got = local_got + locsymcount;
+      s = htab->sgot;
+      srel = htab->srelgot;
+      for (; local_got < end_local_got; ++local_got)
+       {
+         if (*local_got > 0)
            {
-             if (*local_got > 0)
-               {
-                 *local_got = s->_raw_size;
-                 s->_raw_size += 4;
-                 if (info->shared)
-                   srel->_raw_size += sizeof (Elf32_External_Rel);
-               }
-             else
-               *local_got = (bfd_vma) -1;
+             *local_got = s->_raw_size;
+             s->_raw_size += 4;
+             if (info->shared)
+               srel->_raw_size += sizeof (Elf32_External_Rel);
            }
+         else
+           *local_got = (bfd_vma) -1;
        }
     }