Uh oh!
There was an error while loading. Please reload this page.
Implement -Z function-sections=yes|no - #78414
Conversation
rust-highfive
commented
Oct 26, 2020
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
nox
commented
Oct 26, 2020
I implemented it as a flag because AFAIK that particular setting doesn't require libstd etc to be built the same thing, thus it is a bit unfortunate that it requires building a whole new target currently to change the value. Plus, it would make it easier to check on Windows if we can turn back |
eddyb
commented
Oct 26, 2020
jyn514
commented
Oct 26, 2020
@bors delegate=bjorn3 |
bors
commented
Oct 26, 2020
✌️ @bjorn3 can now approve this pull request |
There was a problem hiding this comment.
.text is not exactly the most portable name (e.g. machO uses __text AFAIR). I suggest dropping the . or perhaps the whole .text.
There was a problem hiding this comment.
That's a good point, I removed it.
This lets rustc users tweak whether all functions should be put in their own TEXT section, using whatever default value the target defines if the flag is missing.
nagisa
commented
Oct 26, 2020
@bors r=nagisa,bjorn3 |
bors
commented
Oct 26, 2020
📌 Commit 0569422 has been approved by |
nox
commented
Oct 28, 2020
Any chance I could get a |
Its the next PR in the bors queue. |
bors
commented
Oct 28, 2020
bors
commented
Oct 28, 2020
☀️ Test successful - checks-actions |
This lets rustc users tweak whether all functions should be put in their own TEXT section, using whatever default value the target defines if the flag is missing.
I'm having fun experimenting with musl libc and trying to implement the start symbol in Rust, that means avoiding code that requires relocations, and AFAIK putting everything in its own section makes the toolchain generate
GOTPCRELrelocations for symbols that could use plain old PC-relative addressing (at least onx86_64) if they were all in the same section.