The recent fix to bug
21172433 caused all symbols with the external DWARF
attribute which appear in only one built-in module to be considered part of that
module rather than part of the core kernel as far as /proc/kallmodsyms is
concerned. Unfortunately, this is the wrong DWARF attribute to use: it
indicates that the content is visible outside this compilation unit, which
is of course true even of the definition of anything which *can* be
declared 'extern' (since it is, of course, not declared 'static').
The right attribute to use is the declaration attribute, which is unset only
for the definition -- the module containing the translation unit in which a
variable is defined is surely the module in which that variable resides.
Orabug:
21257163
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Acked-by: Kris Van Hees <kris.van.hees@oracle.com>
do {
if (((dwarf_tag(&toplevel) == DW_TAG_subprogram) ||
(dwarf_tag(&toplevel) == DW_TAG_variable)) &&
- !dwarf_hasattr(&toplevel, DW_AT_external)) {
+ !dwarf_hasattr(&toplevel, DW_AT_declaration)) {
if (module_idx == NULL) {
module_idx = malloc(sizeof(unsigned int));
if (module_idx == NULL) {