Report forwarded to debian-bugs-dist@lists.debian.org, chris@debian.org (Christopher C. Chimelis):
Bug#87733; Package binutils.
debian-bugs-dist@lists.debian.orgchris@debian.org (Christopher C. Chimelis)
Subject: Bug#87733: binutils: as: funky error message (Subtraction of two symbols in different sections)
Reply-To: Alexandre Duret-Lutz , 87733@bugs.debian.org
Resent-From: Alexandre Duret-Lutz
Orignal-Sender: Alexandre Duret-Lutz
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: chris@debian.org (Christopher C. Chimelis)
Resent-Date: Mon, 26 Feb 2001 16:49:19 GMT
Resent-Message-ID:
Resent-Sender: owner@bugs.debian.org
X-Debian-PR-Message: report 87733
X-Debian-PR-Package: binutils
X-Debian-PR-Keywords:
X-Loop: owner@bugs.debian.org
Received: via spool by bugs@bugs.debian.org id=B.98320586718030
(code B ref -1); Mon, 26 Feb 2001 16:49:19 GMT
From: Alexandre Duret-Lutz
To: submit@bugs.debian.org
X-Mailer: bug 3.3.9
Message-Id:
Sender: Alexandre Duret-Lutz
Date: Mon, 26 Feb 2001 17:51:10 +0100
Delivered-To: submit@bugs.debian.org
Package: binutils
Version: 2.10.91.0.2-1
Severity: normal
Hi
I believe I'm seeing something unexpected from gas:
~/tmp % cat huh.s
.data
x: .dc.b 0
.text
y: .dc.b 0
.dc.l x - y
.dc.l y - x
~/tmp % as huh.s
huh.s: Assembler messages:
huh.s:7: Error: Subtraction of two symbols in different sections ".text" {.text section} - "x" {.data section} at file address 5.
~/tmp %
What bugs me is:
* there is only one `Error:' line (why would `x - y' be
allowed if `y - x' is not?)
* the reading of the error itself is suspicious (I would
expect s/".text"/"y"/)
-- System Information
Debian Release: testing/unstable
Kernel Version: Linux phobos 2.4.0-test11 #8 Fri Dec 1 14:23:08 CET 2000 i586 unknown
Versions of the packages binutils depends on:
ii libc6 2.2.2-1 GNU C Library: Shared libraries and Timezone
Acknowledgement sent to Alexandre Duret-Lutz <duret_g@lrde.epita.fr>:
New Bug report received and forwarded. Copy sent to chris@debian.org (Christopher C. Chimelis).
-t
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: Alexandre Duret-Lutz
Subject: Bug#87733: Acknowledgement (binutils: as: funky error message (Subtraction of two symbols in different sections))
Message-ID:
In-Reply-To:
References:
X-Debian-PR-Message: ack 87733
Thank you for the problem report you have sent regarding Debian.
This is an automatically generated reply, to let you know your message has
been received. It is being forwarded to the developers mailing list for
their attention; they will reply in due course.
Your message has been sent to the package maintainer(s):
chris@debian.org (Christopher C. Chimelis)
If you wish to submit further information on your problem, please send
it to 87733@bugs.debian.org (and *not* to
bugs@bugs.debian.org).
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the Bug-tracking system.
Darren Benham
(administrator, Debian Bugs database)
Received: (at submit) by bugs.debian.org; 26 Feb 2001 16:44:27 +0000
From duret_g@lrde.epita.fr Mon Feb 26 10:44:27 2001
Return-path:
Received: from hermes.epita.fr [::ffff:163.5.255.10]
by master.debian.org with esmtp (Exim 3.12 1 (Debian))
id 14XQl9-0004gg-00; Mon, 26 Feb 2001 10:44:27 -0600
Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2])
by hermes.epita.fr id RAA23180
Mon, 26 Feb 2001 17:44:04 GMT
Received: from phobos.lrde.epita.fr ([10.223.13.38] ident=mail)
by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
id 14XQre-0001GA-00; Mon, 26 Feb 2001 17:51:10 +0100
Received: from adl by phobos.lrde.epita.fr with local (Exim 3.22 #1)
id 14XQre-0002rE-00; Mon, 26 Feb 2001 17:51:10 +0100
From: Alexandre Duret-Lutz
Subject: binutils: as: funky error message (Subtraction of two symbols in different sections)
To: submit@bugs.debian.org
X-Mailer: bug 3.3.9
Message-Id:
Sender: Alexandre Duret-Lutz
Date: Mon, 26 Feb 2001 17:51:10 +0100
Delivered-To: submit@bugs.debian.org
Package: binutils
Version: 2.10.91.0.2-1
Severity: normal
Hi
I believe I'm seeing something unexpected from gas:
~/tmp % cat huh.s
.data
x: .dc.b 0
.text
y: .dc.b 0
.dc.l x - y
.dc.l y - x
~/tmp % as huh.s
huh.s: Assembler messages:
huh.s:7: Error: Subtraction of two symbols in different sections ".text" {.text section} - "x" {.data section} at file address 5.
~/tmp %
What bugs me is:
* there is only one `Error:' line (why would `x - y' be
allowed if `y - x' is not?)
* the reading of the error itself is suspicious (I would
expect s/".text"/"y"/)
-- System Information
Debian Release: testing/unstable
Kernel Version: Linux phobos 2.4.0-test11 #8 Fri Dec 1 14:23:08 CET 2000 i586 unknown
Versions of the packages binutils depends on:
ii libc6 2.2.2-1 GNU C Library: Shared libraries and Timezone
Information forwarded to debian-bugs-dist@lists.debian.org, chris@debian.org (Christopher C. Chimelis):
Bug#87733; Package binutils.
debian-bugs-dist@lists.debian.orgchris@debian.org (Christopher C. Chimelis)
Subject: Bug#87733: binutils: as: funky error message (Subtraction of two symbols in different sections)
Reply-To: "Christopher C. Chimelis" , 87733@bugs.debian.org
Resent-From: "Christopher C. Chimelis"
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: chris@debian.org (Christopher C. Chimelis)
Resent-Date: Mon, 26 Feb 2001 19:11:01 GMT
Resent-Message-ID:
Resent-Sender: owner@bugs.debian.org
X-Debian-PR-Message: report 87733
X-Debian-PR-Package: binutils
X-Debian-PR-Keywords:
X-Loop: owner@bugs.debian.org
Received: via spool by 87733-bugs@bugs.debian.org id=B87733.98321226332371
(code B ref 87733); Mon, 26 Feb 2001 19:11:01 GMT
Date: Mon, 26 Feb 2001 13:30:51 -0500 (EST)
From: "Christopher C. Chimelis"
X-Sender: chris@spawn.hockeyfiend.com
To: Alexandre Duret-Lutz , 87733@bugs.debian.org
In-Reply-To:
Message-ID:
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Delivered-To: 87733@bugs.debian.org
On Mon, 26 Feb 2001, Alexandre Duret-Lutz wrote:
> I believe I'm seeing something unexpected from gas:
Actually, it was a bit odd to see at first, but I checked the gas manual:
*named sections*
*text section*
*data section*
These sections hold your program. `as' and `ld' treat them as
separate but equal sections. Anything you can say of one section
is true another. When the program is running, however, it is
customary for the text section to be unalterable. The text
section is often shared among processes: it contains instructions,
constants and the like. The data section of a running program is
usually alterable: for example, C variables would be stored in the
data section.
>
> What bugs me is:
> * there is only one `Error:' line (why would `x - y' be
> allowed if `y - x' is not?)
If you're attempting to alter the data segment, then it's ok since the
data segment can be altered, per the manual. The text segment, however,
is generally not. You could always try to use the -R option to gas, which
would combine the two sections.
C
Acknowledgement sent to "Christopher C. Chimelis" <chris@debian.org>:
Extra info received and forwarded to list. Copy sent to chris@debian.org (Christopher C. Chimelis).
-t
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: "Christopher C. Chimelis"
Subject: Bug#87733: Info received (was Bug#87733: binutils: as: funky error message (Subtraction of two symbols in different sections))
Message-ID:
In-Reply-To:
References:
X-Debian-PR-Message: ack-info-maintonly 87733
Thank you for the additional information you have supplied regarding
this problem report. It has been forwarded to the developer(s) and
to the developers mailing list to accompany the original report.
Your message has been sent to the package maintainer(s):
chris@debian.org (Christopher C. Chimelis)
If you wish to continue to submit further information on your problem,
please send it to 87733@bugs.debian.org, as before.
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the Bug-tracking system.
Darren Benham
(administrator, Debian Bugs database)
Received: (at 87733) by bugs.debian.org; 26 Feb 2001 18:31:03 +0000
From chris@debian.org Mon Feb 26 12:31:03 2001
Return-path:
Received: from dsl027-138-146-nyc1.dsl-isp.net (spawn.hockeyfiend.com) [::ffff:216.27.138.146]
by master.debian.org with esmtp (Exim 3.12 1 (Debian))
id 14XSQJ-0008Py-00; Mon, 26 Feb 2001 12:31:03 -0600
Received: from localhost ([127.0.0.1] ident=chris)
by spawn.hockeyfiend.com with esmtp (Exim 3.22 #1 (Debian))
id 14XSQ7-0001hK-00; Mon, 26 Feb 2001 13:30:51 -0500
Date: Mon, 26 Feb 2001 13:30:51 -0500 (EST)
From: "Christopher C. Chimelis"
X-Sender: chris@spawn.hockeyfiend.com
To: Alexandre Duret-Lutz , 87733@bugs.debian.org
Subject: Re: Bug#87733: binutils: as: funky error message (Subtraction of
two symbols in different sections)
In-Reply-To:
Message-ID:
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Delivered-To: 87733@bugs.debian.org
On Mon, 26 Feb 2001, Alexandre Duret-Lutz wrote:
> I believe I'm seeing something unexpected from gas:
Actually, it was a bit odd to see at first, but I checked the gas manual:
*named sections*
*text section*
*data section*
These sections hold your program. `as' and `ld' treat them as
separate but equal sections. Anything you can say of one section
is true another. When the program is running, however, it is
customary for the text section to be unalterable. The text
section is often shared among processes: it contains instructions,
constants and the like. The data section of a running program is
usually alterable: for example, C variables would be stored in the
data section.
>
> What bugs me is:
> * there is only one `Error:' line (why would `x - y' be
> allowed if `y - x' is not?)
If you're attempting to alter the data segment, then it's ok since the
data segment can be altered, per the manual. The text segment, however,
is generally not. You could always try to use the -R option to gas, which
would combine the two sections.
C
Information forwarded to debian-bugs-dist@lists.debian.org, chris@debian.org (Christopher C. Chimelis):
Bug#87733; Package binutils.
debian-bugs-dist@lists.debian.orgchris@debian.org (Christopher C. Chimelis)
Subject: Bug#87733: binutils: as: funky error message (Subtraction of two symbols in different sections)
Reply-To: Alexandre Duret-Lutz , 87733@bugs.debian.org
Resent-From: Alexandre Duret-Lutz
Orignal-Sender: Alexandre Duret-Lutz
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: chris@debian.org (Christopher C. Chimelis)
Resent-Date: Tue, 27 Feb 2001 09:49:16 GMT
Resent-Message-ID:
Resent-Sender: owner@bugs.debian.org
X-Debian-PR-Message: report 87733
X-Debian-PR-Package: binutils
X-Debian-PR-Keywords:
X-Loop: owner@bugs.debian.org
Received: via spool by 87733-bugs@bugs.debian.org id=B87733.9832671297589
(code B ref 87733); Tue, 27 Feb 2001 09:49:16 GMT
To: "Christopher C. Chimelis"
Cc: 87733@bugs.debian.org
References:
From: Alexandre Duret-Lutz
X-Home-Page: http://www.epita.fr/~duret_g/
X-Attribution: adl
Organization: LRDE/EPITA http://www.lrde.epita.fr/
Date: 27 Feb 2001 10:52:15 +0100
In-Reply-To:
Message-ID:
Lines: 49
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: Alexandre Duret-Lutz
Delivered-To: 87733@bugs.debian.org
Hi Christopher!
>>> "ccc" == Christopher C Chimelis writes:
ccc> On Mon, 26 Feb 2001, Alexandre Duret-Lutz wrote:
>> I believe I'm seeing something unexpected from gas:
ccc> Actually, it was a bit odd to see at first, but I checked the gas manual:
ccc> *named sections*
ccc> *text section*
ccc> *data section*
ccc> These sections hold your program. `as' and `ld' treat them as
ccc> separate but equal sections. Anything you can say of one section
ccc> is true another. When the program is running, however, it is
ccc> customary for the text section to be unalterable. The text
ccc> section is often shared among processes: it contains instructions,
ccc> constants and the like. The data section of a running program is
ccc> usually alterable: for example, C variables would be stored in the
ccc> data section.
I'm sorry I don't get it. How is this related to my report?
>> What bugs me is:
>> * there is only one `Error:' line (why would `x - y' be
>> allowed if `y - x' is not?)
ccc> If you're attempting to alter the data segment, then it's
ccc> ok since the data segment can be altered, per the manual.
ccc> The text segment, however, is generally not.
I still don't understand your answer :(. `altering' happens by
running some instructions at run-time (doesn't it?), but there
is nothing to run here, I'm just doing some constant
declarations. The quote above clearly says that sections are
all equal as the assembler is concerned (whether they will be
altered or not at run-time is none of the business of gas).
Thus it sounds irrelevant to my report (or I need to sleep).
What huh.s does is trying to compute (at compile time) the
distance between two labels in different sections. This is
wrong, I understand that. What I don't understand is why gas
reports only one of the two errors.
[...]
--
Alexandre Duret-Lutz
Acknowledgement sent to Alexandre Duret-Lutz <duret_g@lrde.epita.fr>:
Extra info received and forwarded to list. Copy sent to chris@debian.org (Christopher C. Chimelis).
-t
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: Alexandre Duret-Lutz
Subject: Bug#87733: Info received (was Bug#87733: binutils: as: funky error message (Subtraction of two symbols in different sections))
Message-ID:
In-Reply-To:
References:
X-Debian-PR-Message: ack-info-maintonly 87733
Thank you for the additional information you have supplied regarding
this problem report. It has been forwarded to the developer(s) and
to the developers mailing list to accompany the original report.
Your message has been sent to the package maintainer(s):
chris@debian.org (Christopher C. Chimelis)
If you wish to continue to submit further information on your problem,
please send it to 87733@bugs.debian.org, as before.
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the Bug-tracking system.
Darren Benham
(administrator, Debian Bugs database)
Received: (at 87733) by bugs.debian.org; 27 Feb 2001 09:45:29 +0000
From duret_g@lrde.epita.fr Tue Feb 27 03:45:29 2001
Return-path:
Received: from hermes.epita.fr [::ffff:163.5.255.10]
by master.debian.org with esmtp (Exim 3.12 1 (Debian))
id 14XghE-0001y8-00; Tue, 27 Feb 2001 03:45:29 -0600
Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2])
by hermes.epita.fr id KAA27788
Tue, 27 Feb 2001 10:45:01 GMT
Received: from phobos.lrde.epita.fr ([10.223.13.38] ident=mail)
by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
id 14Xgno-0007Tx-00; Tue, 27 Feb 2001 10:52:16 +0100
Received: from adl by phobos.lrde.epita.fr with local (Exim 3.22 #1)
id 14Xgnn-0003YW-00; Tue, 27 Feb 2001 10:52:15 +0100
To: "Christopher C. Chimelis"
Cc: 87733@bugs.debian.org
Subject: Re: Bug#87733: binutils: as: funky error message (Subtraction of two symbols in different sections)
References:
From: Alexandre Duret-Lutz
X-Home-Page: http://www.epita.fr/~duret_g/
X-Attribution: adl
Organization: LRDE/EPITA http://www.lrde.epita.fr/
Date: 27 Feb 2001 10:52:15 +0100
In-Reply-To:
Message-ID:
Lines: 49
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: Alexandre Duret-Lutz
Delivered-To: 87733@bugs.debian.org
Hi Christopher!
>>> "ccc" == Christopher C Chimelis writes:
ccc> On Mon, 26 Feb 2001, Alexandre Duret-Lutz wrote:
>> I believe I'm seeing something unexpected from gas:
ccc> Actually, it was a bit odd to see at first, but I checked the gas manual:
ccc> *named sections*
ccc> *text section*
ccc> *data section*
ccc> These sections hold your program. `as' and `ld' treat them as
ccc> separate but equal sections. Anything you can say of one section
ccc> is true another. When the program is running, however, it is
ccc> customary for the text section to be unalterable. The text
ccc> section is often shared among processes: it contains instructions,
ccc> constants and the like. The data section of a running program is
ccc> usually alterable: for example, C variables would be stored in the
ccc> data section.
I'm sorry I don't get it. How is this related to my report?
>> What bugs me is:
>> * there is only one `Error:' line (why would `x - y' be
>> allowed if `y - x' is not?)
ccc> If you're attempting to alter the data segment, then it's
ccc> ok since the data segment can be altered, per the manual.
ccc> The text segment, however, is generally not.
I still don't understand your answer :(. `altering' happens by
running some instructions at run-time (doesn't it?), but there
is nothing to run here, I'm just doing some constant
declarations. The quote above clearly says that sections are
all equal as the assembler is concerned (whether they will be
altered or not at run-time is none of the business of gas).
Thus it sounds irrelevant to my report (or I need to sleep).
What huh.s does is trying to compute (at compile time) the
distance between two labels in different sections. This is
wrong, I understand that. What I don't understand is why gas
reports only one of the two errors.
[...]
--
Alexandre Duret-Lutz
Information forwarded to debian-bugs-dist@lists.debian.org, chris@debian.org (Christopher C. Chimelis):
Bug#87733; Package binutils.
debian-bugs-dist@lists.debian.orgchris@debian.org (Christopher C. Chimelis)
Subject: Bug#87733: binutils: as: funky error message (Subtraction of two symbols in different sections)
Reply-To: "Christopher C. Chimelis" , 87733@bugs.debian.org
Resent-From: "Christopher C. Chimelis"
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: chris@debian.org (Christopher C. Chimelis)
Resent-Date: Tue, 27 Feb 2001 17:48:02 GMT
Resent-Message-ID:
Resent-Sender: owner@bugs.debian.org
X-Debian-PR-Message: report 87733
X-Debian-PR-Package: binutils
X-Debian-PR-Keywords:
X-Loop: owner@bugs.debian.org
Received: via spool by 87733-bugs@bugs.debian.org id=B87733.98329605724245
(code B ref 87733); Tue, 27 Feb 2001 17:48:02 GMT
Date: Tue, 27 Feb 2001 12:47:33 -0500 (EST)
From: "Christopher C. Chimelis"
X-Sender: chris@spawn.hockeyfiend.com
To: Alexandre Duret-Lutz
cc: 87733@bugs.debian.org
In-Reply-To:
Message-ID:
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Delivered-To: 87733@bugs.debian.org
On 27 Feb 2001, Alexandre Duret-Lutz wrote:
> I still don't understand your answer :(. `altering' happens by
> running some instructions at run-time (doesn't it?), but there
> is nothing to run here, I'm just doing some constant
> declarations.
I'm not sure what arch this is written for (I know Alpha and some MIPS
assembly and my Intel assembly knowledge is too rusty to be of use to me),
but it appears that you're declaring variables rather than constants,
which makes a big difference. If they are constants, and are literally
translated to their constant value at assembly time, then yes, the
behaviour that you expect would be correct and gas would be
wrong. However, if they are variables and are treated as such by gas,
then gas is acting appropriately by saying that any variable stored in the
text segment cannot be altered in such a way.
> The quote above clearly says that sections are
> all equal as the assembler is concerned (whether they will be
> altered or not at run-time is none of the business of gas).
> Thus it sounds irrelevant to my report (or I need to sleep).
You're correct on the fact that gas shouldn't care (technically) since
the linker is responsible for any such segment allocations. I'll look
more into that...I could just be in need of sleep rather than you :-)
> What huh.s does is trying to compute (at compile time) the
> distance between two labels in different sections. This is
> wrong, I understand that. What I don't understand is why gas
> reports only one of the two errors.
I believe it's because the distance computed in the second case (the
error-generating case) is being stored at an address in the text segment,
which gas thinks is A Bad Thing. I'll check more into this and write a
few code snippets to test this on Alpha as well.
I'm not closing this yet, so don't think I'm trying to get rid of you
:-) I was just making a point to quote what the manual said first before
preceding. I'm also trying to tackle a very ugly demangler problem on
Alpha, hence the delay in really getting this resolved more immediately.
C
Acknowledgement sent to "Christopher C. Chimelis" <chris@debian.org>:
Extra info received and forwarded to list. Copy sent to chris@debian.org (Christopher C. Chimelis).
-t
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: "Christopher C. Chimelis"
Subject: Bug#87733: Info received (was Bug#87733: binutils: as: funky error message (Subtraction of two symbols in different sections))
Message-ID:
In-Reply-To:
References:
X-Debian-PR-Message: ack-info-maintonly 87733
Thank you for the additional information you have supplied regarding
this problem report. It has been forwarded to the developer(s) and
to the developers mailing list to accompany the original report.
Your message has been sent to the package maintainer(s):
chris@debian.org (Christopher C. Chimelis)
If you wish to continue to submit further information on your problem,
please send it to 87733@bugs.debian.org, as before.
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the Bug-tracking system.
Darren Benham
(administrator, Debian Bugs database)
Received: (at 87733) by bugs.debian.org; 27 Feb 2001 17:47:37 +0000
From chris@debian.org Tue Feb 27 11:47:37 2001
Return-path:
Received: from dsl027-138-146-nyc1.dsl-isp.net (spawn.hockeyfiend.com) [::ffff:216.27.138.146]
by master.debian.org with esmtp (Exim 3.12 1 (Debian))
id 14XoDp-0006Iw-00; Tue, 27 Feb 2001 11:47:37 -0600
Received: from localhost ([127.0.0.1] ident=chris)
by spawn.hockeyfiend.com with esmtp (Exim 3.22 #1 (Debian))
id 14XoDl-0001HA-00; Tue, 27 Feb 2001 12:47:33 -0500
Date: Tue, 27 Feb 2001 12:47:33 -0500 (EST)
From: "Christopher C. Chimelis"
X-Sender: chris@spawn.hockeyfiend.com
To: Alexandre Duret-Lutz
cc: 87733@bugs.debian.org
Subject: Re: Bug#87733: binutils: as: funky error message (Subtraction of
two symbols in different sections)
In-Reply-To:
Message-ID:
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Delivered-To: 87733@bugs.debian.org
On 27 Feb 2001, Alexandre Duret-Lutz wrote:
> I still don't understand your answer :(. `altering' happens by
> running some instructions at run-time (doesn't it?), but there
> is nothing to run here, I'm just doing some constant
> declarations.
I'm not sure what arch this is written for (I know Alpha and some MIPS
assembly and my Intel assembly knowledge is too rusty to be of use to me),
but it appears that you're declaring variables rather than constants,
which makes a big difference. If they are constants, and are literally
translated to their constant value at assembly time, then yes, the
behaviour that you expect would be correct and gas would be
wrong. However, if they are variables and are treated as such by gas,
then gas is acting appropriately by saying that any variable stored in the
text segment cannot be altered in such a way.
> The quote above clearly says that sections are
> all equal as the assembler is concerned (whether they will be
> altered or not at run-time is none of the business of gas).
> Thus it sounds irrelevant to my report (or I need to sleep).
You're correct on the fact that gas shouldn't care (technically) since
the linker is responsible for any such segment allocations. I'll look
more into that...I could just be in need of sleep rather than you :-)
> What huh.s does is trying to compute (at compile time) the
> distance between two labels in different sections. This is
> wrong, I understand that. What I don't understand is why gas
> reports only one of the two errors.
I believe it's because the distance computed in the second case (the
error-generating case) is being stored at an address in the text segment,
which gas thinks is A Bad Thing. I'll check more into this and write a
few code snippets to test this on Alpha as well.
I'm not closing this yet, so don't think I'm trying to get rid of you
:-) I was just making a point to quote what the manual said first before
preceding. I'm also trying to tackle a very ugly demangler problem on
Alpha, hence the delay in really getting this resolved more immediately.
C
Information forwarded to debian-bugs-dist@lists.debian.org, chris@debian.org (Christopher C. Chimelis):
Bug#87733; Package binutils.
debian-bugs-dist@lists.debian.orgchris@debian.org (Christopher C. Chimelis)
Subject: Bug#87733: binutils: as: funky error message (Subtraction of two symbols in different sections)
Reply-To: Alexandre Duret-Lutz , 87733@bugs.debian.org
Resent-From: Alexandre Duret-Lutz
Orignal-Sender: Alexandre Duret-Lutz
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: chris@debian.org (Christopher C. Chimelis)
Resent-Date: Wed, 28 Feb 2001 11:33:02 GMT
Resent-Message-ID:
Resent-Sender: owner@bugs.debian.org
X-Debian-PR-Message: report 87733
X-Debian-PR-Package: binutils
X-Debian-PR-Keywords:
X-Loop: owner@bugs.debian.org
Received: via spool by 87733-bugs@bugs.debian.org id=B87733.98335698013973
(code B ref 87733); Wed, 28 Feb 2001 11:33:02 GMT
To: "Christopher C. Chimelis"
Cc: 87733@bugs.debian.org
References:
From: Alexandre Duret-Lutz
X-Home-Page: http://www.epita.fr/~duret_g/
X-Attribution: adl
Organization: LRDE/EPITA http://www.lrde.epita.fr/
Date: 28 Feb 2001 11:50:00 +0100
In-Reply-To:
Message-ID:
Lines: 100
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: Alexandre Duret-Lutz
Delivered-To: 87733@bugs.debian.org
>>> "ccc" == Christopher C Chimelis writes:
ccc> On 27 Feb 2001, Alexandre Duret-Lutz wrote:
[...]
ccc> I'm not sure what arch this is written for
I use i386. But since the snippet I sent uses only pseudo ops
I guess it should be portable. Here is a new test case whith
the result for i386 and m68k:
~/tmp % cat -n huh.s
1 .data
2 x: .dc.b 0
3 .text
4 y: .dc.b 0
5
6 .dc.l x - y
7 .dc.l y - x
8 .dc.l - (x - y)
9 .dc.l - x + y
~/tmp % as huh.s
huh.s: Assembler messages:
huh.s:7: Error: Subtraction of two symbols in different sections ".text" {.text section} - "x" {.data section} at file address 5.
huh.s:8: Error: invalid section for operation
~/tmp % m68k-palmos-as huh.s
huh.s: Assembler messages:
huh.s:7: Error: Can't emit reloc {- e1-seg symbol "x"} @ file address 5.
huh.s:8: Error: invalid section for operation
~/tmp %
Both complains on line 7 and 8, althought I would expected the
assembler to complain on lines 6, 7, 8 and 9.
[...]
ccc> but it appears that you're declaring variables rather than constants,
ccc> which makes a big difference. If they are constants, and are literally
ccc> translated to their constant value at assembly time, then yes, the
ccc> behaviour that you expect would be correct and gas would be
ccc> wrong. However, if they are variables and are treated as such by gas,
Are you telling me that ligne 7 declares a *variable* (that's why
gas complains), and ligne 6 declares a *constant*? :o)
ccc> then gas is acting appropriately by saying that any
ccc> variable stored in the text segment cannot be altered in
ccc> such a way.
I thought we agreed on the fact that gas doesn't know which
segment can be altered or not. It can't know that, I can decide
at run time to call mprotect() and make my .text segment
writable if I need it, it's none of the business of gas.
[...]
ccc> I believe it's because the distance computed in the second case (the
ccc> error-generating case) is being stored at an address in the text segment,
ccc> which gas thinks is A Bad Thing.
No, a distance between two adresses is an absolute value, not
another adresse.
[...]
ccc> I'm not closing this yet, so don't think I'm trying to get rid of you
ccc> :-) I was just making a point to quote what the manual said first before
ccc> preceding.
BTW I think I've got the relevant part of the manual:
`+'
"Addition". If either argument is absolute, the
result has the section of the other argument. You may
not add together arguments from different sections.
`-'
"Subtraction". If the right argument is absolute, the
result has the section of the left argument. If both
arguments are in the same section, the result is
absolute. You may not subtract arguments from
different sections.
According to this, I'm not allowed to write `x - y' or `y - x'
since x and y are in different sections. Thus I beleive gas is
right when it complains about the second case, but is expected
to complain about the first case too.
ccc> I'm also trying to tackle a very ugly demangler problem on
ccc> Alpha, hence the delay in really getting this resolved
ccc> more immediately.
No problem, and good luck. This issue is really not important
at all, it just a `you don't detect all errors'-problem, and a
cosmetic issue (remember the s/".text"/"y").
Thanks,
--
Alexandre Duret-Lutz
Acknowledgement sent to Alexandre Duret-Lutz <duret_g@lrde.epita.fr>:
Extra info received and forwarded to list. Copy sent to chris@debian.org (Christopher C. Chimelis).
-t
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: Alexandre Duret-Lutz
Subject: Bug#87733: Info received (was Bug#87733: binutils: as: funky error message (Subtraction of two symbols in different sections))
Message-ID:
In-Reply-To:
References:
X-Debian-PR-Message: ack-info-maintonly 87733
Thank you for the additional information you have supplied regarding
this problem report. It has been forwarded to the developer(s) and
to the developers mailing list to accompany the original report.
Your message has been sent to the package maintainer(s):
chris@debian.org (Christopher C. Chimelis)
If you wish to continue to submit further information on your problem,
please send it to 87733@bugs.debian.org, as before.
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the Bug-tracking system.
Darren Benham
(administrator, Debian Bugs database)
Received: (at 87733) by bugs.debian.org; 28 Feb 2001 10:43:00 +0000
From duret_g@lrde.epita.fr Wed Feb 28 04:43:00 2001
Return-path:
Received: from hermes.epita.fr [::ffff:163.5.255.10]
by master.debian.org with esmtp (Exim 3.12 1 (Debian))
id 14Y44S-0003dB-00; Wed, 28 Feb 2001 04:43:00 -0600
Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2])
by hermes.epita.fr id LAA17917
Wed, 28 Feb 2001 11:42:32 GMT
Received: from phobos.lrde.epita.fr ([10.223.13.38] ident=mail)
by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
id 14Y4BF-0000Aj-00; Wed, 28 Feb 2001 11:50:01 +0100
Received: from adl by phobos.lrde.epita.fr with local (Exim 3.22 #1)
id 14Y4BE-0004XS-00; Wed, 28 Feb 2001 11:50:00 +0100
To: "Christopher C. Chimelis"
Cc: 87733@bugs.debian.org
Subject: Re: Bug#87733: binutils: as: funky error message (Subtraction of two symbols in different sections)
References:
From: Alexandre Duret-Lutz
X-Home-Page: http://www.epita.fr/~duret_g/
X-Attribution: adl
Organization: LRDE/EPITA http://www.lrde.epita.fr/
Date: 28 Feb 2001 11:50:00 +0100
In-Reply-To:
Message-ID:
Lines: 100
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: Alexandre Duret-Lutz
Delivered-To: 87733@bugs.debian.org
>>> "ccc" == Christopher C Chimelis writes:
ccc> On 27 Feb 2001, Alexandre Duret-Lutz wrote:
[...]
ccc> I'm not sure what arch this is written for
I use i386. But since the snippet I sent uses only pseudo ops
I guess it should be portable. Here is a new test case whith
the result for i386 and m68k:
~/tmp % cat -n huh.s
1 .data
2 x: .dc.b 0
3 .text
4 y: .dc.b 0
5
6 .dc.l x - y
7 .dc.l y - x
8 .dc.l - (x - y)
9 .dc.l - x + y
~/tmp % as huh.s
huh.s: Assembler messages:
huh.s:7: Error: Subtraction of two symbols in different sections ".text" {.text section} - "x" {.data section} at file address 5.
huh.s:8: Error: invalid section for operation
~/tmp % m68k-palmos-as huh.s
huh.s: Assembler messages:
huh.s:7: Error: Can't emit reloc {- e1-seg symbol "x"} @ file address 5.
huh.s:8: Error: invalid section for operation
~/tmp %
Both complains on line 7 and 8, althought I would expected the
assembler to complain on lines 6, 7, 8 and 9.
[...]
ccc> but it appears that you're declaring variables rather than constants,
ccc> which makes a big difference. If they are constants, and are literally
ccc> translated to their constant value at assembly time, then yes, the
ccc> behaviour that you expect would be correct and gas would be
ccc> wrong. However, if they are variables and are treated as such by gas,
Are you telling me that ligne 7 declares a *variable* (that's why
gas complains), and ligne 6 declares a *constant*? :o)
ccc> then gas is acting appropriately by saying that any
ccc> variable stored in the text segment cannot be altered in
ccc> such a way.
I thought we agreed on the fact that gas doesn't know which
segment can be altered or not. It can't know that, I can decide
at run time to call mprotect() and make my .text segment
writable if I need it, it's none of the business of gas.
[...]
ccc> I believe it's because the distance computed in the second case (the
ccc> error-generating case) is being stored at an address in the text segment,
ccc> which gas thinks is A Bad Thing.
No, a distance between two adresses is an absolute value, not
another adresse.
[...]
ccc> I'm not closing this yet, so don't think I'm trying to get rid of you
ccc> :-) I was just making a point to quote what the manual said first before
ccc> preceding.
BTW I think I've got the relevant part of the manual:
`+'
"Addition". If either argument is absolute, the
result has the section of the other argument. You may
not add together arguments from different sections.
`-'
"Subtraction". If the right argument is absolute, the
result has the section of the left argument. If both
arguments are in the same section, the result is
absolute. You may not subtract arguments from
different sections.
According to this, I'm not allowed to write `x - y' or `y - x'
since x and y are in different sections. Thus I beleive gas is
right when it complains about the second case, but is expected
to complain about the first case too.
ccc> I'm also trying to tackle a very ugly demangler problem on
ccc> Alpha, hence the delay in really getting this resolved
ccc> more immediately.
No problem, and good luck. This issue is really not important
at all, it just a `you don't detect all errors'-problem, and a
cosmetic issue (remember the s/".text"/"y").
Thanks,
--
Alexandre Duret-Lutz
Tags added: upstream
Request was from James Troup <james@nocrew.org>
to control@bugs.debian.org.
Received: (at control) by bugs.debian.org; 11 Sep 2003 00:13:34 +0000
From james@ruari-quinn.demon.co.uk Wed Sep 10 19:13:32 2003
Return-path:
Received: from pc1-leed3-6-cust171.ldst.cable.ntl.com (shiri.gloaming.local) [80.6.171.171]
by master.debian.org with esmtp (Exim 3.35 1 (Debian))
id 19xF5Y-0005tP-00; Wed, 10 Sep 2003 19:13:32 -0500
Received: from james by shiri.gloaming.local with local (Exim 3.36 #1 (Debian))
id 19xF5X-0003u0-00
for ; Thu, 11 Sep 2003 01:13:31 +0100
To: control@bugs.debian.org
Subject: binutils bug maintenance
Mail-Copies-To: never
From: James Troup
Date: Thu, 11 Sep 2003 01:13:31 +0100
Message-ID: <871xuoqj10.fsf@shiri.gloaming.local>
User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/20.7 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: James Troup
Delivered-To: control@bugs.debian.org
X-Spam-Status: No, hits=-3.0 required=4.0
tests=BAYES_20,USER_AGENT_GNUS_UA
version=2.53-bugs.debian.org_2003_8_27
X-Spam-Level:
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_8_27 (1.174.2.15-2003-03-30-exp)
package binutils
tags 87733 + upstream
tags 87733 + confirmed
tags 95397 + upstream
tags 125916 + upstream
tags 126150 + upstream
tags 147132 + upstream
tags 169356 + upstream
tags 169356 + confirmed
tags 197518 + unreproducible
tags 207739 + unreproducible
tags 106906 + upstream
tags 208754 + upstream
tags 63645 + upstream
tags 126147 + upstream
tags 128436 + upstream
tags 73637 + upstream
tags 155384 + upstream
tags 157889 + upstream
thanks
--
James
Tags added: confirmed
Request was from James Troup <james@nocrew.org>
to control@bugs.debian.org.
Received: (at control) by bugs.debian.org; 11 Sep 2003 00:13:34 +0000
From james@ruari-quinn.demon.co.uk Wed Sep 10 19:13:32 2003
Return-path:
Received: from pc1-leed3-6-cust171.ldst.cable.ntl.com (shiri.gloaming.local) [80.6.171.171]
by master.debian.org with esmtp (Exim 3.35 1 (Debian))
id 19xF5Y-0005tP-00; Wed, 10 Sep 2003 19:13:32 -0500
Received: from james by shiri.gloaming.local with local (Exim 3.36 #1 (Debian))
id 19xF5X-0003u0-00
for ; Thu, 11 Sep 2003 01:13:31 +0100
To: control@bugs.debian.org
Subject: binutils bug maintenance
Mail-Copies-To: never
From: James Troup
Date: Thu, 11 Sep 2003 01:13:31 +0100
Message-ID: <871xuoqj10.fsf@shiri.gloaming.local>
User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/20.7 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: James Troup
Delivered-To: control@bugs.debian.org
X-Spam-Status: No, hits=-3.0 required=4.0
tests=BAYES_20,USER_AGENT_GNUS_UA
version=2.53-bugs.debian.org_2003_8_27
X-Spam-Level:
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_8_27 (1.174.2.15-2003-03-30-exp)
package binutils
tags 87733 + upstream
tags 87733 + confirmed
tags 95397 + upstream
tags 125916 + upstream
tags 126150 + upstream
tags 147132 + upstream
tags 169356 + upstream
tags 169356 + confirmed
tags 197518 + unreproducible
tags 207739 + unreproducible
tags 106906 + upstream
tags 208754 + upstream
tags 63645 + upstream
tags 126147 + upstream
tags 128436 + upstream
tags 73637 + upstream
tags 155384 + upstream
tags 157889 + upstream
thanks
--
James
Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#87733; Package binutils.
debian-bugs-dist@lists.debian.orgMatthias Klose
X-Loop: owner@bugs.debian.org
Subject: Bug#87733: Du hast noch mehr SpaB beim x ..
Reply-To: "Albert Avila" , 87733@bugs.debian.org
Resent-From: "Albert Avila"
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: Matthias Klose
Resent-Date: Thu, 04 Sep 2008 21:01:59 +0000
Resent-Message-ID:
Resent-Sender: owner@bugs.debian.org
X-Debian-PR-Message: followup 87733
X-Debian-PR-Package: binutils
X-Debian-PR-Keywords: confirmed upstream
X-Debian-PR-Source: binutils
Received: via spool by 87733-submit@bugs.debian.org id=B87733.122056133415940
(code B ref 87733); Thu, 04 Sep 2008 21:01:59 +0000
Received: (at 87733) by bugs.debian.org; 4 Sep 2008 20:48:54 +0000
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
(2007-08-08) on rietz.debian.org
X-Spam-Level: **
X-Spam-Status: No, score=2.6 required=4.0 tests=NEXTPART,RDNS_DYNAMIC
autolearn=no version=3.2.3-bugs.debian.org_2005_01_02
Received: from 201-93-206-104.dsl.telesp.net.br ([201.93.206.104] helo=rodrigo-51f3052)
by rietz.debian.org with esmtp (Exim 4.63)
(envelope-from )
id 1KbLl6-0003le-Qq; Thu, 04 Sep 2008 20:48:53 +0000
Received: from [201.93.206.104] by mbay6.mx.proofpoint.com; Thu, 4 Sep 2008 17:48:51 -0300
Message-ID: <01c90eb6$7d8d0380$68ce5dc9@dutamglbuuah>
From: "Albert Avila"
To: <87386@bugs.debian.org>
Date: Thu, 4 Sep 2008 17:48:51 -0300
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0007_01C90EB6.7D8D0380"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-CrossAssassin-Score: 4
This is a multi-part message in MIME format.
------=_NextPart_000_0007_01C90EB6.7D8D0380
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Mein Kumpel hat es ausprobiert: Orig VI reze fre im Internet bestellen is=
t ganz einfach und ja seitdem er VI nimmt, ist seine Frau wieder richtig =
zufrieden mit ihm.
http://describerich.com
------=_NextPart_000_0007_01C90EB6.7D8D0380
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Mein Kumpel hat es ausprobiert: Orig VI reze fre im Internet bestellen is=
t ganz einfach und ja seitdem er VI nimmt, ist seine Frau wieder richtig =
zufrieden mit ihm.
http://describerich.com
------=_NextPart_000_0007_01C90EB6.7D8D0380--
Acknowledgement sent to "Albert Avila" <dutamglbuuah@bobcatbicycles.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>.
-t
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.420 (Entity 5.420)
Content-Type: text/plain; charset=utf-8
X-Loop: owner@bugs.debian.org
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: "Albert Avila"
Subject: Bug#87733: Info received (Du hast noch mehr SpaB beim x ..)
Message-ID:
References: <01c90eb6$7d8d0380$68ce5dc9@dutamglbuuah>
X-Debian-PR-Message: ack-info 87733
X-Debian-PR-Package: binutils
X-Debian-PR-Keywords: confirmed upstream
X-Debian-PR-Source: binutils
Reply-To: 87733@bugs.debian.org
Thank you for the additional information you have supplied regarding
this Bug report.
This is an automatically generated reply to let you know your message
has been received.
Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.
Your message has been sent to the package maintainer(s):
Matthias Klose
If you wish to submit further information on this problem, please
send it to 87733@bugs.debian.org, as before.
Please do not send mail to owner@bugs.debian.org unless you wish
to report a problem with the Bug-tracking system.
--=20
87733: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D87733
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
Received: (at 87733) by bugs.debian.org; 4 Sep 2008 20:48:54 +0000
From dutamglbuuah@bobcatbicycles.com Thu Sep 04 20:48:54 2008
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
(2007-08-08) on rietz.debian.org
X-Spam-Level: **
X-Spam-Status: No, score=2.6 required=4.0 tests=NEXTPART,RDNS_DYNAMIC
autolearn=no version=3.2.3-bugs.debian.org_2005_01_02
Return-path:
Received: from 201-93-206-104.dsl.telesp.net.br ([201.93.206.104] helo=rodrigo-51f3052)
by rietz.debian.org with esmtp (Exim 4.63)
(envelope-from )
id 1KbLl6-0003le-Qq; Thu, 04 Sep 2008 20:48:53 +0000
Received: from [201.93.206.104] by mbay6.mx.proofpoint.com; Thu, 4 Sep 2008 17:48:51 -0300
Message-ID: <01c90eb6$7d8d0380$68ce5dc9@dutamglbuuah>
From: "Albert Avila"
To: <87386@bugs.debian.org>
Subject: Du hast noch mehr SpaB beim x ..
Date: Thu, 4 Sep 2008 17:48:51 -0300
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0007_01C90EB6.7D8D0380"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-CrossAssassin-Score: 4
This is a multi-part message in MIME format.
------=_NextPart_000_0007_01C90EB6.7D8D0380
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Mein Kumpel hat es ausprobiert: Orig VI reze fre im Internet bestellen is=
t ganz einfach und ja seitdem er VI nimmt, ist seine Frau wieder richtig =
zufrieden mit ihm.
http://describerich.com
------=_NextPart_000_0007_01C90EB6.7D8D0380
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Mein Kumpel hat es ausprobiert: Orig VI reze fre im Internet bestellen is=
t ganz einfach und ja seitdem er VI nimmt, ist seine Frau wieder richtig =
zufrieden mit ihm.
http://describerich.com
------=_NextPart_000_0007_01C90EB6.7D8D0380--