[applied] btf-reader: Ignore BTF nodes that ought to be ignored

Message ID 87r0e9c1hn.fsf@redhat.com
State New
Headers
Series [applied] btf-reader: Ignore BTF nodes that ought to be ignored |

Commit Message

Dodji Seketeli May 10, 2024, 12:09 p.m. UTC
  Hello,

For now, the BTF nodes BTF_KIND_DECL_TAG, BTF_KIND_DATASEC, and
BTF_KIND_UNKN are ignored by libabigail, in practice.  We should thus
not abort when we encounter them.  Fixed thus.  Many thanks to Cestmir
Kalina for reporting this.

	* src/abg-btf-reader.cc (build_ir_node_from_btf_type): Ignore and
	return nil for node of kind BTF_KIND_DECL_TAG, BTF_KIND_DATASEC,
	and BTF_KIND_UNKN.  For all other nodes, abort.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-btf-reader.cc | 4 ++++
 1 file changed, 4 insertions(+)
  

Patch

diff --git a/src/abg-btf-reader.cc b/src/abg-btf-reader.cc
index f22e92bf..67206bb4 100644
--- a/src/abg-btf-reader.cc
+++ b/src/abg-btf-reader.cc
@@ -486,12 +486,16 @@  public:
 
 #ifdef WITH_BTF_KIND_TYPE_TAG
 	  case BTF_KIND_TYPE_TAG/* Type Tag */:
+	    break;
 #endif
 #ifdef WITH_BTF_KIND_DECL_TAG
 	  case BTF_KIND_DECL_TAG/* Decl Tag */:
+	    break;
 #endif
 	  case BTF_KIND_DATASEC/* Section */:
+	    break;
 	  case BTF_KIND_UNKN/* Unknown	*/:
+	    break;
 	  default:
 	    ABG_ASSERT_NOT_REACHED;
 	    break;