rea-reverse

Check an ELF Binary’s GLIBC Requirements Without Running It

Written for REA 6.10.1Published by rea-reverseUpdated 4 min read
On this page

A GLIBC_2.28 not found message points at a versioned symbol requirement, not merely a missing file called libc.so.6. Finding that filename on the machine is not enough: the loader must also find the required symbol versions in the library it actually selects.

You can examine those declarations without running the program. Here we inspect the official Node.js 26.12.1 Linux x64 binary on macOS, identify its libraries and version requirements, then cross-check them with an independent ELF reader. We do not reproduce a Linux loader failure or claim that this binary runs on our Mac.

We tested REA 6.10.1, Node 26.12.1 for the analysis CLI, Python 3.14 and pyelftools 0.32. REA requires Node ^22.23.4 || ^24.22.1 || >=26.12.1; set up the CLI first. The analysis runtime and the downloaded Linux target are separate binaries.

Check ELF GLIBC and GLIBCXX requirements without executionSilent walkthrough with English captions.

Download and identify a real Linux binary

Use a pinned official release and compare the archive with the checksum published alongside it. This checks the download against Node’s published digest; the script does not verify a release signature.

mkdir elf-review
cd elf-review
base=https://nodejs.org/dist/v26.12.1
curl -fL "$base/node-v26.12.1-linux-x64.tar.xz" -o node.tar.xz
curl -fL "$base/SHASUMS256.txt" -o SHASUMS256.txt
python3 - <<'CHECK'
import hashlib, tarfile
from pathlib import Path
name = 'node-v26.12.1-linux-x64.tar.xz'
expected = next(line.split()[0] for line in Path('SHASUMS256.txt').read_text().splitlines()
                if line.split()[-1] == name)
assert hashlib.sha256(Path('node.tar.xz').read_bytes()).hexdigest() == expected
with tarfile.open('node.tar.xz') as archive:
    item = archive.getmember('node-v26.12.1-linux-x64/bin/node')
    Path('node-linux').write_bytes(archive.extractfile(item).read())
print(Path('node-linux').stat().st_size)
CHECK

The archive’s SHA-256 was 6170b2d474e1c626f43cff3adc118df9fe3b573258a4fc3d850c8dbc6b079bbd. The extracted executable was 150,319,168 bytes, with SHA-256 08f12d42fb304468e8ee86247fe686aae5b225836ea65e9d6566c11ae6ba2e8e. Nothing here invokes that target. The extraction writes only the explicitly selected archive member.

Read the interpreter, needed libraries and coverage

The executable exceeds REA’s default 64 MiB input allowance. We deliberately allow 256 MiB for this selected file; increasing the input allowance does not remove the other analysis limits.

rea inspect-elf-dependencies node-linux --max-file-bytes 268435456 --json > dependencies.json
python3 - <<'CHECK'
import json
r = json.load(open('dependencies.json'))['normalized_result']
print(r['architecture'], r['type_name'], r['interpreter']['path'])
print(r['coverage'], r['issues'])
print([x['name'] for x in r['needed']])
for item in r['derived_version_maxima']:
    print(item['namespace'], item['maximum'], item['evidence_kind'])
CHECK

The result identifies an amd64 ELF executable with interpreter /lib64/ld-linux-x86-64.so.2. Its eight DT_NEEDED names, in table order, are libatomic.so.1, libdl.so.2, libm.so.6, libstdc++.so.6, libgcc_s.so.1, libpthread.so.0, libc.so.6 and ld-linux-x86-64.so.2.

These are declarations from the selected file. REA does not search the host for those names, expand loader paths or claim they were found. In this sample, RPATH and RUNPATH are absent. An interpreter path is likewise a recorded string, not a successful lookup on our macOS system.

Coverage was complete, with eight needed entries, 59 examined version records, 701 undefined dynamic imports and no issues. Check that status before using the derived summary; an unreadable version table cannot safely become an empty requirement list.

Follow the GLIBC maximum back to actual imports

The derived maxima were GLIBC_2.28, GLIBCXX_3.4.21, CXXABI_1.3.11, GCC_4.2.0 and LIBATOMIC_1.0. GLIBCXX and GLIBC are different namespaces: a libc upgrade alone does not answer a missing libstdc++ version requirement.

A maximum is a convenient lead. The import rows explain which declarations led to it:

python3 - <<'CHECK'
import json
r = json.load(open('dependencies.json'))['normalized_result']
for item in r['imports']:
    version = item['version']
    if version.get('name') == 'GLIBC_2.28':
        print(item['index'], item['name'], item['binding'], version['file'], version['status'])
CHECK

Our output contains index 41, fcntl64, a global import; and index 404, statx, a weak import. Both resolve in the metadata to libc.so.6 and GLIBC_2.28. Here “resolved” means the version-index join found a matching requirement record inside the ELF. It does not mean a symbol was resolved by a running dynamic loader.

The maximum compares GNU-style numeric version labels and is explicitly marked derived. Weak symbols, other required namespaces, architecture, the selected loader and the target environment all matter. Treat GLIBC_2.28 as an observed requirement label in this file, not a complete compatibility certificate or a promise that installing any glibc package with that number will make the program run.

Cross-check with a second ELF parser

This optional check installs pyelftools into a disposable Python environment. It compares all eight library names, every required version label and all 701 undefined symbol indices/names with REA’s output. It reads bytes and does not call ldd or execute Node.

python3 -m venv check-env
check-env/bin/python -m pip install pyelftools==0.32
check-env/bin/python - <<'CHECK'
import json
from elftools.elf.elffile import ELFFile
r = json.load(open('dependencies.json'))['normalized_result']
with open('node-linux', 'rb') as source:
    elf = ELFFile(source)
    needed = [t.needed for t in elf.get_section_by_name('.dynamic').iter_tags()
              if t.entry.d_tag == 'DT_NEEDED']
    assert needed == [x['name'] for x in r['needed']]
    versions = sorted((v.name, a.name) for v, aux in
                      elf.get_section_by_name('.gnu.version_r').iter_versions() for a in aux)
    assert versions == sorted((v['file'], a['name']) for v in
                              r['version_requirements']['files'] for a in v['versions'])
    imports = [(i, s.name) for i, s in enumerate(elf.get_section_by_name('.dynsym').iter_symbols())
               if i and s.entry.st_shndx == 'SHN_UNDEF']
    assert imports == [(s['index'], s['name']) for s in r['imports']]
print('DT_NEEDED, required version labels and undefined symbol rows agree')
CHECK

The three comparisons passed. This gives us an independent check of the declarations, rather than relying on a strings match that might find unrelated text. It still does not test runtime library search order or prove that a remote deployment has those libraries.

To see why a process exit code alone is insufficient, deliberately lower the needed-entry budget:

rea inspect-elf-dependencies node-linux --max-file-bytes 268435456 --max-needed 1 --json > limited.json

That command exits with a resource-policy refusal instead of returning a successful one-library inventory. Keep the error as evidence that the analysis did not complete. Do not interpret the truncated or failed run as proof that only one dependency exists.

Turn the inventory into a deployment question

For a reported loader error, preserve the exact target digest, interpreter, needed library, requirement label and the import that refers to it. Then compare those facts with the libraries and loader in the actual failing environment. If the target is untrusted, keep static inspection separate from any decision to execute it.

The reader does not include dependencies of dependencies, detect every library opened through dlopen, or test OS and CPU compatibility. A static binary with no dynamic table can have an empty load-time inventory; that is a different result from a parser failure. A shared-library filename by itself is not the required symbol-version inventory.

For identity rather than dependency requirements, use the ELF, PE and Mach-O overview. An ELF build ID and a file hash answer different questions again; neither is a glibc compatibility test.

Sources: REA 6.10.1 ELF dependency documentation, official Node 26.12.1 artifacts, and pyelftools.