sunos.c (94536) | sunos.c (104834) |
---|---|
1/* BFD backend for SunOS binaries. 2 Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 3 2002 4 Free Software Foundation, Inc. 5 Written by Cygnus Support. 6 7This file is part of BFD, the Binary File Descriptor library. 8 --- 703 unchanged lines hidden (view full) --- 712 713static struct bfd_link_hash_table * 714sunos_link_hash_table_create (abfd) 715 bfd *abfd; 716{ 717 struct sunos_link_hash_table *ret; 718 bfd_size_type amt = sizeof (struct sunos_link_hash_table); 719 | 1/* BFD backend for SunOS binaries. 2 Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 3 2002 4 Free Software Foundation, Inc. 5 Written by Cygnus Support. 6 7This file is part of BFD, the Binary File Descriptor library. 8 --- 703 unchanged lines hidden (view full) --- 712 713static struct bfd_link_hash_table * 714sunos_link_hash_table_create (abfd) 715 bfd *abfd; 716{ 717 struct sunos_link_hash_table *ret; 718 bfd_size_type amt = sizeof (struct sunos_link_hash_table); 719 |
720 ret = (struct sunos_link_hash_table *) bfd_alloc (abfd, amt); | 720 ret = (struct sunos_link_hash_table *) bfd_malloc (amt); |
721 if (ret == (struct sunos_link_hash_table *) NULL) 722 return (struct bfd_link_hash_table *) NULL; 723 if (! NAME(aout,link_hash_table_init) (&ret->root, abfd, 724 sunos_link_hash_newfunc)) 725 { | 721 if (ret == (struct sunos_link_hash_table *) NULL) 722 return (struct bfd_link_hash_table *) NULL; 723 if (! NAME(aout,link_hash_table_init) (&ret->root, abfd, 724 sunos_link_hash_newfunc)) 725 { |
726 bfd_release (abfd, ret); | 726 free (ret); |
727 return (struct bfd_link_hash_table *) NULL; 728 } 729 730 ret->dynobj = NULL; 731 ret->dynamic_sections_created = false; 732 ret->dynamic_sections_needed = false; 733 ret->got_needed = false; 734 ret->dynsymcount = 0; --- 694 unchanged lines hidden (view full) --- 1429 bucketcount = dynsymcount / 4; 1430 else if (dynsymcount > 0) 1431 bucketcount = dynsymcount; 1432 else 1433 bucketcount = 1; 1434 s = bfd_get_section_by_name (dynobj, ".hash"); 1435 BFD_ASSERT (s != NULL); 1436 hashalloc = (dynsymcount + bucketcount - 1) * HASH_ENTRY_SIZE; | 727 return (struct bfd_link_hash_table *) NULL; 728 } 729 730 ret->dynobj = NULL; 731 ret->dynamic_sections_created = false; 732 ret->dynamic_sections_needed = false; 733 ret->got_needed = false; 734 ret->dynsymcount = 0; --- 694 unchanged lines hidden (view full) --- 1429 bucketcount = dynsymcount / 4; 1430 else if (dynsymcount > 0) 1431 bucketcount = dynsymcount; 1432 else 1433 bucketcount = 1; 1434 s = bfd_get_section_by_name (dynobj, ".hash"); 1435 BFD_ASSERT (s != NULL); 1436 hashalloc = (dynsymcount + bucketcount - 1) * HASH_ENTRY_SIZE; |
1437 s->contents = (bfd_byte *) bfd_alloc (dynobj, hashalloc); | 1437 s->contents = (bfd_byte *) bfd_zalloc (dynobj, hashalloc); |
1438 if (s->contents == NULL && dynsymcount > 0) 1439 return false; | 1438 if (s->contents == NULL && dynsymcount > 0) 1439 return false; |
1440 memset (s->contents, 0, (size_t) hashalloc); | |
1441 for (i = 0; i < bucketcount; i++) 1442 PUT_WORD (output_bfd, (bfd_vma) -1, s->contents + i * HASH_ENTRY_SIZE); 1443 s->_raw_size = bucketcount * HASH_ENTRY_SIZE; 1444 1445 sunos_hash_table (info)->bucketcount = bucketcount; 1446 1447 /* Scan all the symbols, place them in the dynamic symbol table, 1448 and build the dynamic hash table. We reuse dynsymcount as a --- 1498 unchanged lines hidden --- | 1440 for (i = 0; i < bucketcount; i++) 1441 PUT_WORD (output_bfd, (bfd_vma) -1, s->contents + i * HASH_ENTRY_SIZE); 1442 s->_raw_size = bucketcount * HASH_ENTRY_SIZE; 1443 1444 sunos_hash_table (info)->bucketcount = bucketcount; 1445 1446 /* Scan all the symbols, place them in the dynamic symbol table, 1447 and build the dynamic hash table. We reuse dynsymcount as a --- 1498 unchanged lines hidden --- |