Re: llvm - xor return pointers

2017-08-15 Thread Todd Mortimer
On Tue, Aug 15, 2017 at 05:12:39PM -0700, Ori Bernstein wrote: > On Sat, 22 Jul 2017 02:25:29 -0400 > Todd Mortimer wrote: > > > xor [rsp], rsp > > > > at the start of each function, and before every RET. > > Wouldn't this break with alloca() or C99 VLAs? > %rbp may work better, if the frame po

Re: llvm - xor return pointers

2017-08-15 Thread Ori Bernstein
On Sat, 22 Jul 2017 02:25:29 -0400 Todd Mortimer wrote: > xor [rsp], rsp > > at the start of each function, and before every RET. Wouldn't this break with alloca() or C99 VLAs? %rbp may work better, if the frame pointer is retained. -- Ori Bernstein

Re: llvm - xor return pointers

2017-07-22 Thread Theo de Raadt
> Cool stuff. The downside is that this probably kills doing > backtraces, making debugging stuff hard. Unless this also changes the > DWARF debugging information to reflect the xor operation. But I'm not > sure that's possible. I think it is possible, but some help is probably needed in gdb.

Re: llvm - xor return pointers

2017-07-22 Thread Mark Kettenis
> Date: Sat, 22 Jul 2017 02:25:29 -0400 > From: Todd Mortimer > > Hello tech, > > I've been working on llvm/clang some lately, and am experimenting with > the llvm Pass infrastructure. Passes essentially let you perform > arbitrary transforms on the program at various points in the compilation >

llvm - xor return pointers

2017-07-21 Thread Todd Mortimer
Hello tech, I've been working on llvm/clang some lately, and am experimenting with the llvm Pass infrastructure. Passes essentially let you perform arbitrary transforms on the program at various points in the compilation process. I've attached a patch that defines a machine function pass that add