2006-03-29 17:58:51

by Chris Friesen

[permalink] [raw]
Subject: CONFIG_FRAME_POINTER and module vermagic


I've had a case reported to me of someone loading a module without frame
pointers into kernel compiled with frame pointers enabled.

1) Is this allowed? I didn't think so, but I wanted to double check.
2) If not, would it make sense to include this in the module vermagic?

Thanks,

Chris


2006-03-29 18:15:51

by linux-os (Dick Johnson)

[permalink] [raw]
Subject: Re: CONFIG_FRAME_POINTER and module vermagic


On Wed, 29 Mar 2006, Christopher Friesen wrote:

>
> I've had a case reported to me of someone loading a module without frame
> pointers into kernel compiled with frame pointers enabled.
>
> 1) Is this allowed? I didn't think so, but I wanted to double check.
> 2) If not, would it make sense to include this in the module vermagic?
>
> Thanks,
>
> Chris

Frame-pointers don't affect calling conventions, only the manner
at which passed parameters are retrieved from the stack by the
called procedures. Plus, the register ebp (BP), the frame-pointer
register, is "precious" and is preserved across calls in GCC 'C'.
So, you can intermix -fno-frame-pointer code at will. It is possible
that a kernel-mode debugger may improperly display local variables,
but normally these things are not used in kernel development anyway.

So yes you can intermix such code. There is no need to flag it
in vermagic.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.15.4 on an i686 machine (5589.42 BogoMips).
Warning : 98.36% of all statistics are fiction, book release in April.
_


****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

2006-03-29 19:44:35

by Chris Friesen

[permalink] [raw]
Subject: Re: CONFIG_FRAME_POINTER and module vermagic

linux-os (Dick Johnson) wrote:

> Frame-pointers don't affect calling conventions, only the manner
> at which passed parameters are retrieved from the stack by the
> called procedures.

Excellent. Thanks for the information.

Chris