[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: gas/ia64 "data in a code section" problem
From: |
Belochapka, Konstantin |
Subject: |
RE: gas/ia64 "data in a code section" problem |
Date: |
Tue, 29 Jun 2004 18:40:03 -0700 |
I disagree with a solution that would emit an error in this situation.
First reason - Itanium allows memory read and even write from/to executable
memory fragment, so if the hardware supports this then is no reason to disable
this in an assembler.
Second - a compiler can put constant data into .text section, the things like
constant strings and switch/case tables.
Third - Intel Assembler Manual does not mentioned any restriction for this and
IAS handles this situation without any problem.
-----Original Message-----
From: Jim Wilson [mailto:address@hidden
Sent: 29 June 2004 18:23
To: Belochapka, Konstantin
Cc: address@hidden
Subject: Re: gas/ia64 "data in a code section" problem
On Fri, 2004-06-18 at 16:50, Belochapka, Konstantin wrote:
> It appears that ia64 as produces incorrect object code when the code and the
> data are intermixed and the data is not aligned to the instruction bundle
> boundary
> add r8=10,r7
> data1 20
> add r9=15,r10
What do you think should happen for an example like this?
I'd suggest that what we should do is emit an error. Emitting data into
the text section is a bad idea for IA-64. It breaks a number of things,
bundling, dependency violation checking/stop bit generation, and
possibly also generation of unwind info. The only way to fix these
problems is to not allow it at all. However, I am not sure if I can
just give an error for this; there may be code in e.g. linux kernel or
glibc that needs this to continue to work.
I suspect you want it to work somehow though, perhaps by aligning the
code section to 16 bytes after the data directive. Unfortunately, I
don't see an obvious way to fix this. I checked, and noticed that I get
the same kind of error if I use mips instructions and the mips
assembler. I suspect other RISC targets will also have the same
problem, but I haven't checked yet. If I can find one that works, I can
try copying what it does. Otherwise, I may have to invent something. I
don't want to emit an align directive before every instruction bundle,
which is the naive solution.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com