-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Place read-only data symbols in the .rodata section. #2460
Conversation
@swift-ci Please test. |
What is the effect on other platforms here? Is there any platform that would balk at this, and should we conditionalize it? |
I'm not totally sure. It is definitely fine when targeting ELF objects. Windows might need to be We should probably do the other object file formats too though at some point. Dumping the data into the |
@swift-ci Please test. |
@swift-ci please test |
@millenomi since this is a property of the object file, no platform would balk at this. The flags need to be setup appropriately for the target object file format, |
This data was previously put into the default section, .text, which is generally used for executable data. Currently this is only fixed when using ELF but we should probably fix this for other object file formats too. This fixes a gold warning on IBM Z: "S/390 code fill of odd length requested". This warning was triggered because executable instructions on IBM Z must be 2-byte aligned and the data in some of these symbols is 1-byte aligned.
@swift-ci Please test. |
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.
Minor nit: I tend to prefer the .section
directive indented. I leave the formatting related items to @millenomi
@swift-ci please test |
@swift-ci please test Linux platform |
This data was previously put into the default section, .text, which
is generally used for executable data.
This fixes a gold warning on IBM Z: "S/390 code fill of odd length
requested". This warning was triggered because executable
instructions on IBM Z must be 2-byte aligned and the data in one of
these sections is 1-byte aligned.