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

[MiNT] a.out linking



Hello,

I'd like to ask about one thing, probably very trivial, but I have no
idea if it's bug to report or "feature" of a.out format. Imagine I've
got 3 files, a.c, b.c and c.c, each with only one function inside,
without further dependencies except c.c, which references function in
a.c. Now, I compile it with m68k-atari-mint-gcc, I get a.o, b.o, c.o.

What I don't understand is why when I link "m68k-atari-mint-gcc -o out
a.o b.o c.o" I get bigger result than "m68k-atari-mint-gcc -o out a.o
c.o". I understand a.out is unable to separate files into more than
one text section but why on earth, when whole file (in our case with
only one function) is unused, linker just didn't skip it? It knows the
function inside is referenced by no one or not?

-- 
MiKRO / Mystic Bytes
http://mikro.atari.org