Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Regarding Exporting a symbol from executable to shared library: (5 Items)
   
Regarding Exporting a symbol from executable to shared library  
>
> Hello,
>
> Queries to QNX:
>
> Reference board: AT91SAM9263 development board.
>
> BSP: bsp-nto640-ATMEL-AT91SAM9263-
> EK-trunk.
>
> IDE: QNX Momentics Integrated Development 4.7.0
>
> OS: QNXSDP 6.5.0
>
>
>
> We have designed our SDIO stack as QNX application (as a executable
> binary)  and net work driver as a shared library format (.so file). We can
> able run/debug our SDIO stack application using run/debug the configuration
> utility. QNX SDIO stack able to do initialization of any network SDIO card
> successfully. As per net work driver design some of the SDIO stack API's are
> used bythe network driver. While running the network driver library using
> io-pkt application SDIO stack API's are showing unresolved symbols. We have
> tried to export the symbol from QNX SDIO stack application and tried to link
> the network driver against QNX SDIO stack application using extra library
> paths and extra library include options, but its throwing compilation error
> when its not able to fined the library from the specified path given. At
> this moment we are unable to export the symbols of the QNX SDIO stack
> application to the network shared library.
>
> Our QNX SDIO stack is working properly with below mentioned  methods.
> 1. Normal C/C++ projects as executable.
> 2. QNX C projects as a executable.
> 3. Include in the AT91SAM9263 QNX BSP device driver as a executable.
>
> Our network driver is include in the AT91SAM9263 QNX BSP devnp driver as a
> shared library. It will executed by the io-pkt  application
>
> Please suggest us to resolve the issues.
>
> Best Regards,
> Saravana
>
Re: Regarding Exporting a symbol from executable to shared library  
It sounds like you need to compile your sdio layer as a library; either as a shared library (foo.so) or a static PIC 
variant (fooS.a) and link your driver against that.

Regards,

-seanb 

----- Original Message -----
From: saro sun [mailto:community-noreply@qnx.com]
Sent: Tuesday, May 24, 2011 07:24 AM
To: technology-networking <post86068@community.qnx.com>
Subject: Regarding Exporting a symbol from executable to shared library

>
> Hello,
>
> Queries to QNX:
>
> Reference board: AT91SAM9263 development board.
>
> BSP: bsp-nto640-ATMEL-AT91SAM9263-
> EK-trunk.
>
> IDE: QNX Momentics Integrated Development 4.7.0
>
> OS: QNXSDP 6.5.0
>
>
>
> We have designed our SDIO stack as QNX application (as a executable
> binary)  and net work driver as a shared library format (.so file). We can
> able run/debug our SDIO stack application using run/debug the configuration
> utility. QNX SDIO stack able to do initialization of any network SDIO card
> successfully. As per net work driver design some of the SDIO stack API's are
> used bythe network driver. While running the network driver library using
> io-pkt application SDIO stack API's are showing unresolved symbols. We have
> tried to export the symbol from QNX SDIO stack application and tried to link
> the network driver against QNX SDIO stack application using extra library
> paths and extra library include options, but its throwing compilation error
> when its not able to fined the library from the specified path given. At
> this moment we are unable to export the symbols of the QNX SDIO stack
> application to the network shared library.
>
> Our QNX SDIO stack is working properly with below mentioned  methods.
> 1. Normal C/C++ projects as executable.
> 2. QNX C projects as a executable.
> 3. Include in the AT91SAM9263 QNX BSP device driver as a executable.
>
> Our network driver is include in the AT91SAM9263 QNX BSP devnp driver as a
> shared library. It will executed by the io-pkt  application
>
> Please suggest us to resolve the issues.
>
> Best Regards,
> Saravana
>




_______________________________________________

Technology
http://community.qnx.com/sf/go/post86068
Re: Regarding Exporting a symbol from executable to shared library  
Hi Seanb,

Thanks for response.

My network driver is a shared library, please let me know how to link with
network driver shared library to my sdio shared or static library. I have
tried with extra library and path option, but throwing a error.

And if try to merge the network driver and sdio source as single shared
library which, I can able to run using the io-pkt application. but in
network driver dynamic allocation using malloc with three variables. Same
malloc, if I used in sdio thread (using pthread_create) with three variable
malloc its crashing. If try to use the normal malloc with single variable,
its giving a compilation error, because of the _KERNEL macro variable.
Please let me know your suggestion.

Best Regards,
Saravana.



On Tue, May 24, 2011 at 5:26 PM, Sean Boudreau <community-noreply@qnx.com>wrote:

> It sounds like you need to compile your sdio layer as a library; either as
> a shared library (foo.so) or a static PIC variant (fooS.a) and link your
> driver against that.
>
> Regards,
>
> -seanb
>
> ----- Original Message -----
> From: saro sun [mailto:community-noreply@qnx.com]
> Sent: Tuesday, May 24, 2011 07:24 AM
> To: technology-networking <post86068@community.qnx.com>
> Subject: Regarding Exporting a symbol from executable to shared library
>
> >
> > Hello,
> >
> > Queries to QNX:
> >
> > Reference board: AT91SAM9263 development board.
> >
> > BSP: bsp-nto640-ATMEL-AT91SAM9263-
> > EK-trunk.
> >
> > IDE: QNX Momentics Integrated Development 4.7.0
> >
> > OS: QNXSDP 6.5.0
> >
> >
> >
> > We have designed our SDIO stack as QNX application (as a executable
> > binary)  and net work driver as a shared library format (.so file). We
> can
> > able run/debug our SDIO stack application using run/debug the
> configuration
> > utility. QNX SDIO stack able to do initialization of any network SDIO
> card
> > successfully. As per net work driver design some of the SDIO stack API's
> are
> > used bythe network driver. While running the network driver library using
> > io-pkt application SDIO stack API's are showing unresolved symbols. We
> have
> > tried to export the symbol from QNX SDIO stack application and tried to
> link
> > the network driver against QNX SDIO stack application using extra library
> > paths and extra library include options, but its throwing compilation
> error
> > when its not able to fined the library from the specified path given. At
> > this moment we are unable to export the symbols of the QNX SDIO stack
> > application to the network shared library.
> >
> > Our QNX SDIO stack is working properly with below mentioned  methods.
> > 1. Normal C/C++ projects as executable.
> > 2. QNX C projects as a executable.
> > 3. Include in the AT91SAM9263 QNX BSP device driver as a executable.
> >
> > Our network driver is include in the AT91SAM9263 QNX BSP devnp driver as
> a
> > shared library. It will executed by the io-pkt  application
> >
> > Please suggest us to resolve the issues.
> >
> > Best Regards,
> > Saravana
> >
>
>
>
>
> _______________________________________________
>
> Technology
> http://community.qnx.com/sf/go/post86068
>
>
>
>
> _______________________________________________
>
> Technology
> http://community.qnx.com/sf/go/post86069
>
>
Re: Regarding Exporting a symbol from executable to shared library  
If you use nw_pthread_create() for the sdio thread, it
can use malloc(9).  If you override the define with
parentheses (eg (malloc)) it can use malloc(3).

Regards,

-seanb

On Tue, May 24, 2011 at 09:23:27AM -0400, saro sun wrote:
> Hi Seanb,
> 
> Thanks for response.
> 
> My network driver is a shared library, please let me know how to link
> with
> network driver shared library to my sdio shared or static library. I
> have
> tried with extra library and path option, but throwing a error.
> 
> And if try to merge the network driver and sdio source as single shared
> library which, I can able to run using the io-pkt application. but in
> network driver dynamic allocation using malloc with three variables.
> Same
> malloc, if I used in sdio thread (using pthread_create) with three
> variable
> malloc its crashing. If try to use the normal malloc with single
> variable,
> its giving a compilation error, because of the _KERNEL macro variable.
> Please let me know your suggestion.
> 
> Best Regards,
> Saravana.
> 
> 
> 
> On Tue, May 24, 2011 at 5:26 PM, Sean Boudreau
> <community-noreply@qnx.com>wrote:
> 
> > It sounds like you need to compile your sdio layer as a library;
> either as
> > a shared library (foo.so) or a static PIC variant (fooS.a) and link
> your
> > driver against that.
> >
> > Regards,
> >
> > -seanb
> >
> > ----- Original Message -----
> > From: saro sun [mailto:community-noreply@qnx.com]
> > Sent: Tuesday, May 24, 2011 07:24 AM
> > To: technology-networking <post86068@community.qnx.com>
> > Subject: Regarding Exporting a symbol from executable to shared
> library
> >
> > >
> > > Hello,
> > >
> > > Queries to QNX:
> > >
> > > Reference board: AT91SAM9263 development board.
> > >
> > > BSP: bsp-nto640-ATMEL-AT91SAM9263-
> > > EK-trunk.
> > >
> > > IDE: QNX Momentics Integrated Development 4.7.0
> > >
> > > OS: QNXSDP 6.5.0
> > >
> > >
> > >
> > > We have designed our SDIO stack as QNX application (as a executable
> > > binary)  and net work driver as a shared library format (.so file).
> We
> > can
> > > able run/debug our SDIO stack application using run/debug the
> > configuration
> > > utility. QNX SDIO stack able to do initialization of any network
> SDIO
> > card
> > > successfully. As per net work driver design some of the SDIO stack
> API's
> > are
> > > used bythe network driver. While running the network driver library
> using
> > > io-pkt application SDIO stack API's are showing unresolved symbols.
> We
> > have
> > > tried to export the symbol from QNX SDIO stack application and tried
> to
> > link
> > > the network driver against QNX SDIO stack application using extra
> library
> > > paths and extra library include options, but its throwing
> compilation
> > error
> > > when its not able to fined the library from the specified path
> given. At
> > > this moment we are unable to export the symbols of the QNX SDIO
> stack
> > > application to the network shared library.
> > >
> > > Our QNX SDIO stack is working properly with below mentioned
> methods.
> > > 1. Normal C/C++ projects as executable.
> > > 2. QNX C projects as a executable.
> > > 3. Include in the AT91SAM9263 QNX BSP device driver as a executable.
> > >
> > > Our network driver is include in the AT91SAM9263 QNX BSP devnp
> driver as
> >...
Re: Regarding Exporting a symbol from executable to shared library  
Hi Seanb,

Thanks for your support.

I have tried to implement the nw_pthread_create instead of pthread_create
for sdio thread.

Source code:
    pthread_attr_init(&pattr);
    pthread_attr_setschedpolicy(&pattr,SCHED_RR);
    param.sched_priority = priority;
    pthread_attr_setschedparam(&pattr,¶m);
    pthread_attr_setinheritsched(&pattr, PTHREAD_EXPLICIT_SCHED);
    pthread_attr_setdetachstate(&pattr, PTHREAD_CREATE_DETACHED);
    pthread_attr_setstacksize(&pattr, SD_THREAD_STACK_SIZE);
#if QNX_THREAD
    if((status = pthread_create(&pHandle->osThreadId,(const pthread_attr_t
*)&pattr,
    (Qnx_Thread_Function)pFunction,pContext)) != SD_SUCCESS)
   {
        sd_Error("Could not create Thread - Tx err: %u\n",status);
     SD_FREE(pStackStart);
        return (SD_ERROR_INVALID);
    }
#else
    if((status = nw_pthread_create(&pHandle->osThreadId,(const
pthread_attr_t *)&pattr,
    (Qnx_Thread_Function)pFunction,pContext,0,NULL,NULL)) != SD_SUCCESS)
   {
        sd_Error("Could not create Thread - Tx err: %u\n",status);
     SD_FREE(pStackStart);
        return (SD_ERROR_INVALID);
    }
#endif
But It returns error No. 22

Please let me know if any example source code to implement the
nw_pthread_create() function.

Best Regards,
Saravana
On Tue, May 24, 2011 at 7:20 PM, Sean Boudreau <community-noreply@qnx.com>wrote:

>
> If you use nw_pthread_create() for the sdio thread, it
> can use malloc(9).  If you override the define with
> parentheses (eg (malloc)) it can use malloc(3).
>
> Regards,
>
> -seanb
>
> On Tue, May 24, 2011 at 09:23:27AM -0400, saro sun wrote:
> > Hi Seanb,
> >
> > Thanks for response.
> >
> > My network driver is a shared library, please let me know how to link
> > with
> > network driver shared library to my sdio shared or static library. I
> > have
> > tried with extra library and path option, but throwing a error.
> >
> > And if try to merge the network driver and sdio source as single shared
> > library which, I can able to run using the io-pkt application. but in
> > network driver dynamic allocation using malloc with three variables.
> > Same
> > malloc, if I used in sdio thread (using pthread_create) with three
> > variable
> > malloc its crashing. If try to use the normal malloc with single
> > variable,
> > its giving a compilation error, because of the _KERNEL macro variable.
> > Please let me know your suggestion.
> >
> > Best Regards,
> > Saravana.
> >
> >
> >
> > On Tue, May 24, 2011 at 5:26 PM, Sean Boudreau
> > <community-noreply@qnx.com>wrote:
> >
> > > It sounds like you need to compile your sdio layer as a library;
> > either as
> > > a shared library (foo.so) or a static PIC variant (fooS.a) and link
> > your
> > > driver against that.
> > >
> > > Regards,
> > >
> > > -seanb
> > >
> > > ----- Original Message -----
> > > From: saro sun [mailto:community-noreply@qnx.com]
> > > Sent: Tuesday, May 24, 2011 07:24 AM
> > > To: technology-networking <post86068@community.qnx.com>
> > > Subject: Regarding Exporting a symbol from executable to shared
> > library
> > >
> > > >
> > > > Hello,
> > > >
> > > > Queries to QNX:
> > > >
> > > > Reference board: AT91SAM9263 development board.
> > > >
> > > > BSP: bsp-nto640-ATMEL-AT91SAM9263-
> > > > EK-trunk.
> > > >
> > > > IDE: QNX Momentics Integrated Development 4.7.0
> > > >
> > > > OS: QNXSDP 6.5.0
> > >...
View Full Message