weird staff in binutils symbol value caculation
daniel tian
daniel.xntian@gmail.com
Thu May 6 13:19:00 GMT 2010
Hello, all:
I just ported the binutils to my NEW RISC machine. Now the
assemble codes were compiled with this tools.
But here is the stuff I just found out:
.equ REF_FRAMES_BUFFER_SIZE ,
((6*DISPLAY_SCALED)+(12*(DISPLAY_SCALED==NO)))
When the DISPLAY_SCALED and DISPLAY_SCALED, and NO are 0x0.
But the value REF_FRAMES_BUFFER_SIZE is to be -12.
When I hacked the gas, I found the expr.c:
case O_eq:
resultP->X_add_number =
resultP->X_add_number == v ? ~ (offsetT) 0 : 0;
break;
case O_ne:
resultP->X_add_number =
resultP->X_add_number != v ? ~ (offsetT) 0 : 0;
break;
case O_lt:
resultP->X_add_number =
resultP->X_add_number < v ? ~ (offsetT) 0 : 0;
break;
case O_le:
resultP->X_add_number =
resultP->X_add_number <= v ? ~ (offsetT) 0 : 0;
break;
case O_ge:
resultP->X_add_number =
resultP->X_add_number >= v ? ~ (offsetT) 0 : 0;
break;
case O_gt:
resultP->X_add_number =
resultP->X_add_number > v ? ~ (offsetT) 0 : 0;
break;
which means when the condition is true, the value
will be -1(0xFFFFFFFF). If I want to make the value to be 0x1, when
the condition is true. Do I have to rewrite this part? or Is there
anyway, I can deal with. I just afraid when I revised this part, some
other bugs will come about.
thanks.
daniel
More information about the Binutils
mailing list