Fix latent bug in Ada import symbol handling
The code in dwarf2/read.c:new_symbol that handles Ada 'import' symbols
has a bug. It uses the current scope, which by default this is the
file scope -- even for a global symbol like:
<1><1186>: Abbrev Number: 4 (DW_TAG_variable)
<1187> DW_AT_name : (indirect string, offset: 0x1ad2): pkg__imported_var_ada
...
<1196> DW_AT_external : 1
This disagrees with the scope computed by the DWARF indexer.
Now, IMO new_symbol and its various weirdness really has to go. And,
ideally, this information would come from the indexer rather than
perhaps being erroneously recomputed. But meanwhile, this patch fixes
the issue at hand.
This came up while working on another change that exposes the bug.
Reviewed-By: Tom de Vries <tdevries@suse.de>
1 file changed