Mail Archives: djgpp/1995/05/02/02:31:17
All versions of the i386 GAS I have tested (1.3.8, 2.1.1, 2.2.1) generate bad
code when compiling input which uses absolute addressing with segment overrides.
This is a not a DJGPP bug, this is a bug in GAS. Both the DOS (DJGPP) and
Unix I386 (Linux) binaries of several GAS versions exhibit the same bug.
Although I have already reported this to the GAS maintainers, I a posting
here too, because people who use GAS with DOS extenders are most likely
to encounter this bug.
The following gdb session illustrates the problem:
(gdb) r
Starting program: /usr2/tmp/x
Breakpoint 1, main () at x.c:3
3 asm(
(gdb) l
1 main()
2 {
3 asm(
4 "movl %fs:0x1234,%eax;"
5 "movl %fs:(%ecx),%eax;"
6 );
7 }
(gdb) disass
Dump of assembler code for function main:
0x54 <main>: pushl %ebp
0x55 <main+1>: movl %esp,%ebp
0x57 <main+3>: call 0xf8 <__main>
0x5c <main+8>: movl 0x1234,%eax
0x61 <main+13>: movl %fs:(%ecx),%eax
0x64 <main+16>: movl %ebp,%esp
0x66 <main+18>: popl %ebp
0x67 <main+19>: ret
End of assembler dump.
(gdb)
Csaba Biegl
csaba AT vuse DOT vanderbilt DOT edu
- Raw text -