9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: David Presotto <presotto@closedmind.org>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] 8a: getting the address of a label
Date: Mon, 29 Dec 2003 20:59:44 -0500	[thread overview]
Message-ID: <1e8a304212c5eefd284f3added9d6816@plan9.bell-labs.com> (raw)
In-Reply-To: <20031229230325.GA18194@ionkov.net>

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

I was going to suggest TEXT originally and then thought better of it mostly
because
1) we haven't been very clear about what that second argument does
2) how much code reordering the linkers will do

However, once you've figured out (1) for the particular architecture you're
working with, you can avoid (2) by doing:

	jmp	x

TEXT	x, $0

	blah bah blah

Not elegant but servicable.

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

From: Latchesar Ionkov <lucho@ionkov.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] 8a: getting the address of a label
Date: Mon, 29 Dec 2003 18:03:25 -0500
Message-ID: <20031229230325.GA18194@ionkov.net>

On Tue, Dec 30, 2003 at 05:54:10AM +1100, Bruce Ellis said:
> you can do this with the current ?a and ?l.
> just go crazy working out what the TEXT
> directive actually does.  there is no need
> for it to be only used at the beginning of
> a function.

Is there any guarantee that the TEXT symbols will be laid out in the order
they appear in the file?

Also, if I remember correctly there are some checks
if PUSH/POP instructions are balanced (which I currently disabled). I am
sure that making some labels TEXT directives will break it even further ...

Thanks,
	Lucho

>
> brucee
> ----- Original Message -----
> From: "Latchesar Ionkov" <lucho@ionkov.net>
> To: <9fans@cse.psu.edu>
> Sent: Tuesday, December 30, 2003 1:42 AM
> Subject: [9fans] 8a: getting the address of a label
>
>
> > Hi,
> >
> > I am still playing with the gcc port ...
> >
> > It would be very helpful, if Plan9 assembler and loader allow getting the
> > addresses of the labels. The exception handling code is messy enough even
> > without me trying to avoid using label addresses :( Also it would be useful
> > for better implementation of the switch statement, as well as some gcc
> > specific features like __label__ variables.
> >
> > Is there a chance that a patch that implements that will be accepted?
> >
> > Thanks,
> > Lucho

      reply	other threads:[~2003-12-30  1:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-29 14:42 Latchesar Ionkov
2003-12-29 16:32 ` David Presotto
2003-12-29 18:54 ` Bruce Ellis
2003-12-29 23:03   ` Latchesar Ionkov
2003-12-30  1:59     ` David Presotto [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=1e8a304212c5eefd284f3added9d6816@plan9.bell-labs.com \
    --to=presotto@closedmind.org \
    --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).