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

Re: [MiNT] math.h



Miro Kropacek wrote:
Only one note: as far as I remember, since we're still using that a.out format even for object files, does not this implies the size of libc.a will grow no matter if the user uses 1/10 or that math lib or 1/2? The final binary of simple hello world is quite huge even in the present.

There is no problem.

The only point to care about with a.out is to define only one function in a .c file (or several interdependent functions). This is because a .o file is either fully linked, either not linked at all. So if there are unused functions in a .c, they will take useless space in the final executable, and even worse, it will be recursively the same for the dependencies of the unused functions.

The rule is: for each externally visible function in a .c, the whole contents of the .c file must be useful. If some other functions are unrelated, they should go into another .c file.

If libc.a becomes bigger and bigger, there will be no problem, because only the required .o files will be linked in the executable. We just have to be careful about function dependencies, in order to avoid embedding a lot of stuff in the final executable.

About the idea of merging fdlibm into the MiNTLib, I guess that Alan wants to merge the fdlibm sources into the MiNTLib source package. The MiNTLib sources currently produces libc.a, libiio.a, librpcsvc.a. After the merge, it will produce libm.a, too. The idea is to have only one source package instead of two. There will be no change for the MiNTLib users.

--
Vincent Rivière