9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 8a: getting the address of a label
@ 2003-12-29 14:42 Latchesar Ionkov
  2003-12-29 16:32 ` David Presotto
  2003-12-29 18:54 ` Bruce Ellis
  0 siblings, 2 replies; 5+ messages in thread
From: Latchesar Ionkov @ 2003-12-29 14:42 UTC (permalink / raw)
  To: 9fans

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 8a: getting the address of a label
  2003-12-29 14:42 [9fans] 8a: getting the address of a label Latchesar Ionkov
@ 2003-12-29 16:32 ` David Presotto
  2003-12-29 18:54 ` Bruce Ellis
  1 sibling, 0 replies; 5+ messages in thread
From: David Presotto @ 2003-12-29 16:32 UTC (permalink / raw)
  To: 9fans

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

If it doesn't break anything else, I don't see why not.

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

From: Latchesar Ionkov <lucho@ionkov.net>
To: 9fans@cse.psu.edu
Subject: [9fans] 8a: getting the address of a label
Date: Mon, 29 Dec 2003 09:42:45 -0500
Message-ID: <20031229144245.GA16735@ionkov.net>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 8a: getting the address of a label
  2003-12-29 14:42 [9fans] 8a: getting the address of a label Latchesar Ionkov
  2003-12-29 16:32 ` David Presotto
@ 2003-12-29 18:54 ` Bruce Ellis
  2003-12-29 23:03   ` Latchesar Ionkov
  1 sibling, 1 reply; 5+ messages in thread
From: Bruce Ellis @ 2003-12-29 18:54 UTC (permalink / raw)
  To: 9fans

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.

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 8a: getting the address of a label
  2003-12-29 18:54 ` Bruce Ellis
@ 2003-12-29 23:03   ` Latchesar Ionkov
  2003-12-30  1:59     ` David Presotto
  0 siblings, 1 reply; 5+ messages in thread
From: Latchesar Ionkov @ 2003-12-29 23:03 UTC (permalink / raw)
  To: 9fans

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 8a: getting the address of a label
  2003-12-29 23:03   ` Latchesar Ionkov
@ 2003-12-30  1:59     ` David Presotto
  0 siblings, 0 replies; 5+ messages in thread
From: David Presotto @ 2003-12-30  1:59 UTC (permalink / raw)
  To: 9fans

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-12-30  1:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-29 14:42 [9fans] 8a: getting the address of a label 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 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).