Skip to content

Fix: preserve parentheses around output section VMA#1043

Merged
quic-seaswara merged 1 commit intoqualcomm:mainfrom
deepakshirkem:fix/output-section-vma-paren
Apr 12, 2026
Merged

Fix: preserve parentheses around output section VMA#1043
quic-seaswara merged 1 commit intoqualcomm:mainfrom
deepakshirkem:fix/output-section-vma-paren

Conversation

@deepakshirkem
Copy link
Copy Markdown
Contributor

Problem

Fixes #338

Fix

Call setParen() on the VMA expression when parentheses are detected:

if (consume("(")) {
  if (!readOutputSectTypeAndPermissions(Prologue, peek())) {
    Prologue.OutputSectionVMA = readExpr();
    Prologue.OutputSectionVMA->setParen();  // ← added
  }
  expect(")");
}

Testing

Added a lit test that verifies parentheses are preserved in the plugin output.

When a linker script has parentheses around the output section VMA:
  .text (0x1000) : { *(.text*) }

Fix this by calling setParen() on the VMA expression when parentheses
are detected during parsing in readOutputSectDescPrologue().

Signed-off-by: deepakshirkem <deepakshirke509@gmail.com>
@deepakshirkem deepakshirkem force-pushed the fix/output-section-vma-paren branch from d657930 to 496f8e8 Compare April 10, 2026 21:17
@deepakshirkem
Copy link
Copy Markdown
Contributor Author

Hi @quic-seaswara, Apologies for the build failure. The issue was misleading indentation setParen() was not properly enclosed in braces with the preceding if statement. This has been fixed and the build has been verified locally.

Could you please re-run the pipeline?

Thank you ::))

@quic-seaswara quic-seaswara merged commit 067e4dc into qualcomm:main Apr 12, 2026
12 checks passed
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.

Parenthesis around output section VMA is not recorded

2 participants