> That of course is an invalid .debug_info section, but there really is no > reason for gas to output the .debug_line section since there was no > explicit .debug_line sections, nor where there any .loc or .line > directives.
You mean any .loc or two-operand .file directives. > So, the bug is in gas. I cannot immediately think of how to trick gcc > itself into producing this bug. But if this gas bug is fixed we might > need to fix gcc to not unconditionally produce a DW_AT_line_stmt_list > for the CU. Yes, it could emit DW_AT_stmt_list only if it ever emitted a two-operand .file directive. I think the only situation in which it would ever fail to emit one of those is a file that does not define anything at all (i.e. empty or containing only type and extern declarations). That is sufficiently rare and meaningless that it doesn't seem really worth giving gcc a special case for it. If anything, I'd almost consider it a feature if gcc *did* emit .file 1 "empty.c" for an empty file--then you get DWARF data that lists each and every source file that was compiled, so that things like the rpmbuild procedure that copies sources into /usr/src/debug would include some file of #include's and macros and whatnot that led to defining nothing. (Though I'm not really convinced that would actually be a feature, it just came to mind.) Thanks, Roland _______________________________________________ elfutils-devel mailing list [email protected] https://fedorahosted.org/mailman/listinfo/elfutils-devel
