Skip to content

Rework symbols for proper TLS support - #297

Draft
MrIndeciso wants to merge 5 commits into
sectionsfrom
better-symbols
Draft

MrIndeciso wants to merge 5 commits into
sectionsfrom
better-symbols

Conversation

@MrIndeciso

Copy link
Copy Markdown
Member

Note: built on top of #282
Note: currently AI-generated, needs a lot of rework and refactoring

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces comprehensive TLS (Thread-Local Storage) symbol support and reworks the symbol backend to properly handle various ELF symbol types, bindings, and visibility. It builds upon PR #282 which introduced the ELF API. The PR description notes this is "currently AI-generated, needs a lot of rework and refactoring."

Changes:

  • Added TLS symbol resolution with TLSResolver class and comprehensive test suite
  • Enhanced Symbol dataclass with new fields for type, binding, visibility, TLS metadata, demangling, versioning, PLT/GOT detection
  • Implemented ELF API for parsing sections, dynamic sections, program headers, GNU properties, and Linux runtime mitigations
  • Added native C++ infrastructure for parsing ELF structures and improved symbol parsing with proper type/binding/visibility detection

Reviewed changes

Copilot reviewed 61 out of 100 changed files in this pull request and generated 20 comments.

Show a summary per file
File Description
libdebug/data/symbol.py Extended Symbol with TLS, type, binding, visibility, versioning
libdebug/data/symbol_list.py Added filtering by type/binding, TLS property accessors, demangled name search
libdebug/data/symbol_types.py New enums for SymbolType, SymbolBinding, SymbolVisibility
libdebug/symbols/tls_resolver.py New TLSResolver for resolving TLS addresses across threads
libdebug/data/elf/*.py Complete ELF API with sections, dynamic sections, program headers, GNU properties, mitigations
libdebug/native/symbols/* Enhanced native symbol parsing with type/binding/TLS detection
libdebug/native/elf/* Native ELF parsing infrastructure for sections/segments/properties
libdebug/debugger/*.py Integration of ELF API and libraries parsing into debugger
test/srcs/*.c Comprehensive test binaries for TLS, symbols, sections, mitigations
test/scripts/*.py Test suites for TLS resolution, symbol backend, ELF API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libdebug/data/elf/linux_runtime_mitigations.py
Comment thread libdebug/data/elf/linux_runtime_mitigations.py
Comment thread libdebug/native/symbols/debug_sym_parser_dwarf.cpp Outdated
Comment thread libdebug/data/symbol.py Outdated
Comment thread libdebug/utils/debugger_wrappers.py
Comment thread test/scripts/elf_api_test.py
Comment thread test/scripts/elf_api_test.py
Comment thread test/scripts/elf_api_test.py
Comment thread test/scripts/elf_api_test.py
Comment thread test/scripts/elf_api_test.py
@MrIndeciso
MrIndeciso changed the base branch from main to sections February 2, 2026 00:28
@MrIndeciso
MrIndeciso requested a review from Copilot February 2, 2026 04:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 49 out of 55 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

MrIndeciso added a commit that referenced this pull request Feb 2, 2026
@MrIndeciso
MrIndeciso changed the base branch from sections to main February 2, 2026 18:24
@MrIndeciso
MrIndeciso changed the base branch from main to sections February 2, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants