Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there no way to make the asm labels be named specifically according to the return type + arguments? It doesn't fix the issues with changing order of fields/virtual functions (for C++) in types but it at least provides a "default" that may or may not be sane and I think fixes some of the problems that they're worried about and if that fails then sure bob go ahead and craft your own labels.

That said, I think this idea is great, especially the fact that literally the libraries already craft their own labels, this just makes it a part of the language.



This is exactly what C++ name mangling does. The problem is that introducing it is itself an ABI break.


Almost, C++ name mangling does not include the return type even though it is ABI-relevant.


That's specifically one of the examples they gave in the video the article references at the top. It wouldn't be breaking ABI if the symbol differs because that is the "correct" API breakage, one that callers have to be aware of, will generate an error when the application tries to load the shared library and does not find the matching symbol. The entire issue is when things change on the binary level but the application is not aware of it, and continues a subroutine call with wrong arguments or misinterprets the return value.

Also, as the video states, the issue can happen even if the type of one of the arguments is the same but the fields in the type are rearranged, leading to a different offset during derreferencing.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: