GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CAdapt/README_en.md at main · KongQBin/CAdapt

Expand file tree

/

README_en.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
71 lines (49 loc) · 4.73 KB
/

README_en.md

Copy path

File metadata and controls

71 lines (49 loc) · 4.73 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

English · 简体中文 · 繁體中文 · 日本語

CI

GLIBC & KMOD Symbol Version Adapter (CAdapt)

CAdapt patches ELF metadata on Linux to adjust symbol version requirements in compiled programs, shared libraries and kernel modules. It targets cases where ABI compatibility has already been established but version metadata prevents execution or loading.

Features

  • GLIBC: Read symbol versions from a supplied libc.so.6 and adapt one ELF file or a directory. Keep the original version when available and preserve hidden symbol markers.
  • KMOD: Modify .ko vermagic and symbol CRCs in the traditional __versions format.
  • 32-bit and multiple candidates: Both 32-bit and 64-bit little-endian ELF files are supported. -c (libc) and -i (interpreter) may be repeated (e.g. one 32-bit and one 64-bit each); every target picks the matching candidate by class, endianness and machine, so a directory may mix both. A target with no matching libc/interpreter is warned about and skipped; big-endian ELF files are not yet supported and are warned about and skipped. 32-bit kernel modules use 4-byte CRCs in __versions; when a target module's machine differs from the running system while symbol CRCs or vermagic come from that system, the change is warned about and refused.

Build and test

Requires Linux, a GNU++11-capable C++ compiler and CMake 3.5+. Tests also require Python 3.7+ and cc.

cmake -S . -B build -DCADAPT_STRICT=ON
cmake --build build
ctest --test-dir build --output-on-failure

The language standard is fixed to GNU++11. CADAPT_STRICT=ON treats compiler warnings and language extensions as errors. Add -DBUILD_TESTING=OFF to build the tool without Python. With older CMake, run cmake .. and ctest inside the build directory. Build against the appropriate GLIBC/sysroot when targeting older systems.

Usage

./build/cadapt -h

# GLIBC
./build/cadapt -c /path/to/libc.so.6 -t /path/to/target_elf_or_directory

# KMOD
./build/cadapt -m ./my_driver.ko -s ./Module.symvers \
  -v "4.18.0-193.el8.x86_64 SMP mod_unload"

# Mixed directory: 32-bit and 64-bit targets each match their own libc/interpreter
./build/cadapt -c /lib/libc.so.6 -c /lib64/libc.so.6 -t ./mixed_dir
./build/cadapt -i /lib/ld-linux.so.2 -i /lib64/ld-linux-x86-64.so.2 -t ./mixed_dir

Options and behavior

  • With -s/--symvers, CRCs come exclusively from that file; missing symbols do not silently fall back to the running kernel.
  • Without -s or -v, collect CRCs or vermagic from current system modules on demand. An explicit vermagic must match the source of system CRCs. For another kernel, supply its Module.symvers and vermagic.
  • KMOD writes begin only after all validation passes; validation failures leave the target unchanged. Synchronization failures return failure, but do not guarantee rollback of written data.
  • Directory scans skip symbolic links. Help returns 0; invalid arguments or adaptation failures return a nonzero exit code.

Review, fixes and validation

On 2026-10-12, OpenAI Codex assisted a round of code review, fixes and regression validation. The changes are recorded in the commit history, with 4af3cbc as the validation baseline.

  • Strict GNU++11 builds passed locally with GCC 9.5 and GCC 15.2, and all eight CTest checks passed.
  • Coverage includes CLI behavior, GLIBC version selection and hidden bits, KMOD CRC/source conflicts, malformed ELF files, scan/synchronization failures, logging and resource ownership.
  • Regression scripts are in tests/; the CI workflow is in ci.yml. The badge above shows the remote workflow status.

This records AI-assisted review and observed test results; it is not an official OpenAI certification or a guarantee of compatibility with arbitrary files or ABIs.

Supported formats and risks

  • Supports 32-bit and 64-bit little-endian ELF with section headers. Big-endian files and extended section numbering are unsupported.
  • Extended KMOD sections __version_ext_names / __version_ext_crcs are explicitly rejected.
  • Files are modified in place: back them up first. Metadata changes cannot check or repair ABI differences; applications may still crash and incompatible kernel modules may cause Kernel Panic/Oops.
  • Errors go to cadaptErrlog.txt beside the executable, or stderr if the log cannot be written.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.