Tech News
← Home  ·  All topics

Gcc

3 GoKawiil briefs on this topic

Researcher Chris Domas warns compiler optimizations can silently erase security code

At Black Hat USA, security researcher Chris Domas told David Bombal that compilers can legally strip out security-critical operations like memory-clearing code, even when source code follows best practices. He demonstrated how subtle factors such as data size, register pressure and structure layout can determine whether an optimized binary is safe or exploitable, with some byte sizes producing secure code and nearby sizes producing vulnerable output.

GCC's Nested Functions: How They Differ From C++ Lambdas Internally

Martin Uecker details how GCC compiles nested functions that access variables from an enclosing function, explaining that such functions are lowered early in the middle-end. Variables referenced by the nested function are gathered into a single synthetic struct, with a pointer to that struct passed to the nested function instead of using older stack-frame-pointer techniques like those in Pascal.

Martin Uecker details GCC hack for nested-function callbacks without executable stack

A technical blog post by Martin Uecker examines how GCC compiles nested functions using trampolines placed on the stack, which normally require the stack to be executable. He shows that by extracting the code address and static chain values embedded in the trampoline and passing them to the __builtin_call_with_static_chain built-in, developers can indirectly call nested functions on older GCC versions without needing an executable stack.