Page 1 of 1

GCC Bug?

Posted: Wed Apr 23, 2003 2:35 pm
by shad
I had had trouble loading a new gdt in from my kernel. I figured out that somehow gdt does not put the right value in the data field i was trying to fill. (gdtr) so i made a small function to put the value in with assembler, it finally worked. ( the value gcc had was shifted left 16 bits) is this a bug ? (gcc 2.95.2 )

Re:GCC Bug?

Posted: Wed Apr 23, 2003 3:04 pm
by Pype.Clicker
more likely to be a mis-use or a misunderstanding of some of the dark features of GCC ...

maybe if you post your code and the disassembled code (gcc -S)

Re:GCC Bug?

Posted: Wed Apr 23, 2003 4:31 pm
by ChZ
I had that same problem. Try this...

Code: Select all

#pragma pack(1)
typedef struct{
        unsigned short limit;
        unsigned long addr;
}GDTR;
#pragma pack(4)