Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Libraries in /usr/qnx/target/qnx6/x86/usr/lib: (8 Items)
   
Libraries in /usr/qnx/target/qnx6/x86/usr/lib  
Hi ,

I have found the libraries in different formats in /usr/qnx/target/qnx6/x86/usr/lib directory.

forex :- 1.libdrvs.a - When this file will be used?
                libdrvrS.a  - When this file will be used?

             2.libelf.a
                libelfS.a

Sometimes 3 different formatlirary files

           1.libEGL.a
              libEGL.so  - When this file will be used?
              libEGLS.a 
            
1. Can you please tell me why three different type of library formats in same directory ?

Please help me on this..

Thanks and Regards
K.Senthil
Re: Libraries in /usr/qnx/target/qnx6/x86/usr/lib  
Hi,

all libraries with a '.a' suffix are /static/ libraries; they are archives (hence the suffix) from which the linker will
 take all required parts and, roughly spoken, 'copy' them into the resulting binary. All symbols in the lib are resolved
 (i.e., translated into addresses) at link time and you do not need to have the *.a present at run time.

Libraries with a '.so' ('shared object') must be present both at link /and/ at run time. The linker mostly just makes 
sure that everything it needs is in the lib, and a bit more - but it does not place the 'actual' code into the binary. 
Instead, the library's symbols are resolved when the binary is loaded - for this reason, shared libraries must always be
 present in the runtime system. For any number of processes using a .so, the latter is loaded only once (it is shared by
 the processes) and merely mapped into the process'es address space. Since the virtual address of a *.so can be 
different in each process, the code must not contain any 'absolute' addresses (e.g. for calls, jumps, or references to 
static variables). Instead, it must be "position independant", and already the compiler must have generated the code 
accordingly.

Now we can see what a *S.a is -- it's a shared (or rather, sharable) static library. As we can tell by it's suffix, .a, 
it is a static library and used only at link time -- but it can be used to build shared objects, because it contains 
position-independant code.

So in your example:
    libEGL.a     will be used when statically linking against the EGL lib (-Bstatic)
    libEGL.so    used when dynamically linking 
                     and when running the resulting executable
    libEGLS.a   used when building a shared object (so) 
                     and statically linking this against the EGL lib. 

Hope this helps...
- Thomas
Re: Libraries in /usr/qnx/target/qnx6/x86/usr/lib  
Hi,

Thanks a lot.

1.can  you please tell me why they linking always static shared library in the network driver code?

2.is that possibile to link .so file in my network driver code?

Thanks and Regards
K.Senthil

RE: Libraries in /usr/qnx/target/qnx6/x86/usr/lib  



 
> Hi,

> Thanks a lot.

> 1.can  you please tell me why they linking always static shared library in the network driver code?

So as not to have dependencies various .so libraries.

> 2.is that possibile to link .so file in my network driver code?

Yes.  For example io-pkt depends on libc.so.

-seanb




_______________________________________________

Networking Drivers
http://community.qnx.com/sf/go/post43267


Attachment: Text winmail.dat 2.52 KB
Re: RE: Libraries in /usr/qnx/target/qnx6/x86/usr/lib  
Hi Sean,

Can you please tell me how do you link libc.so in io-pkt?

How to add .so in common.mk file,

Because following lines i added in my common.mk.

LIBS+= hash socket

i placed mylibhash.so file in /usr/qnx/target/qnx6/x86/lib.

if do a make the following error is comming.

make[2]: *** No rule to make target `libhash.a', needed by `/home/senthil/pe/x86/dll/devnp-pe.so'.  Stop.
make[2]: Leaving directory `/home/senthil/pe/x86/dll'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/senthil/pe/x86'
make: *** [all] Error 2

Thanks and Regards
K.Senthil


RE: RE: Libraries in /usr/qnx/target/qnx6/x86/usr/lib  
libc is brought in by default:

$ objdump -x io-pkt-v4 | grep NEEDED
  NEEDED               libc.so.3

-seanb



-----Original Message-----
From: Senthil K [mailto:community-noreply@qnx.com]
Sent: Sun 12/6/2009 10:53 PM
To: drivers-networking
Subject: Re: RE: Libraries in /usr/qnx/target/qnx6/x86/usr/lib
 
Hi Sean,

Can you please tell me how do you link libc.so in io-pkt?

How to add .so in common.mk file,

Because following lines i added in my common.mk.

LIBS+= hash socket

i placed mylibhash.so file in /usr/qnx/target/qnx6/x86/lib.

if do a make the following error is comming.

make[2]: *** No rule to make target `libhash.a', needed by `/home/senthil/pe/x86/dll/devnp-pe.so'.  Stop.
make[2]: Leaving directory `/home/senthil/pe/x86/dll'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/senthil/pe/x86'
make: *** [all] Error 2

Thanks and Regards
K.Senthil






_______________________________________________

Networking Drivers
http://community.qnx.com/sf/go/post43271


Attachment: Text winmail.dat 2.92 KB
Re: RE: RE: Libraries in /usr/qnx/target/qnx6/x86/usr/lib  
Hi Sean,

Thanks a lot.

How to add my xxx.so in common.mk file,

Because following lines i added in my common.mk.

i placed my libhash.so file in /usr/qnx/target/qnx6/x86/lib.

LIBS+= hash socket

if do a make the following error is comming.

make[2]: *** No rule to make target `libhash.a', needed by `/home/senthil/pe/x86/dll/devnp-pe.so'.  Stop.
make[2]: Leaving directory `/home/senthil/pe/x86/dll'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/senthil/pe/x86'
make: *** [all] Error 2

How do i link my xx.so file..


Thanks and Regards
K.Senthil

Libraries in /usr/qnx/target/qnx6/x86/usr/lib  
Hi,

How to add my xxx.so in common.mk file,

Because following lines i added in my common.mk.

i placed my libhash.so file in /usr/qnx/target/qnx6/x86/lib.

LIBS+= hash socket

if do a make the following error is comming.

make[2]: *** No rule to make target `libhash.a', needed by `/home/senthil/pe/x86/dll/devnp-pe.so'.  Stop.
make[2]: Leaving directory `/home/senthil/pe/x86/dll'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/senthil/pe/x86'
make: *** [all] Error 2

How do i link my xx.so file..


Thanks and Regards
K.Senthil