-
Notifications
You must be signed in to change notification settings - Fork 18k
debug/elf: files with more than 65280 (0xff00) sections not handled correctly #55294
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
Comments
Change https://go.dev/cl/432255 mentions this issue: |
Is there a real need for such large number of sections? Or this is just an artificial example? Thanks. |
This is just an artificial example. I'm not aware of any object file needs such a large number of sections. The purpose is just to make it compliant with the spec. |
Thanks. One possible answer is to reject a file with too many sections. cc @golang/compiler |
In my mind it might be worth trying to fix this-- with the right combination of options you can get object files from C compilers that are roughly on that order (without resorting to cooked test cases). For example, if I go to my LLVM repo, do a build, and find the largest object file in the lib subdir (turns out to be PassBuilder.o), then build that file with "-O0 -ffunction-sections -fdata-section" I get a file with around 35k sections.
That's less than 65k but it is in the same rough neighborhood.
|
It seems that you haven't noticed the CL https://go.dev/cl/432255. Please take a look. It is just a small change to fix this. |
I have seen object files with this many sections in the wild. The ELF spec was changed to support it not just for completeness, but because it was necessary. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
y.c
with this script1:y.c
:main.go
:What did you expect to see?
What did you see instead?
Footnotes
The script is copied from https://sourceware.org/bugzilla/show_bug.cgi?id=5900. Thank you ianlancetaylor@. ↩
The text was updated successfully, but these errors were encountered: