4 ms·
I wish these compiler protocols and interfaces were better documented. They just assume you're using glibc for support. I want to fully integrate them with my f
by matheusmoreira 2y ago
I wish these compiler protocols and interfaces were better documented. They just assume you're using glibc for support. I want to fully integrate them with my freestanding nolibc C projects but I can't figure out how to do it.
The compiler's stack canaries were simple enough. The only issue was the ugly symbols. I requested that a feature be added to override the symbol generated by the compiler so I could use good names instead.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113694 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113694
Things like instrumentation and sanitizers though? No idea. Even asked about it on Stack Overflow and got no answers to this day.
https://stackoverflow.com/q/77688456 https://stackoverflow.com/q/77688456
I assume these object sizing builtins make use of function attributes such as malloc, alloc_align and alloc_size. I've added all of those attributes to my memory allocator but I'm not quite sure if they're doing anything useful.
- uecker 2y agoThey will, but glibc also has additional macro wrappers around certain library functions that do explicit checking based on __builtin_object_size or __builtin_dynamic_object_size. The code is public. You could also ask on the gcc mailing list.