Messages in this thread | | | Date | Thu, 10 Apr 2008 08:18:49 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [PATCH] pop previous section in alternative.c |
| |
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
| |