what does libm.a contain?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • fd97207@gmail.com

    what does libm.a contain?

    when I did a dir libm.a on my m/c I was surprised to find the size of
    the file is only about 500 bytes. What does it contain? And from which
    file does the math code actually come from? I have MinGW setup on my m/
    c
  • Antoninus Twink

    #2
    Re: what does libm.a contain?

    On 26 Jun 2008 at 20:14, fd97207@gmail.c om wrote:
    when I did a dir libm.a on my m/c I was surprised to find the size of
    the file is only about 500 bytes. What does it contain? And from which
    file does the math code actually come from? I have MinGW setup on my m/
    c
    Why not extract it (ar -x) and see? You can see what symbols are in the
    resulting object files by using a program like nm.

    500 bytes does seem somewhat small for libm! Guess: the math library is
    linked automatically under the Mingw compiler system, and this is a
    "dummy library" that only exists to make typical *nix/gcc Makefiles with
    "-lm" command lines still work.

    Comment

    • jacob navia

      #3
      Re: what does libm.a contain?

      Antoninus Twink wrote:
      On 26 Jun 2008 at 20:14, fd97207@gmail.c om wrote:
      >when I did a dir libm.a on my m/c I was surprised to find the size of
      >the file is only about 500 bytes. What does it contain? And from which
      >file does the math code actually come from? I have MinGW setup on my m/
      >c
      >
      Why not extract it (ar -x) and see? You can see what symbols are in the
      resulting object files by using a program like nm.
      >
      500 bytes does seem somewhat small for libm! Guess: the math library is
      linked automatically under the Mingw compiler system, and this is a
      "dummy library" that only exists to make typical *nix/gcc Makefiles with
      "-lm" command lines still work.
      >
      Using lcc-win to dump the contents of libm.a conforms your
      theory:
      Contents of libm.a 492 bytes


      Archive header:1
      Name:'/ '
      Date:' 941967385 (Sun Nov 07 10:36:25 1999) '
      User id:'0 '
      Group id:'0 '
      File Mode:'0 '
      File Size:'4 '

      First linker member
      ----- ------ ------
      0 (0) symbols contained in the archive <---------look at this

      Archive header:2
      Name:'_libm_dum my.o/ '
      Date:' 941967385 (Sun Nov 07 10:36:25 1999) '
      User id:'108 '
      Group id:'101 '
      File Mode:'100644 '
      File Size:'359 '
      Offset in file 132 Dump of object file _libm_dummy.o/

      Section Table
      01 .text PhysAddr: 00000000 VirtAddr: 00000000 0x00000000
      raw data offs: 00000 raw data size: 00000 (1 pages)
      // 0 bytes for text

      02 .data PhysAddr: 00000000 VirtAddr: 00000000 0x00000000
      raw data offs: 00000 raw data size: 00000 (1 pages)
      // O bytes for data

      03 .bss PhysAddr: 00000016 VirtAddr: 00000000 0x00000000
      raw data offs: 00000 raw data size: 00000 (1 pages)
      // 0 bytes for bss




      --
      jacob navia
      jacob at jacob point remcomp point fr
      logiciels/informatique

      Comment

      • Stephen Sprunk

        #4
        Re: what does libm.a contain?

        fd97207@gmail.c om wrote:
        when I did a dir libm.a on my m/c I was surprised to find the size of
        the file is only about 500 bytes. What does it contain? And from which
        file does the math code actually come from? I have MinGW setup on my m/
        c
        libm.a is an implementation detail and thus off-topic here.

        <OT>
        Some systems put large/complex math functions in a separate library
        called libm, others put them in the standard library called libc. Your
        system appears to have an empty libm, which is likely so that programs
        specified to link with libm on other platforms (where it's required)
        will also link properly on your system (where it's not). There are
        other possible explanations as well.
        </OT>

        S

        Comment

        • David Thompson

          #5
          Re: what does libm.a contain?

          On Thu, 26 Jun 2008 16:06:34 -0500, Stephen Sprunk
          <stephen@sprunk .orgwrote:
          fd97207@gmail.c om wrote:
          when I did a dir libm.a on my m/c I was surprised to find the size of
          the file is only about 500 bytes. What does it contain? And from which
          file does the math code actually come from? I have MinGW setup on my m/
          c
          >
          libm.a is an implementation detail and thus off-topic here.
          >
          <OT>
          Some systems put large/complex math functions in a separate library
          called libm, others put them in the standard library called libc. Your
          system appears to have an empty libm, which is likely so that programs
          specified to link with libm on other platforms (where it's required)
          will also link properly on your system (where it's not). There are
          other possible explanations as well.
          </OT>
          >
          <still OT>
          MingW in particular uses the Microsoft library (more specifically, the
          older-version but universally deployed DLL nondebug library) MSVCRT
          for most of its library functionality, adding and replacing (mostly in
          libmingwex) those routines that are not (consistently) provided or not
          (always) correct in MSVCRT. MSVCRT does not separate math from
          nonmath, and so it would not make sense for MingW to do so.
          </>

          - formerly david.thompson1 || achar(64) || worldnet.att.ne t

          Comment

          Working...