[Cryptography] How to lock registers with GCC?

Tom Mitchell mitch at niftyegg.com
Fri May 9 21:30:12 EDT 2014


On Fri, May 9, 2014 at 9:29 AM, Nemo <nemo at self-evident.org> wrote:
> tpb-crypto at laposte.net writes:
>
>> Is it possible to give a directive to GCC while compiling and/or does
>> it support some macro/routine/directive/library/whatever, that would
>> allow to load values into processor registers and then lock one or two
>> registers, which would become unchangeable? Performance
>> notwithstanding.
>
> GCC supports global register variables:
>
> http://gcc.gnu.org/onlinedocs/gcc/Global-Reg-Vars.html

Thanks for this link.... I did not know it existed.
There is a nice long list of cautions so it looks
as if a key is sizeof(register) it is possible.

Registers are rare enough that this is sort
of going "up the down stair case"  i.e.  Easy except
when class gets out.




-- 
  T o m    M i t c h e l l


More information about the cryptography mailing list