Getting a 32bit symbol into a 16bit .word directive
MurF
murphyn@microsense.co.uk
Fri Jul 18 14:38:00 GMT 2003
Chaps,
I've been using GCC with good results. And I'm slowly finding my way around
the Protected mode of the IA-32 architechture. I've just started looking into
interurpts, and want to write my own IDT for a i486. Problem is I can't get
as to put a 32-bit symbol into a .word directive without getting an error.
I want to do something like this ....
(A bit of code)
.
.
.
int0:
mov $0x0,%eax
mov $0x80,%edx
out %al,%dl
loop0:
jmp loop0
.
.
(A bit of code)
.
.
.globl EXT(idtptr)
EXT(idtptr):
.word 20*8-1
.long idt
idt:
// Offset(15..0) , Segment Selector
// Reserved (4..0), '0'(7..5) '0D110'(12..8), DPL(14..13), P(15)
// offset(31..16)
.word (int0), 0x0010 // Int 0 - Divide Error
.byte 0x00, 0x0e
.word 0x0000
.
.
.
.
.
But when i compile this i get the error 'relocation truncated to fit:
R_386_16 text' and the rest of the compilation fails. This is due to the line
'.word (int0),0x0010)'
If I remove the (int0) and replce with a constant everything works.
Any ideas?
More information about the Binutils
mailing list