:> I found a couple of minor nits, but only one real bug. In i386/swtch.s
:> I forgot to change out a WANT_RESCHED for AST_RESCHED:
:>
:> sw1a:
:> call _chooseproc /* trash ecx, edx, ret eax*/
:> testl %eax,%eax
:> CROSSJUMP(je, _idle, jne) /* if no proc, idle */
:> movl %eax,%ecx
:>
:> xorl %eax,%eax
:> andl $~WANT_RESCHED,_astpending
:>
:> The problem is that a kernel build is not reporting any errors!
:> WANT_RESCHED does not exist at all, anywhere. If I change it to
:> a garbage name the kernel still builds. I don't get it.
:
:It seems to be a gas bug. The error is detected if ~WANT_RESCHED is
:replaced by WANT_RESCHED. ~WANT_RESCHED is no a simple relocatable
:expression, so it isn't clear that gas or elf can handle it. They
:don't seem to for the following simpler case:
:
:$ echo "movl $~FOO,%eax" >z.s
:$ echo ".globl foo; .set FOO,0x55555555" >z1.s
:$ cc -c z.s z1.s
:$ ld -o z z.o z1.s
:$ objdump --disassemble z
:
:z: file format elf32-i386
:
:Disassembly of section .text:
:
:08048074 <.text>:
: 8048074: b8 ff ff ff ff movl $0xffffffff,%eax
: ^^^^^^^^ should be aaaaaaaa
: but still has best guess
: at time of assembly of z.s
: 8048079: 90 nop
: 804807a: 90 nop
: 804807b: 90 nop
:
:Everthing works right for "FOO" instead of ~FOO.
:
:The aout case gets this wrong in a more obvious way. Gas produces the same
:code for "movl $~FOO,%eax" as for "movl $FOO,%eax". Linking to z1.o then
:gives the right value for $FOO and the wrong value for $~FOO.
:
:Gas notices the problem for "movl $-FOO,%eax":
: z.s: Assembler messages:
: z.s:1: Error: Negative of non-absolute symbol FOO
:Similarly for the a.out case. Complementation is equivalent to negation
:on 2's complement machines, so gas should produce this error for $~FOO too.
:
:Bruce
Ok, so who do we send your excellent analysis to at GNU-C? I think
this is a rather serious bug myself since a programmer can make a
simple labelname mistake and get incorrect code instead of an error.
Also, probably a simple mistake but complement != negation.
I think ~F = -F - 1;
-0x0001 == 0xFFFF
~0x0001 == 0xFFFE
-Matt
Matthew Dillon
<[EMAIL PROTECTED]>
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message