-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
llvm-objcopy produces 160MB binary. It used to be 74KB #73201
Comments
@rustbot ping llvm Does anyone know what's going on here? |
Hey LLVM ICE-breakers! This bug has been identified as a good cc @camelid @comex @cuviper @DutchGhost @dyncat @hanna-kruppe @hdhoang @heyrutvik @JOE1994 @jryans @mmilenko @nagisa @nikic @Noah-Kennedy @SiavoshZarrasvand @spastorino @vertexclique |
It appears that the LLVM version shipped with rustc is used. There has been a bump in LLVM version in the time range, which is most suspect here. |
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good cc @AminArria @camelid @chrissimpkins @contrun @DutchGhost @elshize @ethanboxx @h-michael @HallerPatrick @hdhoang @hellow554 @imtsuki @kanru @KarlK90 @LeSeulArtichaut @MAdrianMattocks @matheus-consoli @mental32 @nmccarty @Noah-Kennedy @pard68 @PeytonT @pierreN @Redblueflame @RobbieClarken @RobertoSnap @robjtede @SarthakSingh31 @senden9 @shekohex @sinato @spastorino @turboladen @woshilapin @yerke |
Assigning |
Regression happened between |
I can reproduce this with vanilla LLVM tools on Fedora 32.
Here are the section and program headers:
I notice that adding the sizes of the two load sections, |
@cuviper So that would imply that the bug is coming from LLVM-upstream? |
From my testing, the regression happened in |
The upgrade to LLVM 10 merged on 2020-05-20: #67759 (comment) |
I haven't tested this directly, but this change looks relevant:
Yes, although I hesitate to call it a bug. From the manpage:
Since the virtual addresses really do have a large span, 161M does seem like an appropriate memory image. The old 76K size had those loaded segments adjacent, which doesn't match memory. |
To be honest, right now I don't have the knowledge to either decline or accept this change in behavior as a bug. I will be doing some research so I can understand what's going on, and what would be the right way to generate the .elf file with the correct virtual addresses, which, as I understand, is the culprit of the problem. Is that the right approach? Did I understand that correctly? I'd really appreciate if anyone wants to jump in and explain where to start looking, since this is currently out of my comfort zone, but feel free to close the bug report. I don't want to cause any more inconvenience. Thanks everyone for the time and responses. |
Ok, I'm going to close this issue, maybe @cuviper can explain it a bit better if it's not a problem for them. |
I don't have experience using binary |
I'm developing a platform for TockOS. They upgraded the nightly version from 03-06 to 06-03, and now llvm-objcopy produces a 160MB binary instead of a 74KB binary. I also tried on the latest nightly (06-09), and the result is the same.
I tried this code with the same .elf file:
I expected to see both binaries have roughly the same size, since both are applied to the same elf file. (which can be found here: https://github.com/dc740/tock/blob/fd6517da9f22d088a30d6b7cb767e42ab820814f/boards/ciaa/edu-ciaa/sample-edu-ciaa.elf )
Instead, the produced binary from nightly 03-06 is 74KB and the one produced by the newer nightly versions 06-03 and 06-19 is 160MB.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: