This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __attribute__((naked) on x86 would be useful
Mat Hostetter wrote:
> jakub> If the __asm changes the section behind GCC's back, it should
> jakub> restore it back at the end, say: asm (".section foobar;
> jakub> something; .previous");
>
> Thanks, that wasn't in the gas docs last time I looked, but it is now. :-)
> That's very useful for linux, but unfortunately it says it's
> ELF-specific.
There's no reason why it has to be ELF specific. GNU as could easily
support that pseudo-op for all targets.
> I tried it and it doesn't work on cygwin, at least with
> gas 2.13.90 20030308, so I still wonder if my hypothetical one-line change
> to gcc is reasonable.
Unfortunately there is some (very little) code around which depends on
GCC's quirk, although I agree with your suggestion.
In any case, it would be much nicer to change the assembler so that
".previous" is available on all targets.
-- Jamie