59 asymbol **symbol_table = NULL;
60 const char *symname =
"Dicos_loadModuleInfo";
69 section = bfd_get_section_by_name (abfd,
"header");
73 if (bfd_section_size (section) != header_size)
79 storage_needed = bfd_get_symtab_upper_bound (abfd);
80 if (storage_needed < 0)
82 warning (_(
"Can't read elf symbols from %s: %s"),
83 bfd_get_filename (abfd),
84 bfd_errmsg (bfd_get_error ()));
88 if (storage_needed > 0)
92 symbol_table = (asymbol **)
xmalloc (storage_needed);
93 symcount = bfd_canonicalize_symtab (abfd, symbol_table);
96 warning (_(
"Can't read elf symbols from %s: %s"),
97 bfd_get_filename (abfd),
98 bfd_errmsg (bfd_get_error ()));
101 for (i = 0; i < symcount; i++)
103 asymbol *sym = symbol_table[i];
104 if (sym->name != NULL
105 && symname[0] == sym->name[0]
106 && strcmp (symname + 1, sym->name + 1) == 0)
115 xfree (symbol_table);