Subject: Re: Shared library support for ARM ELF
To: Todd Vierling <tv@wasabisystems.com>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm
Date: 07/20/2001 17:26:22
> On Fri, 20 Jul 2001, Ben Harris wrote:
>
> : > What else is required?
> :
> : MASK_RETURN_ADDR needs to be changed to generate code to check what mode
> : the CPU is in at run-time and pick the correct mask appropriately.
> : sys/arch/arm/include/profile.h demonstrates how to do this, but it needs
> : to be converted to a form GCC can understand.
>
> The mask is needed when gcc is *compiling* code, so how would this be done
> at run-time? (Generation of code that does it on every return insn? Eek,
> that sounds like a significant overhead added to function calls....) Note
> I'm reading from your definition of "run-time" here that you are implying
> a program's run-time, not gcc's.
>
No, the only time it's needed is when we need to examine the return
address in "C" code. At run time the architecture just gets extracting
the return bits right. C code unpicking the stack however, has to throw
away the bits that don't count. In practise this will only occur when
unwinding an exception.
R.