-
-
Notifications
You must be signed in to change notification settings - Fork 122
feat: support the DEFINED command in linker scripts #2181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,9 @@ | |
| //#RunEnabled:false | ||
| //#DiffEnabled:false | ||
| void _start() {} | ||
|
|
||
| int symbol4 = 0x4000; | ||
| int symbol6 __attribute__((weak)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that declaring a variable doesn't create a reference to it - you need to actually have some code that uses the variable for it to end up in the symbol table.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can verify this by running |
||
| int symbol7 __attribute__((weak)) = 0x7000; | ||
| extern int symbol8 __attribute__((weak)); | ||
| extern int symbol9; | ||
There was a problem hiding this comment.
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.