This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/PATCH]: sh64: Unnecessary use of datalabel operator


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]