9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Richard Miller <9fans@hamnavoe.com>
To: 9fans@9fans.net
Subject: Re: [9fans] Linker weirdness? (was: Assembler weirdness?)
Date: Sun, 18 May 2008 16:57:19 +0100	[thread overview]
Message-ID: <bc4bca6a2eba99050a123f748ada632b@hamnavoe.com> (raw)
In-Reply-To: <DE9DB11C-C5B4-4647-A4B2-675C3D8D531C@mac.com>

> 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.




      parent reply	other threads:[~2008-05-18 15:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-18  1:38 [9fans] Assembler weirdness? Pietro Gagliardi
2008-05-18  1:44 ` erik quanstrom
2008-05-18  2:21   ` Pietro Gagliardi
2008-05-18  2:56     ` [9fans] Linker weirdness? (was: Assembler weirdness?) Pietro Gagliardi
2008-05-18  4:01       ` Bruce Ellis
2008-05-18  4:35         ` [9fans] Linker weirdness? Robert William Fuller
2008-05-18  4:45           ` Bruce Ellis
2008-05-18 12:02       ` [9fans] Linker weirdness? (was: Assembler weirdness?) erik quanstrom
2008-05-18 12:36         ` Pietro Gagliardi
2008-05-18 15:57       ` Richard Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bc4bca6a2eba99050a123f748ada632b@hamnavoe.com \
    --to=9fans@hamnavoe.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).