When I look at libgpc.a with the "size" tool, I see that the file.o section has a rather large DATA section.
[G4:gcc-lib/powerpc-apple-darwin/3.3.2] adriaan% size libgpc.a __TEXT __DATA __OBJC others dec hex 14949 2992 0 0 17941 4615 libgpc.a(rts.o) 34176 49780 0 0 83956 147f4 libgpc.a(file.o) 5668 128 0 0 5796 16a4 libgpc.a(rts-va.o) 440 37 0 0 477 1dd libgpc.a(rtsc.o) 10368 93 0 0 10461 28dd libgpc.a(string.o) 21299 4074 0 0 25373 631d libgpc.a(error.o) 6457 109 0 0 6566 19a6 libgpc.a(string2.o) 21039 385 0 0 21424 53b0 libgpc.a(time.o) 2880 5106 0 0 7986 1f32 libgpc.a(random.o) 31866 6454 0 0 38320 95b0 libgpc.a(filename.o) 4929 141 0 0 5070 13ce libgpc.a(files.o) 5848 2149 0 0 7997 1f3d libgpc.a(getopt.o) 2216 37 0 0 2253 8cd libgpc.a(numtodec.o) 4560 281 0 0 4841 12e9 libgpc.a(sets.o) 2272 69 0 0 2341 925 libgpc.a(heap.o) 4928 81 0 0 5009 1391 libgpc.a(math.o) 1568 33 0 0 1601 641 libgpc.a(endian.o) 580 5 0 0 585 249 libgpc.a(move.o) 7470 430 0 0 7900 1edc libgpc.a(init.o) 64 33 0 0 97 61 libgpc.a(gpc.o)
Disassembly shows a 50 KB data chunk in file.o filled with (mainly) zero's. Looks to me like a waste of space.
Regards,
Adriaan van Os
Adriaan van Os wrote:
When I look at libgpc.a with the "size" tool, I see that the file.o section has a rather large DATA section.
Disassembly shows a 50 KB data chunk in file.o filled with (mainly) zero's. Looks to me like a waste of space.
That's Input, Output, StdErr (with their internal buffers).
Maybe this will change soon, but for other reasons (problems with files and nonlocal gotos). The reduced data section may then be a side effect (I'm not sure if it's really a side benefit, since the storage will then be allocated elsewhere, on the heap).
Frank