C++ Logo

std-proposals

Advanced search

Re: [std-proposals] #include <debug>

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 01 Dec 2024 18:41:32 -0800
On Sunday 1 December 2024 12:45:55 Pacific Standard Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> Therefore, if you want to compile a source file to an object file
> replacing all call's with push+jmp, and all ret's with pop+jmp, then
> the GNU compiler could have a new command line option:
>
> g++ -o frog.o -c frog.c --call-push-jmp
>
> An alternative would be to have a new function attribute called
> "call_push_jmp" as follows:
>
> extern int Func(int, double) __attribute__((call_push_jmp));
>
> This would allow us to get around the control-flow enforcement when we
> want to (such as when debugging). I might post this to the GNU mailing
> list now.

Don't bother. You can opt out of CET on your own code. So you can build in
debug mode without CET. There are still some restrictions on deploying such a
library: an application may refuse to load it if it has already enabled CET,
so you need to rebuild the application too. That's true for your solution as
well because you'd need to replace the caller, not the callee.

The problem I raised is that you can't use your technique in *all* cases.
Therefore, it doesn't belong in the Standard.

Not to mention you've so far failed to demonstrate motivation. Please get some
mileage on the idea first, like implementing it as an intrinsic to one of the
compilers.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2024-12-02 02:41:40