what does libm.a contain?

F

fd97207

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
 
A

Antoninus Twink

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.
 
J

jacob navia

Antoninus said:
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_dummy.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
 
S

Stephen Sprunk

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
 
D

David Thompson

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.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top