https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59856

--- Comment #5 from PaX Team <pageexec at gmail dot com> ---
(In reply to Josh Triplett from comment #4)
> (In reply to Tom Tromey from comment #3)
> (As a vaguely related aside, how does GCC disambiguate whether an attribute
> preceding the function declaration or definition applies to the return type
> or to the function?  I really hope that doesn't depend on the specific
> attribute.)

AFAIK, you can't put an attribute on the return type, it'll be interpreted as a
function attribute instead (and on definitions you can't place them after the
function arguments). the only way to put attrs on the return type is via a
typedef.

> Could you represent __context__ as a new GCC builtin?  Would that make this
> any easier?

it can be a builtin or just a regular function declaration, the latter is easy
to create from a plugin too.

> So, I suspect the unfortunate answer is that Linux would probably want to
> ship the plugin as C/C++ and build it at build time if enabled.  (Or we could
> integrate this functionality into GCC itself.)

since PaX already has a checker plugin i subscribed to this bug a while ago but
completely forgot about it until now ;P. in any case, i've begun to work on
this along a somewhat different angle: instead of adding completely new
machinery to detect context imbalances i'd like to reuse existing gcc passes to
compute this property, we'll see how it goes.

Reply via email to