Loading ...
Sorry, an error occurred while loading the content.

Re: [blug-prog] Shared Library Creation

Expand Messages
  • kirti
    There is little bit confusion here... When static library is linked with executable then size of executable is more than the executable linked with dynamic
    Message 1 of 3 , Jul 1 6:27 AM
    • 0 Attachment
      There is little bit confusion here...

      When static library is linked with executable then size of executable is
      more than the executable linked with dynamic library...
      That doesn't mean that the size of dynamic library should be smaller than
      static library...
      u shd differentiate the size of executable & size of library...
      size of dynamic lib may increase as it has to keep run time information...

      please correct me ..if I am wrong..

      r_
      Kirti




      > Hi All
      >
      > I am creating a shared library using
      > % gcc -shared -fPIC -o libtest1.so test1.o
      >
      > % gcc -shared -fPIC -o libtest2.so test2.o
      >
      > If I compare these .so with static library created by
      >
      > ar -rv libtest1.a test1.o
      >
      > ar -rv libtest2.a test2.o
      >
      >
      >
      > Actually dynamically created library size should be smaller than static
      creation, According to my results for some libraries I am getting static
      size lesser than the dynamically created ..
      >
      > WHY?
      >
      > Please correct me if I am issuing a wrong command for creation of
      libraries.
      >
      >
      >
      > Thanx in Advance
      >
      > Sukesh
      >
      >
      >
      >
      >
      >
      ********************************DISCLAIMER**********************************
      >
      > This e-mail and any attachment is for authorised use by the intended
      > recipient(s) only. It may contain proprietary material, confidential
      > information and/or be subject to legal privilege of Deccanet Designs Ltd.
      > If you have received this message in error, please notify the originator
      > immediately. If you are not the intended recipient, you are notified that
      > you are strictly prohibited from retaining, using, copying, altering or
      > disclosing the contents of this message.
      >
      >
      ****************************************************************************
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      > ---------------------------------------------------------------
      > This is the programming list of the Bangalore Linux Users Group
      > ---------------------------------------------------------------
      > Go to http://linux-bangalore.org for more information
      > about us, as well as our other mailing lists
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >

      *********************************************************
      Disclaimer

      This message (including any attachments) contains
      confidential information intended for a specific
      individual and purpose, and is protected by law.
      If you are not the intended recipient, you should
      delete this message and are hereby notified that
      any disclosure, copying, or distribution of this
      message, or the taking of any action based on it,
      is strictly prohibited.

      *********************************************************

      Visit us at http://www.mahindrabt.com
    • Sukesh
      Thanx I got it. Now I am facing some probs again.... Questions Can I link static and dynamic libraries ? I am trying to do that and I am getting core dump
      Message 2 of 3 , Jul 2 3:36 AM
      • 0 Attachment
        Thanx I got it.

        Now I am facing some probs again....

        Questions

        Can I link static and dynamic libraries ?
        I am trying to do that and I am getting core dump when i run the executable.

        The executable is working fine when i link both static libraries.

        Help me out with more glittarence.

        Thanx in advance
        Sukesh

        ----- Original Message -----
        From: kirti
        To: linux-bangalore-programming@yahoogroups.com
        Sent: Monday, July 01, 2002 6:57 PM
        Subject: Re: [blug-prog] Shared Library Creation


        There is little bit confusion here...

        When static library is linked with executable then size of executable is
        more than the executable linked with dynamic library...
        That doesn't mean that the size of dynamic library should be smaller than
        static library...
        u shd differentiate the size of executable & size of library...
        size of dynamic lib may increase as it has to keep run time information...

        please correct me ..if I am wrong..

        r_
        Kirti




        > Hi All
        >
        > I am creating a shared library using
        > % gcc -shared -fPIC -o libtest1.so test1.o
        >
        > % gcc -shared -fPIC -o libtest2.so test2.o
        >
        > If I compare these .so with static library created by
        >
        > ar -rv libtest1.a test1.o
        >
        > ar -rv libtest2.a test2.o
        >
        >
        >
        > Actually dynamically created library size should be smaller than static
        creation, According to my results for some libraries I am getting static
        size lesser than the dynamically created ..
        >
        > WHY?
        >
        > Please correct me if I am issuing a wrong command for creation of
        libraries.
        >
        >
        >
        > Thanx in Advance
        >
        > Sukesh
        >
        >
        >
        >
        >
        >
        ********************************DISCLAIMER**********************************
        >
        > This e-mail and any attachment is for authorised use by the intended
        > recipient(s) only. It may contain proprietary material, confidential
        > information and/or be subject to legal privilege of Deccanet Designs Ltd.
        > If you have received this message in error, please notify the originator
        > immediately. If you are not the intended recipient, you are notified that
        > you are strictly prohibited from retaining, using, copying, altering or
        > disclosing the contents of this message.
        >
        >
        ****************************************************************************
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >
        > ---------------------------------------------------------------
        > This is the programming list of the Bangalore Linux Users Group
        > ---------------------------------------------------------------
        > Go to http://linux-bangalore.org for more information
        > about us, as well as our other mailing lists
        >
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
        >

        *********************************************************
        Disclaimer

        This message (including any attachments) contains
        confidential information intended for a specific
        individual and purpose, and is protected by law.
        If you are not the intended recipient, you should
        delete this message and are hereby notified that
        any disclosure, copying, or distribution of this
        message, or the taking of any action based on it,
        is strictly prohibited.

        *********************************************************

        Visit us at http://www.mahindrabt.com


        ---------------------------------------------------------------
        This is the programming list of the Bangalore Linux Users Group
        ---------------------------------------------------------------
        Go to http://linux-bangalore.org for more information
        about us, as well as our other mailing lists


        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



        ********************************DISCLAIMER**********************************

        This e-mail and any attachment is for authorised use by the intended
        recipient(s) only. It may contain proprietary material, confidential
        information and/or be subject to legal privilege of Deccanet Designs Ltd.
        If you have received this message in error, please notify the originator
        immediately. If you are not the intended recipient, you are notified that
        you are strictly prohibited from retaining, using, copying, altering or
        disclosing the contents of this message.

        ****************************************************************************

        [Non-text portions of this message have been removed]
      • kirti
        There should not be any problem while linking both the types of libraries... check if u r linking properly... if fisible then send me code off-list... r_ Kirti
        Message 3 of 3 , Jul 2 3:42 AM
        • 0 Attachment
          There should not be any problem while linking both the types of libraries...
          check if u r linking properly...

          if fisible then send me code off-list...
          r_
          Kirti


          > Thanx I got it.
          >
          > Now I am facing some probs again....
          >
          > Questions
          >
          > Can I link static and dynamic libraries ?
          > I am trying to do that and I am getting core dump when i run the
          executable.
          >
          > The executable is working fine when i link both static libraries.
          >
          > Help me out with more glittarence.
          >
          > Thanx in advance
          > Sukesh
          >
          > ----- Original Message -----
          > From: kirti
          > To: linux-bangalore-programming@yahoogroups.com
          > Sent: Monday, July 01, 2002 6:57 PM
          > Subject: Re: [blug-prog] Shared Library Creation
          >
          >
          > There is little bit confusion here...
          >
          > When static library is linked with executable then size of executable is
          > more than the executable linked with dynamic library...
          > That doesn't mean that the size of dynamic library should be smaller
          than
          > static library...
          > u shd differentiate the size of executable & size of library...
          > size of dynamic lib may increase as it has to keep run time
          information...
          >
          > please correct me ..if I am wrong..
          >
          > r_
          > Kirti
          >
          >
          >
          >
          > > Hi All
          > >
          > > I am creating a shared library using
          > > % gcc -shared -fPIC -o libtest1.so test1.o
          > >
          > > % gcc -shared -fPIC -o libtest2.so test2.o
          > >
          > > If I compare these .so with static library created by
          > >
          > > ar -rv libtest1.a test1.o
          > >
          > > ar -rv libtest2.a test2.o
          > >
          > >
          > >
          > > Actually dynamically created library size should be smaller than
          static
          > creation, According to my results for some libraries I am getting static
          > size lesser than the dynamically created ..
          > >
          > > WHY?
          > >
          > > Please correct me if I am issuing a wrong command for creation of
          > libraries.
          > >
          > >
          > >
          > > Thanx in Advance
          > >
          > > Sukesh
          > >
          > >
          > >
          > >
          > >
          > >
          >
          ********************************DISCLAIMER**********************************
          > >
          > > This e-mail and any attachment is for authorised use by the intended
          > > recipient(s) only. It may contain proprietary material, confidential
          > > information and/or be subject to legal privilege of Deccanet Designs
          Ltd.
          > > If you have received this message in error, please notify the
          originator
          > > immediately. If you are not the intended recipient, you are notified
          that
          > > you are strictly prohibited from retaining, using, copying, altering
          or
          > > disclosing the contents of this message.
          > >
          > >
          >
          ****************************************************************************
          > >
          > > [Non-text portions of this message have been removed]
          > >
          > >
          > >
          > > ---------------------------------------------------------------
          > > This is the programming list of the Bangalore Linux Users Group
          > > ---------------------------------------------------------------
          > > Go to http://linux-bangalore.org for more information
          > > about us, as well as our other mailing lists
          > >
          > >
          > > Your use of Yahoo! Groups is subject to
          http://docs.yahoo.com/info/terms/
          > >
          > >
          >
          > *********************************************************
          > Disclaimer
          >
          > This message (including any attachments) contains
          > confidential information intended for a specific
          > individual and purpose, and is protected by law.
          > If you are not the intended recipient, you should
          > delete this message and are hereby notified that
          > any disclosure, copying, or distribution of this
          > message, or the taking of any action based on it,
          > is strictly prohibited.
          >
          > *********************************************************
          >
          > Visit us at http://www.mahindrabt.com
          >
          >
          > ---------------------------------------------------------------
          > This is the programming list of the Bangalore Linux Users Group
          > ---------------------------------------------------------------
          > Go to http://linux-bangalore.org for more information
          > about us, as well as our other mailing lists
          >
          >
          > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
          >
          >
          >
          >
          ********************************DISCLAIMER**********************************
          >
          > This e-mail and any attachment is for authorised use by the intended
          > recipient(s) only. It may contain proprietary material, confidential
          > information and/or be subject to legal privilege of Deccanet Designs Ltd.
          > If you have received this message in error, please notify the originator
          > immediately. If you are not the intended recipient, you are notified that
          > you are strictly prohibited from retaining, using, copying, altering or
          > disclosing the contents of this message.
          >
          >
          ****************************************************************************
          >
          > [Non-text portions of this message have been removed]
          >
          >
          > ---------------------------------------------------------------
          > This is the programming list of the Bangalore Linux Users Group
          > ---------------------------------------------------------------
          > Go to http://linux-bangalore.org for more information
          > about us, as well as our other mailing lists
          >
          >
          > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          >
          >

          *********************************************************
          Disclaimer

          This message (including any attachments) contains
          confidential information intended for a specific
          individual and purpose, and is protected by law.
          If you are not the intended recipient, you should
          delete this message and are hereby notified that
          any disclosure, copying, or distribution of this
          message, or the taking of any action based on it,
          is strictly prohibited.

          *********************************************************

          Visit us at http://www.mahindrabt.com
        Your message has been successfully submitted and would be delivered to recipients shortly.