aboutsummaryrefslogtreecommitdiff
path: root/bfd/som.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-02-22 00:01:34 +0000
committerIan Lance Taylor <ian@airs.com>1994-02-22 00:01:34 +0000
commit2ab0b7f3e3b513899b5f0c0ff9d396b261310bc8 (patch)
tree8a5a01c15fb4bfa8c9027bd384a4b092f892f032 /bfd/som.c
parentef76742fc5cd3885488abe7c2f4fb8a3f8cba72c (diff)
downloadgdb-2ab0b7f3e3b513899b5f0c0ff9d396b261310bc8.zip
gdb-2ab0b7f3e3b513899b5f0c0ff9d396b261310bc8.tar.gz
gdb-2ab0b7f3e3b513899b5f0c0ff9d396b261310bc8.tar.bz2
* som.c (som_bfd_count_ar_symbols): Use a pointer and alloca
rather than an array of variable size. (som_bfd_fill_in_ar_symbols): Likewise. (som_bfd_ar_write_symbol_stuff): Likewise.
Diffstat (limited to 'bfd/som.c')
-rw-r--r--bfd/som.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/bfd/som.c b/bfd/som.c
index e82143a..baae80f 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -4250,7 +4250,8 @@ som_bfd_count_ar_symbols (abfd, lst_header, count)
symindex *count;
{
unsigned int i;
- unsigned int hash_table[lst_header->hash_size];
+ unsigned int *hash_table =
+ (unsigned int *) alloca (lst_header->hash_size * sizeof (unsigned int));
file_ptr lst_filepos = bfd_tell (abfd) - sizeof (struct lst_header);
/* Don't forget to initialize the counter! */
@@ -4327,8 +4328,11 @@ som_bfd_fill_in_ar_symbols (abfd, lst_header, syms)
{
unsigned int i, len;
carsym *set = syms[0];
- unsigned int hash_table[lst_header->hash_size];
- struct som_entry som_dict[lst_header->module_count];
+ unsigned int *hash_table =
+ (unsigned int *) alloca (lst_header->hash_size * sizeof (unsigned int));
+ struct som_entry *som_dict =
+ (struct som_entry *) alloca (lst_header->module_count
+ * sizeof (struct som_entry));
file_ptr lst_filepos = bfd_tell (abfd) - sizeof (struct lst_header);
/* Read in the hash table. The has table is an array of 32bit file offsets
@@ -4685,9 +4689,14 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst)
char *strings, *p;
struct lst_symbol_record *lst_syms, *curr_lst_sym;
bfd *curr_bfd = abfd->archive_head;
- unsigned int hash_table[lst.hash_size];
- struct som_entry som_dict[lst.module_count];
- struct lst_symbol_record *last_hash_entry[lst.hash_size];
+ unsigned int *hash_table =
+ (unsigned int *) alloca (lst.hash_size * sizeof (unsigned int));
+ struct som_entry *som_dict =
+ (struct som_entry *) alloca (lst.module_count
+ * sizeof (struct som_entry));
+ struct lst_symbol_record **last_hash_entry =
+ ((struct lst_symbol_record **)
+ alloca (lst.hash_size * sizeof (struct lst_symbol_record *)));
unsigned int curr_som_offset, som_index;
/* Lots of fields are file positions relative to the start