9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <forsyth@terzarima.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] linker bug
Date: Fri, 26 Nov 2004 12:37:41 +0000	[thread overview]
Message-ID: <211e0549b6190c6b06826b118ff1fc88@terzarima.net> (raw)
In-Reply-To: <Pine.BSI.4.58.0411250842340.6130@malasada.lava.net>

[-- Attachment #1: Type: text/plain, Size: 358 bytes --]

the -R option means: the thing that reads in this program will put
the data at an offset that is consistent with the value given by
-R, so round the start of data accordingly.
if it's right in the symbol table, and in the instructions, kl
is correct.  the problem will be with the program (bootstrap?)
that reads in the program and sets it up in memory.

[-- Attachment #2: Type: message/rfc822, Size: 2915 bytes --]

From: Tim Newsham <newsham@lava.net>
To: 9fans@cse.psu.edu
Subject: [9fans] linker bug
Date: Thu, 25 Nov 2004 08:46:12 -1000 (HST)
Message-ID: <Pine.BSI.4.58.0411250842340.6130@malasada.lava.net>

There appears to be a bug in the linker (at least in kl) when
using the -R flag.  When I specify a value of -R0x4 everything
seems to work fine.  If I specify larger values such as -R0x10,
then occasionally (depending on the size of the text region,
I presume) the emitted binary is incorrect.  For example, if
I have an initialized variable:

    static int x = 0x12345678;

then the address of x (in the symbol table and as referenced
by the instructions) will not line up with the initialized word
that contains the value 0x12345678.

I've stopped using the flag in this way (turns out I didnt need
it after all), so I haven't tracked down the bug any further,
but thought I'd mention it before it bites someone else.

Tim N.

      reply	other threads:[~2004-11-26 12:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-25 18:46 Tim Newsham
2004-11-26 12:37 ` Charles Forsyth [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=211e0549b6190c6b06826b118ff1fc88@terzarima.net \
    --to=forsyth@terzarima.net \
    --cc=9fans@cse.psu.edu \
    /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).