Re: [PATCH] pop previous section in alternative.c
From: Linus Torvalds
Date: Thu Apr 10 2008 - 11:21:23 EST
On Thu, 10 Apr 2008, Andi Kleen wrote:
>
> A simple way to detect it on the assembler level would be checking
> that the section is the same after #NO_APP as before #APP
That would mark gcc itself as buggy, because gcc will move some things
into the #APP/#NO_APP thing, and sometimes doesn't end the #APP at all!
Try gcc -S on this this trivial "program"
asm("Hello world");
and at least I personally get
.file "bug.c"
#APP
Hello world
.ident "GCC: (GNU) 4.1.2 20070925 (Red Hat 4.1.2-33)"
.section .note.GNU-stack,"",@progbits
and nothing else. Note the lack of #NO_APP ;)
(I also swear I've seen code or data move _into_ the #NO_APP - ie gcc did
eventually close the #APP section, but did it too late, after it had
emitted other things itself - but maybe I just dreamed it because I can't
seem to reproduce it now. Or maybe it's just a historical gcc bug that got
fixed)
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/