{"record":{"id":"89fceb002cbf5202","repo":"tursodatabase/turso","slug":"path-has-no-dynsym-section","errorCode":null,"errorMessage":"{path} has no .dynsym section","messagePattern":"(.+?) has no \\.dynsym section","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/scripts/check_elf_dynsym_exports.py","lineNumber":142,"sourceCode":"    raise SystemExit(f\"{path} has unsupported ELF class {elf_class}\")\n\n\ndef find_dynsym(data: bytes, layout: dict, path: Path):\n    string_header = section_header(data, layout, layout[\"string_table_index\"])\n    names = slice_bytes(data, string_header[OFFSET], string_header[SIZE])\n    named = None\n    typed = None\n    for index in range(layout[\"section_count\"]):\n        header = section_header(data, layout, index)\n        name = names[header[NAME] :].split(b\"\\x00\", 1)[0]\n        if name == b\".dynsym\":\n            named = header\n            break\n        if typed is None and header[TYPE] == 11:\n            typed = header\n    dynsym = named or typed\n    if dynsym is None:\n        raise SystemExit(f\"{path} has no .dynsym section\")\n    return dynsym\n\n\ndef names_from_dynsym(data: bytes, layout: dict, dynsym) -> set[str]:\n    strings = section_header(data, layout, dynsym[LINK])\n    string_table = slice_bytes(data, strings[OFFSET], strings[SIZE])\n    entry_size = dynsym[ENTRY_SIZE] or struct.calcsize(layout[\"symbol_format\"])\n    names: set[str] = set()\n    for index in range(dynsym[SIZE] // entry_size):\n        offset = dynsym[OFFSET] + index * entry_size\n        symbol = struct.unpack_from(layout[\"symbol_format\"], data, offset)\n        raw = string_table[symbol[0] :].split(b\"\\x00\", 1)[0]\n        name = raw.decode(\"utf-8\", \"replace\")\n        if name:\n            names.add(name)\n    return names\n\n","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/tursodatabase/turso/blob/492c4a71cd7c2649e7df83da1471b74f4b1c7aa9/bindings/dotnet/scripts/check_elf_dynsym_exports.py#L124-L160","documentation":"After scanning the ELF section header table, the script falls back from a section literally named '.dynsym' to any section of type SHT_DYNSYM (11). If neither exists, the binary has no dynamic symbol table, so there are no exported dynamic symbols to check and the script exits with this message.","triggerScenarios":"Calling find_dynsym (via dynsym_names) on an ELF that was stripped of its dynamic symbol table, statically linked without exports, or built as a non-shared object with no dynsym section.","commonSituations":"Checking an executable or static library instead of a shared .so; a release build configured to strip dynamic exports; wrong artifact selected in packaging CI.","solutions":["Confirm the target is a shared object with exports: `readelf -S <path> | grep dynsym`.","Rebuild with dynamic symbols retained (don't strip .dynsym; ensure the crate/library produces a cdylib/shared artifact).","Point the script at the correct .so file in the build output.","If the platform legitimately has no dynsym, skip or relax the check in CI."],"exampleFix":"// before\npython check_elf_dynsym_exports.py ./target/release/tursodb\n// after\npython check_elf_dynsym_exports.py ./target/release/libturso_dotnet.so","handlingStrategy":"validation","validationCode":"import subprocess\ndef has_dynsym(path: str) -> bool:\n    out = subprocess.run([\"readelf\", \"-S\", path], capture_output=True, text=True)\n    return \".dynsym\" in out.stdout","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only run export checks against shared objects (cdylib), not executables or static libs","Avoid stripping dynamic symbols from artifacts destined for export verification","Sanity-check with readelf/objdump before automated checks"],"tags":["elf","python","dynamic-symbols","ci"],"backgroundTag":"resource-not-found","analyzedSha":"492c4a71cd7c2649e7df83da1471b74f4b1c7aa9","analyzedAt":"2026-09-13T18:13:59.796Z","contentChangedAt":"2026-09-13T18:13:59.796Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}