Skip to content
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

picolibc: linker script: Add '__lcxx_override' section #390

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

domin144
Copy link
Contributor

This section was added into libc++ and conains the "new" operator[1]. Placing the "new" operator in the section allows checking, if the operator (defined as weak symbol) was overridden.

The check relies on the "_start" and "_end" symbols generated by linker. These symbols would not be generated for names, which are not valid C identifiers. For this reason name like ".text.__lcxx_generated" cannot be used.

[1] llvm/llvm-project#69498

This section was added into libc++ and conains the "new" operator[1].
Placing the "new" operator in the section allows checking, if the
operator (defined as weak symbol) was overridden.

The check relies on the "__start_" and "__end_" symbols generated by
linker. These symbols would not be generated for names, which are not
valid C identifiers. For this reason name like ".text.__lcxx_generated"
cannot be used.

[1] llvm/llvm-project#69498
Copy link
Collaborator

@statham-arm statham-arm left a comment

Choose a reason for hiding this comment

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

LGTM, although I wonder if it might be a good idea to pre-emptively match __lcxx_*? If libc++ upstream likes that naming scheme, they might use it again for the next special case they find.

@domin144
Copy link
Contributor Author

domin144 commented Feb 22, 2024

LGTM, although I wonder if it might be a good idea to pre-emptively match __lcxx_*? If libc++ upstream likes that naming scheme, they might use it again for the next special case they find.

Good idea. There are no other names with this pattern, yet, but if a new section are proposed, we could ask upstream to keep the convention.
Done.

@domin144 domin144 merged commit 86a8555 into ARM-software:main Feb 22, 2024
1 check passed
@domin144 domin144 deleted the lcxx_override branch February 28, 2024 11:20
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