6 static void bfd_fatal(const char *msg
)
8 fatal(msg
, bfd_errmsg(bfd_get_error()));
11 int check_and_print_undefined_symbols(const char *file
)
13 bfd_byte
*cur
, *minisyms
;
17 int there_are_undefined_syms
= 0;
24 (abfd
= bfd_openr(file
, "default")) == NULL
||
25 !bfd_check_format(abfd
, bfd_object
)
31 symcount
= bfd_read_minisymbols(abfd
, FALSE
, (void **)&minisyms
, &size
);
33 bfd_fatal (bfd_get_filename (abfd
));
38 store
= bfd_make_empty_symbol(abfd
);
40 bfd_fatal(bfd_get_filename(abfd
));
42 for (cur
= minisyms
; cur
< (minisyms
+ (symcount
* size
)); cur
+= size
)
46 sym
= bfd_minisymbol_to_symbol(abfd
, FALSE
, (const void *)cur
, store
);
48 bfd_fatal(bfd_get_filename (abfd
));
50 if (bfd_is_und_section (sym
->section
))
52 if (!there_are_undefined_syms
)
54 there_are_undefined_syms
= 1;
56 fprintf(stderr
, "There are undefined symbols in '%s':\n", bfd_get_filename(abfd
));
59 fprintf(stderr
, "%s\n", sym
->name
);
64 /* We should free() minisyms, but since we're called only once, we let the system
67 return there_are_undefined_syms
;
70 static void setfunc(bfd
*exe
, asection
*sect
, PTR setlist_ptr
)
72 parse_secname(sect
->name
, (setnode
**)setlist_ptr
);
75 void collect_sets(const char *file
, setnode
**setlist_ptr
)
83 (abfd
= bfd_openr(file
, "default")) == NULL
||
84 !bfd_check_format(abfd
, bfd_object
)
90 parse_format(abfd
->xvec
->name
);
91 bfd_map_over_sections(abfd
, setfunc
, setlist_ptr
);