From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@9fans.net From: Richard Miller <9fans@hamnavoe.com> Date: Sun, 18 May 2008 16:57:19 +0100 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Linker weirdness? (was: Assembler weirdness?) Topicbox-Message-UUID: ab111f20-ead3-11e9-9d60-3106f5b1d025 > But now when I go to link I get these weird errors about undefined > symbols in a function that they are not even related to. Yes, the linker is being weird or at least misleading when it reports undefined symbols: > simplelang: np: not defined > simplelang: apm: not defined > simplelang: gdt: not defined It is telling you which procedure it was processing when it detected the error, not necessarily which procedure was responsible for the error. Because it is not known which symbols are undefined until all object files have been seen, the "not defined" messages are all labelled with the last procedure of the last object file to be processed. You can get more useful information by doing something like: term% nm *.8 ../port/*.a | grep ' ((np)|(apm)|(gdt))$' gdt.8: d gdt onlyin.8: U apm onlyin.8: U gdt onlyin.8: U np This tells you that gdt is actually there but it's been declared as a static (local) label; and np and apm are referenced in onlyin.8 but not defined anywhere.