473,385 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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
Jun 27 '08 #1
4 8345
On 26 Jun 2008 at 20:14, fd*****@gmail.com 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.

Jun 27 '08 #2
Antoninus Twink wrote:
On 26 Jun 2008 at 20:14, fd*****@gmail.com 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_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


--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Jun 27 '08 #3
fd*****@gmail.com 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
Jun 27 '08 #4
On Thu, 26 Jun 2008 16:06:34 -0500, Stephen Sprunk
<st*****@sprunk.orgwrote:
fd*****@gmail.com 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.net
Jul 7 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: hvaisane | last post by:
Valgrind says ==11604== Invalid read of size 4 ==11604== at 0x8048ABB: main (foo.cc:36) ==11604== Address 0x1B92415C is 4 bytes inside a block of size 8 free'd ==11604== at 0x1B90514F:...
75
by: Beni | last post by:
I have been programming in C for about a year now. It sounds silly, but I never took the time to question why a C(or C++ or Java) program execution begins only at the main(). Is it a convention or...
5
by: Genboy | last post by:
My "VIS" Website, which is a C# site created in VS.NET, Framework 1.1, is no longer compiling for me via the command line. As I have done 600 times in the last year and a half, I can compile to...
1
by: Alan Silver | last post by:
Hello, I have a page in which I'm trying to give the user the chance to manipulate a list of items. These are the price variations for a product, so each item consists of a name (eg, small,...
7
by: storyGerald | last post by:
Usually, people write the program like this: // a very easy example: #include <cstring> int main() { size_t length = strlen("Hello, world!\n"); return 0; }
2
by: Mikus Sleiners | last post by:
I have a control - textBox1 that is binded to objects propery - "Currency" and another control - textBox2 (read only) that is also binded to same propery. Now, i have a situation where textbox1...
2
by: rockins | last post by:
Hi all, I downloaded Python-2.5.2.tar.bz2 and want to lean some math function implementation in it. I found that mathmodule.c implements 'math' module of python. In this file there's a function...
5
by: rembremading | last post by:
Hi All, I want to use intels LibM math library for my c program under Linux with intel compiler 10.1. I tried to follow the steps in...
1
by: tilley.rb | last post by:
Hi guys, Testing some older versions of Python. 2.2.3 compiled and runs just fine on same machine. I get this error during 2.3.7 make: case $MAKEFLAGS in \ *-s*) CC='gcc -pthread'...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.