This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: ARM setjmp and r12


> >>> On the ARM, why does setjmp preserve r12 (ip)?  I believe r12 is 
> >>> caller-preserved, not callee-preserved.
> 
> >> I *think* that this is because GCC uses it as the static chain 
> >> register for nested functions (when operating in ARM mode).
> 
> > Would that even be legal?
> 
> Yes...

Hi Nick,

thanks for the very good explanation.

> (1) Why on earth would you want to use two different C 
> libraries anyway? 
>   This is just asking for trouble.

Because I have libraries delivered by different vendors who compiled
against different implementations of the C library.  The whole point of
an Application _Binary_ Interface is (at least for me) to be able to
link together relocatable (or shared) object (i.e., binary) files,
without regard to the header (i.e., non binary) files they were compiled
with.

Note that the architecture-specific supplement to the SysV ABI defines
the layout of every structure (and also the name of every external)
provided by the standard libraries.  See e.g.,
http://www.stanford.edu/class/cs140/projects/pintos/specs/sysv-abi-i386-
4.pdf, figure 6-76 (pg 157): <setjmp.h>.  (I agree that the information
there is ambiguous, since the location of each register is not defined
within the array holding the registers, but it is with regards to the
size of that array).

Thanks again,

Konrad


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