9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] 6a bug
Date: Thu, 17 Nov 2011 11:15:24 -0500	[thread overview]
Message-ID: <7f3af1a5a40021d1809780aeb2bc93b0@brasstown.quanstro.net> (raw)
In-Reply-To: <CADSkJJU2s1r8Qi=F9eT=+i2mCatxB+c_70teMBkQ3ToOsazGDA@mail.gmail.c>

> This is a detail of the x86-64 architecture.
> An immediate in an arithmetic instruction must
> fit in a signed 32-bit int, and this one does not.
> You've written an impossible instruction, and the
> linker is telling you in own cryptic way.
> The assemblers do not know such details, never have.
>
> You need to MOVQ that constant into a register
> and then use the register as the argument to ADDQ.

yup.  that's the problem.  i had forgotten this rule because
i changed from one 64-bit constant to another.  the tricky
bit about the first constant was that it was a sign-extended
32-bit constant, and the linker knew this little nugget.
so imagine my surprise when changing

#define KZERO		(0xfffffffff0000000ull)

to

#define KZERO		(0xffffff0000000000ull)

resulted in linker errors.

it all makes sense now.  (even if it is repulsive.)

- erik



      parent reply	other threads:[~2011-11-17 16:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16 22:25 erik quanstrom
2011-11-16 22:35 ` Charles Forsyth
2011-11-16 22:36   ` Charles Forsyth
2011-11-16 22:50 ` Russ Cox
2011-11-16 23:27   ` Charles Forsyth
     [not found] ` <CAOw7k5hJz=F13tUpq7mU3gSnSWr7H=y4rKCN-OUO-FOavBGygA@mail.gmail.c>
2011-11-17  0:50   ` erik quanstrom
2011-11-17 16:07     ` Russ Cox
2011-11-17 16:13       ` Charles Forsyth
     [not found]     ` <CADSkJJU2s1r8Qi=F9eT=+i2mCatxB+c_70teMBkQ3ToOsazGDA@mail.gmail.c>
2011-11-17 16:15       ` erik quanstrom [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=7f3af1a5a40021d1809780aeb2bc93b0@brasstown.quanstro.net \
    --to=quanstro@quanstro.net \
    --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).