This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: GCC plugin to find encrypted function pointer calls in glibc

On 05/02/2016 06:36 PM, Roland McGrath wrote:
The only reason we have asm in those macros is because it's optimal.
The best thing would be if we could express the bit swizzling in C in
a fashion that (new enough) GCC could be relied upon to implement with
the same optimal instruction sequence.

If y'all can do it with C, be it with builtins or whatever, if there's a common pattern, I can probably get the plugin to notice it. Right now, the only thing it notices is the result of an xor, bitwise or, or bitwise and (plus the proposed attribute).

Using an inline with __attribute__ ((always_inline, aldys_new_magic))
should be acceptable in libc-internal sources.  But it would be better
if you have us ways to do it with less magic rather than more.

How can I say no to "aldys_new_magic attribute"?  I love it! :).

If anyone has any other suggestions, I'm all ears. As I mentioned before, the only thing else I can think of is:

	asm("your stuff #some_magic_attribute#")

Assuming there's a common way to make comments across the assemblers you support.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]