SYSV / EABI compliance

Till Straumann strauman at SLAC.Stanford.EDU
Tue Feb 18 01:49:33 UTC 2003


Hi.

Today, I worked on getting the powerpc/shared BSP
compliant with SYSV / EABI regarding the use of the
small data area(s).

Looks pretty good. I was able to build and run a
major application (RTEMS + networking + CEXP) using
the '-meabi, -msdata=eabi' flags without problems
(yep, I rebuilt RTEMS -msdata=eabi).

I encountered one problem, however: Certain parts of
the system (mostly BSP specific stuff, but also
cpukit/libnetworking/kern/kern_sysctl.o) access
linker defined symbols in the following way:

/* with -msdata=eabi, the compiler assumes
  * this variable's address will be linked
  * in the short data area.
  */
extern int some_linker_defined_address;

...
/* use the address here */

yyy( (unsigned) & some_linker_defined_address )

When compiling with -msdata=eabi, a linker error results
because the compiler generates code who tries to locate
the address in a short data area while it is actually
an absolute address.

I solved this by declaring the bogus variable
(only the address has a meaning) as an array of unknown
size:

/* compiler doesn't know the size, hence access is
  * through an absolute address
  */
extern int some_linker_defined_address[];
...
yyy( (unsigned)some_linker_defined_address )

Does anyone have a better solution / suggestion?

-- Till




More information about the users mailing list