Re: dynamic static linking library --

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

 



HI Nidhi,

Even executable file has to be dependent on dynamic loader and c library at least, assuming you don't use any other library fucntions like threads etc. 
When you use any library calls and obviyuosly link them to compile the file to produce executable file, it contains the references to those libraries and the symbols you need to resolve at run time just before control reaches to your program.

Please read http://people.redhat.com/drepper/dsohowto.pdf



On Tue, Dec 16, 2008 at 11:54 AM, nidhi mittal <nidhimittal19@xxxxxxxxx> wrote:
hi all i know its not directly related to kernel ...but its the doubt i got while kernel programming only ..its in c langugage
it wd be kind if you accept this ques and answer it
i have a doubt regarding linking of libraries in c program
lets say i have a hello.c C program and hello is executable file correspoding to this.

i read that if libraries are linked dynamically then size of executable file hello is smaller as compared to the size of executable if libararies are linked statically .
in my opinion that means that in case of dynamic linked library hello does not contain libraries with it it is just linked with them.
may be hello contain references to symbols ...where they are present in linked libraries.

now suppose i transfer this hello file to some other machine but same platform which doesnt contain these libraries ....will it work there ?
i hope it shd not
but i have heard ppl say that executable file is complete in itself and it works taken anywhere on same platform.

pl clarify ..
where i m wrong i know there is some fault in my understanding of linking concept but unable to clarify it from google...
--
Thanks & Regards
Nidhi



--
--,
BR,
Ravi Sankar Guntur.



--
--,
BR,
Ravi Sankar Guntur.

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux