This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA/PATCH]: sh64: Unnecessary use of datalabel operator
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: "Clarke, Stephen" <stephen dot clarke at superh dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, "Joern Rennecke" <amylaar at onetel dot net dot uk>
- Date: 12 Aug 2002 09:48:20 -0300
- Subject: Re: [RFA/PATCH]: sh64: Unnecessary use of datalabel operator
- Organization: GCC Team, Red Hat
- References: <287E4644B5249D449C56FA5409A874AE03EF65@sh-us-ex01.us.w2k.superh.com>
On Aug 9, 2002, "Clarke, Stephen" <stephen.clarke@superh.com> wrote:
> There isn't one. The requirement is that a data symbol definition
> should not have the STO_SH5_ISA32 attribute. It should work just like
> STT_ARM_TFUNC works in arm/thumb, and STO_MIPS16 in mips16.
The fundamental difference between ARM Thumb and SH5 datalabel is
that, in the ARM model, it is the label that is marked as code or
data, so there's no need for the datalabel operator on references. In
SH5, each reference must indicate whether it wants the ISA bit for the
label or not, therefore datalabel must be used or omitted
consistently.
>> If the definition of symbols goes in
>> non-standard sections, and a C translation unit just sees the symbol
>> declared as extern, it should use datalabel.
> Sorry, I don't agree ;-(
If the following works as intended, I guess I'm ok with your change:
foo.c:
#include <stdio.h>
const int i attribute((section(".text"))) = 1;
void foo() {
printf("%i\n", i);
}
bar.c:
#include <stdio.h>
extern const int i;
extern void foo(void);
main() {
printf("%i\n", i);
foo();
}
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer