Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

What's new in Libabigail 2.0

January 6, 2022
Dodji Seketeli
Related topics:
CompilersC, C#, C++Linux
Related products:
Red Hat Enterprise Linux

Share:

    Libabigail is a framework dedicated to analyzing changes to application binary interfaces (ABIs) in ELF binaries. Libabigail 2.0, the latest major release of the framework, was released in October of 2021.

    This article is a tour of the main changes delivered in this major release. You'll learn about changes to the core library to start, then move on to updates to specific ABI analysis tools and the library's licensing terms.

    New symbol table reader component

    The ELF/DWARF front end of the Libabigail core library was refactored to use a new ELF symbol table reader module. This new module was factorized out of the front end and designed as a standalone module in its own namespace, dubbed symtab_reader. That new namespace contains various components that collaborate to provide a consistent view over a symbol table that can be loaded and queried.

    One main feature of the new symtab_reader is that it transparently handles the different binary formats of symbol tables of the Linux kernel, as well as details like relocations, symbol namespaces, call frame information indirections, and differences between vmlinux binaries and kernel modules. It also incorporates Libabigail's existing support for the specifics of the PPC64 ELF symbol tables.

    symtab_reader is now used by the DWARF/ELF reader front end during the analysis of binaries, and enhances the maintainability of the code base as a whole.

    Correctness of type canonicalization

    One of the many constraints that Libabigail has to deal with is that ABI comparison has to be fast enough to be useful. In essence, however, comparing aggregate types of arbitrary size and depth is a quadratic problem, so naively attempting to compare types coming from real-life C or C++ binaries can literally take hours on the average workstation.

    Libabigail uses a certain number of heuristics to complete those type comparisons in a reasonable time. One of those heuristics is the type canonicalization optimization.

    Intuitively, the time taken by the comparison of two aggregate types of size N is proportional to N2—and that same amount of time is spent whenever those two types are compared. The goal of the type canonicalization optimization is to transform that N2 time back into a (relatively short) constant time. In terms of processing, the first comparison between those two types would still take a time proportional to N2; but all subsequent comparisons would then be performed in that shorter amount of time. This type canonicalization optimization is vital because slow comparisons can make the framework effectively unusable.

    In Libabigail 2.0, this optimization is more precise and robust. It now works better with anonymous types, and several general bugs have been addressed. The correctness of type change detection has thus been improved.

    Support for DWARF 5

    Support for version 5 of DWARF has been improved in Libabigail 2.0. As a consequence, binaries emitted by GCC 11 and Clang 13 that use DWARF 5 are now fairly well supported.

    Debugging and bug fixes

    A number of debugging primitives have been introduced to ease the inspection of the internal representation of types while debugging Libabigail using a debugger like GDB. This makes it significantly easier to debug issues that involve type representation in the framework.

    Several bugs have been fixed throughout the framework, leading to better support for ELF aliased symbols, improved support for multi-language binaries, improved filtering of data member offset changes, better sorting of anonymous types in ABIXML files, better handling of member functions changes in union types, and improved support for function parameter addition detection.

    Updates to abidw

    abidw now emits ABIXML files in a new format, dubbed version 2.0.

    Due to a change in the interpretation of DWARF 5's DW_AT_bit_offset attribute in this version of Libabigail, the value of the offset of data members might have changed in an incompatible way, which has driven the change in the ABIXML format. Libabigail can still read ABIXML files in the previous 1.0 format, though.

    Updates to abipkgdiff

    abipkgdiff should now properly show binary files that were either added to or removed from packages. It also stops erasing the working directory used for binary comparison before it's done using their content. The source code of this tool was fixed to prevent some compilation warnings.

    Updates to abidiff

    Libabigail 2.0 includes general bug fixes in abidiff. Data members are no longer qualified in diff reports. The --dump-diff-tree option now works in the leaf reporting mode.

    abidiff has also been modified to accommodate the ABIXML format change. abidiff will refuse to compare a file written ABIXML 1.0 against one written in ABIXML 2.0; the two files must have the same version number. Note that you can always regenerate an ABIXML 2.0 file from its originating ELF binary using the current abidw tool.

    Move to the Apache 2 license

    Libabigail's codebase is now licensed under the Apache 2 license, with the LLVM exception. It was previously licensed under version 3 of the LGPL. This license change means that the Libabigail library is now compatible with most copyleft and non-copyleft code, increasing the amount of the code that can use the Libabigail library to perform ABI analysis.

    Move to C++11

    Libabigail's source code is now written in C++11, at long last. As we need to make sure the framework builds on the Red Hat Enterprise Linux 7 platform, we intend to stick with C++11 for the rest of the expected lifetime of that platform—meaning at least until June of 2024. After that date, we'll consider moving the source base to a more modern version of the C++ language.

    Find out more about Libabigail 2.0

    We hope you enjoyed this tour of the changes in Libabigail 2.0. If you are interested in learning more about the project, you can get involved with our mailing list. Libabigail users and developers are also available on the irc.oftc.net IRC network, in the #libabigail channel. We'd be happy to see you there!

    Related Posts

    • How to write an ABI compliance checker using Libabigail

    • Changes made to the Libabigail ABI change analysis framework in 2018

    • Comparing ABIs for Compatibility with libabigail - Part 2

    • Comparing ABIs for Compatibility with libabigail - Part 1

    Recent Posts

    • GuideLLM: Evaluate LLM deployments for real-world inference

    • Unleashing multimodal magic with RamaLama

    • Integrate Red Hat AI Inference Server & LangChain in agentic workflows

    • Streamline multi-cloud operations with Ansible and ServiceNow

    • Automate dynamic application security testing with RapiDAST

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue