mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
af3768e945
When searching static symbols, gdb would search over all expanded symtabs of all objfiles, and if that fails only then would it search all partial/gdb_index tables of all objfiles. This means that the user could get a random instance of the symbol depending on what symtabs have been previously expanded. Now the search is consistent, searching each objfile completely before proceeding to the next one. gdb/ChangeLog: PR symtab/17564 * symtab.c (lookup_symbol_in_all_objfiles): Delete. (lookup_static_symbol): Move definition to new location and rewrite. (lookup_symbol_in_objfile): New function. (lookup_symbol_global_iterator_cb): Call it. gdb/testsuite/ChangeLog: PR symtab/17564 * gdb.base/symtab-search-order.exp: New file. * gdb.base/symtab-search-order.c: New file. * gdb.base/symtab-search-order-1.c: New file. * gdb.base/symtab-search-order-shlib-1.c: New file.
12 lines
220 B
C
12 lines
220 B
C
extern int shlib_1_func (void);
|
|
|
|
int
|
|
main ()
|
|
{
|
|
/* We need a reference to shlib_1_func to make sure its shlib is
|
|
not discarded from the link. This happens on windows. */
|
|
int x = shlib_1_func ();
|
|
|
|
return 0;
|
|
}
|