From: H.J. Lu Date: Wed, 20 Jun 2001 18:54:52 +0000 (+0000) Subject: 2001-06-20 H.J. Lu X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=161d71a6393454688d8c2bd2244e75ce9058b422;p=binutils-gdb.git 2001-06-20 H.J. Lu * elf32-i386.c (elf_i386_size_dynamic_sections): Always allocate local .got space. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2739ca4b986..32e923fff91 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2001-06-20 H.J. Lu + + * elf32-i386.c (elf_i386_size_dynamic_sections): Always + allocate local .got space. + 2001-06-19 Andreas Jaeger * 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 b79eb0d30c6..8388295d7b3 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; } }