Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!timbuk!lord From: lord@sequoia.cray.com (Steven Lord) Newsgroups: comp.sys.acorn Subject: Re: C versus ARM take 2 Message-ID: <033143.8965@timbuk.cray.com> Date: 25 Feb 91 10:31:15 GMT References: <807@utrcu1.UUCP> Reply-To: lord@sequoia.cray.com (Steven Lord) Organization: Cray Research, Inc. Lines: 33 >>If you write "Hello World" using then yes, you get lots of junk. >>The point is that it's all OPTIONAL junk, which you asked for, and a smart >>compiler and linker can even cut out most of that. [...] >The point I was trying to make was that it is NOT OPTIONAL junk : you're >stuck with the other bulk if you want a few bits out of a package. If the >compiler or linker can filter it : fine ! Acorn's doesn't do it (yet), and >that's the one we have to work with. This is not a function of the compiler or the linker, it is the way the C library is organised. The library is basically an archive of relocatable object code files, the linker looks through it and pulls in the object files it needs to fulfill all the unresolved references in your code. The problem is that Acorn's library is made up of a smallish number of files each with a lot of functions in them, so you probably are getting stuff you don't need. Splitting the library into more files would have helped, but it might have meant the linker had to be more sophisticated, and would have needed more memory to work with (this is a guess). Acorn's way round this is the shared C library, if you link with the o.stubs file instead of the actual library your binary on disc is a lot smaller, and if you use Acorn's applications the shared C library will get loaded anyway. printf("Hello world\n") is a silly thing to do, printf() is for formatted output and has lots of features you don't need for this example, puts() is for strings (but since Acorn probably have them both in the sme source file you probably get printf anyway :-). Steve Lord