aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-i386.c58
2 files changed, 34 insertions, 29 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2739ca4..32e923f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index b79eb0d..8388295 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -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;
}
}