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: Implementation of ARM EABI library requirements?


Schwarz, Konrad wrote:

> I originally thought that with "link-time constant" you meant an
> expression of the form (int) &__aeabi_LC_COLLATE,
> where __aeabi_LC_COLLATE has been declared earlier as extern char const
> __aeabi_LC_COLLATE[]; or similar.
> 
> I scanned over the ARM document and now think the idea is to declere it
> as extern int const LC_COLLATE;.
> 
> Both solutions are non-conforming, in that it is no longer possible to
> define, e.g., int const var = LC_COLLATE | 42,

Correct; both solutions are not strictly conformant with ISO C.  (That's
one reason why we would certainly want this to be an optional mode; if
you don't define _AEABI_PORTABLE (sp?), then you just get things as they
presently stand.)

> however, the first idea of using a symbol at least allows int const var
> = LC_COLLATE + 42; (at least when using ELF as the object format).  That
> is why I spoke of "relocations" in my earlier mail.

I can't say why ARM didn't use that trick; CodeSourcery wasn't very
involved in the library ABI design, although we did participate in some
of the other aspects of the ABI.  The trick does lead to another
potential area of non-conformance, in that you could have two variables
at the same address, which is not allowed.  But, that doesn't seem like
a practical concern, and, as you've noted above, this is already
technically non-conformant.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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