"Young S. Cho" <[EMAIL PROTECTED]> wrote in message
news:68023@palm-dev-forum...
>
> I am trying to create a Shared Library and used the CW 8 Wizard to get
the
> stubs generated.  Then I was modifying the stubs to compile in my code
and
> got the following link error:
>
> Link Error: bn_lib.c: 'const_one$79' has illegal single segment 32-bit
> reference to 'data_one$78'.
>
> I think the code in question is below:
>
> BIGNUM *BN_value_one()
>  {
>  static BN_ULONG data_one=1L;
>  static BIGNUM const_one={&data_one,1,1,0};
>
>  return(&const_one);
>  }
>
> Anyone with any idea of what that link error means?

Do you have the "PC-relative const data" switch turned on?  If not, you
can even use const data in your shared library.

Even with that switch, you can't define constant data in a shared
library that references other constant items, since shared libraries
don't have data segments and no relocations are performed upon them.
Where does the pointer in the first item point?  It points to data_one.
However, that computation can only be performed at runtime, and since
the data is stored directly in the code, it cannot be modified.

You need to rework your data structures to not have embedded pointers if
you want to do this.  You also could add your "const_one" to the
library's global structure, then set it up at library open time.




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to