fix(tools): normalize qualified ELF module exports #6113
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6113"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-14T22:38:20Z.
What
The import audit incorrectly reports a guest import as absent when its sibling module exports the matching NID with a
#library#modulesuffix and retains ELF section headers. The sectionless reader already resolves the same symbol. Normalize section-based export names at the first#, matching the import reader, sectionless reader, and relinker'sGuestImageReaderexport handling.The regression fixture audits
consumer.prximportingNID#import#moduleagainstprovider.prxexportingNID#export#module. It covers section headers, sectionless SysV hash and sectionless GNU hash, verifies the JSON provider and importing module, and checks that a different NID remains absent.Branch:
fix/import-audit-export-suffixBaseline:
eea428ca855fb59a3edd394bab9abf99165590f1Tested commit:
fcd477faf8fd0b4959f927db1f36590b317fa2b7.Tested
Windows 11 build 26200, AMD64, CPython 3.13.7. Python tooling only; no C++ compiler, GPU, title or homebrew execution was required or performed.
tools/tests/test_import_audit.py: 80 tests, 76 passed and 4 skipped, 2.830 seconds. Two POSIX permission checks are unavailable on Windows, symlink creation lacks privilege, and the existing source-stamp fixture was explicitly excluded because it creates a temporary Git commit. An external runner applied this skip without changing tracked tests.git diff --check: passed.python tools/check_conventions.py --base origin/main: passed on the committed change.Reproducer:
python -m unittest tools.tests.test_import_audit.ImportAuditTests.test_module_export_suffix_is_stripped_with_and_without_sections -v.Open PR comparison
Checked main
eea428ca855fb59a3edd394bab9abf99165590f1and the complete 466-PR inventory with paginated changed-file lists. Each overlapping head was normalized onto that main with Git tree-only merges, then compared with main as the explicit merge base. No temporary commits were created. This branch merges cleanly with main. The four proposed changes also merge cleanly with one another.#5713 changes Git stamping; #5571 changes out-of-file section-table fallback. Neither normalizes section-based export names. #5473 has no remaining common-base diff in the shared files.
fd3c6796042ff61c599fa100a4e979a7be200658: clean pair preview. Shared files:tools/import_audit.py,tools/tests/test_import_audit.py.7ff22e76dc54f096f724381aef1a0c936b86cf9b: clean pair preview. Shared files:tools/import_audit.py,tools/tests/test_import_audit.py.4a7a38c43d8d2545584f72c10ac1614f8f74c311: clean pair preview. Shared files:tools/import_audit.py,tools/tests/test_import_audit.py.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-15T15:04:45Z.
I ran the test this PR adds, on Linux.
Setup: head
fcd477fafmerged into main atff23657f3(no conflicts), Linux, Python 3.14.8, clean environment (env -i, only HOME and PATH set).python3 -m unittest -v test_import_auditfrom tools/tests, 3 runs each.layout='sections'subtest oftest_module_export_suffix_is_stripped_with_and_without_sections.The export path for ELFs with section headers now strips the
#suffix, as main already did for section-less dynamic symbols and inelf_imports.I did not check Windows or macOS.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T23:30:01Z.
Checked the one-line change in
elf_exportsagainst the other two readers (lines 145 and 208, same#split) and the new test:import_auditpasses on the merged tree and fails withtools/import_audit.pyreverted. The test covers section headers, sectionless SysV/GNU hash and a different-NID negative control. Also confirmed on Linux by @Dextroid17. Merging.