diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2006-09-12 22:10:31 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2006-09-12 22:10:31 +0000 |
commit | 41198d0cfa94b0197dc8bdfb9542ad55ce980850 (patch) | |
tree | 793f1aeedaa770464a7da60d4d7cbfab4d803cde /bfd/elflink.c | |
parent | cd269619269e6b7700e65e194d1a05288f87f928 (diff) | |
download | gdb-41198d0cfa94b0197dc8bdfb9542ad55ce980850.zip gdb-41198d0cfa94b0197dc8bdfb9542ad55ce980850.tar.gz gdb-41198d0cfa94b0197dc8bdfb9542ad55ce980850.tar.bz2 |
bfd/
2006-09-12 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3197
* elflink.c (elf_link_output_extsym): Compute bucket only if
needed.
ld/testsuite/
2006-09-12 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3197
* ld-elf/hash.d: New test.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r-- | bfd/elflink.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c index d3f9b62..a1bc864 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -7061,8 +7061,6 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data) if (h->dynindx != -1 && elf_hash_table (finfo->info)->dynamic_sections_created) { - size_t bucketcount; - size_t bucket; bfd_byte *esym; sym.st_name = h->dynstr_index; @@ -7074,14 +7072,16 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data) } bed->s->swap_symbol_out (finfo->output_bfd, &sym, esym, 0); - bucketcount = elf_hash_table (finfo->info)->bucketcount; - bucket = h->u.elf_hash_value % bucketcount; - if (finfo->hash_sec != NULL) { size_t hash_entry_size; bfd_byte *bucketpos; bfd_vma chain; + size_t bucketcount; + size_t bucket; + + bucketcount = elf_hash_table (finfo->info)->bucketcount; + bucket = h->u.elf_hash_value % bucketcount; hash_entry_size = elf_section_data (finfo->hash_sec)->this_hdr.sh_entsize; |