Bug 18941 - Add a warning option to libabigail tools to report possible DWARF issues
Summary: Add a warning option to libabigail tools to report possible DWARF issues
Status: NEW
Alias: None
Product: libabigail
Classification: Unclassified
Component: default (show other bugs)
Version: unspecified
: P2 enhancement
Target Milestone: ---
Assignee: Dodji Seketeli
URL:
Keywords:
Depends on: 20937
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-09 14:51 UTC by Dodji Seketeli
Modified: 2016-12-06 12:43 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dodji Seketeli 2015-09-09 14:51:19 UTC
Sometimes it's interesting to raise awareness about some noticeable constructs found in the debug information of the binary we are interested in.

For instance, there can be situations where a library does not have any debug information for a class because the compiler knows that it will be emitted along with the vtable in another library.  In that case, only a simple forward declaration is found for the class in the current library.

This is fine for debugging, but interferes with ABI verification.

In this case, it would be useful that abidiff, abidw or other related tools emit a clear diagnostic about the situation.  The library maintainer could deal with the issue by using e.g the -femit-class-debug-always option of the G++ where she sees fit.
Comment 1 Dodji Seketeli 2015-10-07 07:04:54 UTC
We'd also like to detect possible ODR violations, now that libabigail knows about ODR (https://en.wikipedia.org/wiki/One_Definition_Rule).
Comment 2 Ben Woodard 2016-01-21 16:16:57 UTC
Many of the cases which I think need warnings are more prosaic.

If it comes along a case where the DWARF has been stripped or was never generated, then most if not all of the ABI verification is not being done. This should be a higher priority warning. This could also remind people to point the libabigail utilities toward an external debuginfo file. I would say that this is a high enough priority that it should be the default unless some --quiet option is passed on the command line.

A lower priority warning would be a exported function entry point for a non-static function that exists in ELF but doesn't exist in the available DWARF. This is important because we need to know the things that we are not yet examining. I thought the option should be something like -Wunexamined-functions

A similar situation is the one you mention where you have a forward declaration but no information about the class. -Wunexamined-classes

I think that -Wunions probably should be there too. This would trip if libabigail found any unions in the DWARF and emit the union's name for manual verification. I do not recall seeing this in the release notes. We should probably have a note saying that unions are not examined for ABI compatibility in the release notes.

And finally because the number of these warnings will likely grow over time we should probably have something like:
-W which turns on common problems
-Wall which turns on every single warning.
Comment 3 Dodji Seketeli 2016-12-06 12:43:04 UTC
(In reply to dodji from comment #1)
> We'd also like to detect possible ODR violations, now that libabigail knows
> about ODR (https://en.wikipedia.org/wiki/One_Definition_Rule).

I have filled enhancement request #20937 to track this specifically as it's a request that has come up on several occasions.