[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SYSV / EABI compliance



Till Straumann wrote:

> 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:

The sysctl related code is in:

  cpukit/libnetworking/sys/linker_set.h

and needs a linker script change to collect all the variables into an array.

> /* 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?

I do not understand what you needed to do for sysctl ?

Did you have to provide definitions for each sysctl variable that uses the TEXT_SET 
macro ?

-- 
  Chris Johns, cjohns at cybertec.com.au