Skip to content

feat: Add ASSERT command parsing support to linker scripts#1607

Open
Blazearth wants to merge 1 commit intodavidlattimore:mainfrom
Blazearth:feat/linker-script-assert
Open

feat: Add ASSERT command parsing support to linker scripts#1607
Blazearth wants to merge 1 commit intodavidlattimore:mainfrom
Blazearth:feat/linker-script-assert

Conversation

@Blazearth
Copy link
Contributor

Adds parsing support for ASSERT(expression, "message") commands in linker scripts. Both top-level and within SECTIONS blocks are supported.

Assertions are parsed and stored in the AST but not yet evaluated. This is commonly used in Linux kernel linker scripts to validate memory layout constraints.

Changes

  • Added Assert variant to Command and SectionCommand enums
  • Implemented parse_assert() function
  • Added handling in layout_rules.rs (currently no-op with TODO)
  • Added 3 tests covering various ASSERT syntaxes

Evaluation will be implemented in a follow-up PR.

@Blazearth
Copy link
Contributor Author

The AArch64 test appears to be failing during the wild-action installation step (exit code 2), not during actual test execution. All other checks pass and tests pass locally. Let me know if I should investigate further or if this is a known CI issue.

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.

1 participant