[llvmlinux] Global vs. Local named registers

Renato Golin renato.golin at linaro.org
Wed May 21 13:45:19 UTC 2014

On 21 May 2014 13:22, PaX Team <pageexec at gmail.com> wrote:
> isn't it the global/read-only version of the sp register use? 'cos i was
> specifically asking whether you knew of an example of the local/writable
> version ;).

Oh, sorry.

No, none that I know of. AFAICS, all use of local named register in
the kernel (kprobes) is to reserve registers on inline assembly code

The only usage of local non-inline-asm that I could find is when
assuming local and global declarations are interchangeable, and since
GCC sometimes accepts it, people write code like that. There are other
usages as globals, which hints to me that the original coder thought
it was safe, or even preferable, to have it local (for the sake of not
emitting it in the final objects, maybe?).

This is why I want to move those usages into global declarations.


More information about the LLVMLinux mailing list