-
Notifications
You must be signed in to change notification settings - Fork 159
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
Crash when parsing "non standard" string table (.annobin.notes.
)
#734
Comments
You mention "symbol table" a few times, but I guess you mean "string table" instead? I think this should be straight forward to implement as a new Btw, the "crash" is due to the |
Yes, my bad, dealing with both in my current codebase and got them mixed 😀 .
Thanks for the heads up, will keep an eye out for any other potential errors returned here and will report back with anything I see in the wild. |
#735 should fix this. Also, I think this usage of |
Thanks, will test it on Monday. Do you think it'll be worth adding a regression test for this one? |
I've seen this error when trying to use the
object_rewrite::Rewriter
that is returned here
object/src/build/elf.rs
Lines 265 to 268 in 016cf8d
The issue seems to originate in the handling of symbol table sections, as the code only considers "standard" symbol tables (dynamic string table, string table, etc), but there might be any number of additional non standard symbol tables besides the above. For example, in this case:
The
.annobin.notes
section is described here and there's a redhat blogpost on the subject. As per the docs:Funnily enough, seems that this function name, as
readelf
indicated and the object crate parsed correctly, is aSTRTAB
.I am not familiar with the codebase, and I am not totally sure on how to fix this cleanly, but perhaps we could unify the symbol table enum variants with one that explains where the symbol table starts?
Find attached a full repro here: https://github.com/javierhonduco/object-rewrite-repro. Thanks!
The text was updated successfully, but these errors were encountered: