|
|
Subscribe / Log in / New account

Unsecure optimization?

Unsecure optimization?

Posted Jan 22, 2016 20:57 UTC (Fri) by nybble41 (subscriber, #55106)
In reply to: Unsecure optimization? by PaXTeam
Parent article: OpenSSH and the dangers of unused code

> the behaviour is the same across 4.5-4.7, only 4.8+ accepts it

It looks like those versions have a bug in the implementation of the "m" constraint for array types. It works if you wrap the array in a struct:

__asm__ ("" :: "m" (*(struct { __typeof(buf) x; } *)&buf));

A bit awkward, but it does work in at least GCC 4.4, 4.9, and 5.3 as well as Clang 3.6, and the extra syntax could be hidden with a macro.

> PS: gcc 4.5 is from 2010.

So it is. And 4.5.4 is from 2012. So why does the copyright statement in the documentation for 4.5.4 (https://gcc.gnu.org/onlinedocs/gcc-4.5.4/gcc/) indicate that it was last updated in 2008?


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds