aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-07-01 14:53:40 +0000
committerNick Clifton <nickc@redhat.com>2004-07-01 14:53:40 +0000
commit7a2a69431264c4cb96ec5acab71fd2ba6d9c5f59 (patch)
tree0cc4f95901c3db45efb0be08dddeee2900b89f72
parentcdd3575c2204443be4e4ad258d61bac6c7f2f337 (diff)
downloadgdb-7a2a69431264c4cb96ec5acab71fd2ba6d9c5f59.zip
gdb-7a2a69431264c4cb96ec5acab71fd2ba6d9c5f59.tar.gz
gdb-7a2a69431264c4cb96ec5acab71fd2ba6d9c5f59.tar.bz2
(_bfd_mips_elf_final_link): Pass the correct number of section symbols to
mips_elf_sort_hash_table ().
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elfxx-mips.c22
2 files changed, 24 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c00435a..fdd44e7 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2004-07-01 Jie Zhang <zhangjie@magima.com.cn>
+ Nick Clifton <nickc@redhat.com>
+
+ PR 204
+ * elfxx-mips.c (_bfd_mips_elf_final_link): Pass the correct number
+ of section symbols to mips_elf_sort_hash_table ().
+
2004-07-01 Alan Modra <amodra@bigpond.net.au>
* elflink.c (elf_section_ignore_discarded_relocs): Revert last
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index b819273..a18ac84 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -8082,8 +8082,8 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
asection *rtproc_sec;
Elf32_RegInfo reginfo;
struct ecoff_debug_info debug;
- const struct ecoff_debug_swap *swap
- = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct ecoff_debug_swap *swap = bed->elf_backend_ecoff_debug_swap;
HDRR *symhdr = &debug.symbolic_header;
void *mdebug_handle = NULL;
asection *s;
@@ -8111,6 +8111,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
bfd *dynobj;
asection *got;
struct mips_got_info *g;
+ bfd_size_type dynsecsymcount;
/* When we resort, we must tell mips_elf_sort_hash_table what
the lowest index it may use is. That's the number of section
@@ -8118,9 +8119,20 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
adds these symbols when building a shared object. Note that
we count the sections after (possibly) removing the .options
section above. */
- if (! mips_elf_sort_hash_table (info, (info->shared
- ? bfd_count_sections (abfd) + 1
- : 1)))
+
+ dynsecsymcount = 0;
+ if (info->shared)
+ {
+ asection * p;
+
+ for (p = abfd->sections; p ; p = p->next)
+ if ((p->flags & SEC_EXCLUDE) == 0
+ && (p->flags & SEC_ALLOC) != 0
+ && !(*bed->elf_backend_omit_section_dynsym) (abfd, info, p))
+ ++ dynsecsymcount;
+ }
+
+ if (! mips_elf_sort_hash_table (info, dynsecsymcount + 1))
return FALSE;
/* Make sure we didn't grow the global .got region. */