From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <14ec7b180903031552s31ac6f7bn538bedbd960c342e@mail.gmail.com> References: <14ec7b180903031454q70b2493bha58deefc2de53f8@mail.gmail.com> <509071940903031543u66cbfc7bw8521ff7968c1fe07@mail.gmail.com> <14ec7b180903031552s31ac6f7bn538bedbd960c342e@mail.gmail.com> Date: Wed, 4 Mar 2009 12:56:17 +0100 Message-ID: <3229c0130903040356u315db58ej3bc30e24b434d425@mail.gmail.com> From: Enrique Soriano To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [9fans] 8c, 8l, and empty files Topicbox-Message-UUID: afb5700c-ead4-11e9-9d60-3106f5b1d025 > "Garbage-in, Garbage-out" What does it happen when you try to link an object file that does not have main() defined? And when you try to link a malformed object file? In these cases, there is not any garbage-out for the garbage-in. There is an error, as expected. > two things: the linker doesn't only produce binaries, it has options > for producing other output in which a null object file may be > applicable; In most cases it is used to create a binary. > furthermore, it takes more than a single file, so you can > see how a #ifdef-ed C file compiles to nothing (even if it's bad > practice) but then is linked with other parts of the program just > fine. In the example, I was linking a *unique* empty object file. To create a 0 byte exec file, that is, a binary without a header, is a nonsense. Regards, Q.