Skip to content

feat: support the DEFINED command in linker scripts#2181

Open
vishruth-thimmaiah wants to merge 1 commit into
wild-linker:mainfrom
vishruth-thimmaiah:defined_cmd
Open

feat: support the DEFINED command in linker scripts#2181
vishruth-thimmaiah wants to merge 1 commit into
wild-linker:mainfrom
vishruth-thimmaiah:defined_cmd

Conversation

@vishruth-thimmaiah

@vishruth-thimmaiah vishruth-thimmaiah commented Jul 6, 2026

Copy link
Copy Markdown
Member

This PR adds support for the DEFINED command in linker scripts, which is used to check if a symbol has been declared or not.

Signed-off-by: Vishruth Thimmaiah <vishruththimmaiah@gmail.com>
}
}
Expression::Defined(name) => Ok(symbol_db
.get_unversioned(&UnversionedSymbolName::prehashed(name))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure that this will do the correct thing if there are objects that reference, but don't define the symbol. Can you add a test for that? i.e. have an object that has a weak reference to the symbol.

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