aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2001-06-20 18:54:52 +0000
committerH.J. Lu <hjl.tools@gmail.com>2001-06-20 18:54:52 +0000
commit161d71a6393454688d8c2bd2244e75ce9058b422 (patch)
treece6b92980e9e6cc06087893b6ea3a7fe7452a865 /bfd/elf32-i386.c
parent1ad63b2f000e4fea64a8fa6a11a3015aadd6e8fe (diff)
downloadgdb-161d71a6393454688d8c2bd2244e75ce9058b422.zip
gdb-161d71a6393454688d8c2bd2244e75ce9058b422.tar.gz
gdb-161d71a6393454688d8c2bd2244e75ce9058b422.tar.bz2
2001-06-20 H.J. Lu <hjl@gnu.org>
* elf32-i386.c (elf_i386_size_dynamic_sections): Always allocate local .got space.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c58
1 files changed, 29 insertions, 29 deletions
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;
}
}