When analyzing C binaries, the redundant type detector only looks at the kind of the type, its name and its location. That is, if a struct named foo and defined at file blah.c, line 5 column 1 is seen twice, the second occurrence of that type is considered to be a duplicate of the first one. So the internal representation of the first occurrence of the type is re-used instead of constructing an internal representation for the second type as well. But then, it can happen that the first struct foo defined in file blah.c:5:1 is *different* (has a different layout, size or whatever) from the second occurrence of foo defined at the *same* location. In that case, today, libabigail wrongly drops the second occurrence. The goal of this enhancement request is to improve the redundant type detector to make it actually compare the DIEs of the two "struct foo", to see if they are equal. The redundant type detector would still index those types using their name and kind. But it would associate the name of the type to a vector of types having the same name.
I think we'd even need to code a comparison engine that can compare a DIE with an ABI artefact living in the abigail::ir namespace.
So I have implemented a fix for this in the dodji/kabidiff branch in commit https://sourceware.org/git/gitweb.cgi?p=libabigail.git;a=commit;h=f88ecac536024c6b70a605f0c1e0cc662a26914e. So, here, to detect that two type DIEs of the same name and kind are different, there are compared structurally (member-wise and recursively). So we wrote an additional comparison-engine that operates in DIEs directly and de-duplicates them before creating and IR for them. This is hopefully going to be merged into master soon.
This has been merged into master at https://sourceware.org/git/gitweb.cgi?p=libabigail.git;a=commit;h=b555713b4792f7892b9e03a51c9059a5e1f9fdd2