Date: Tue, 2 May 95 00:04:03 CDT From: csaba AT vuse DOT vanderbilt DOT edu (Csaba A. Biegl) To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: GAS bug 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
: pushl %ebp 0x55 : movl %esp,%ebp 0x57 : call 0xf8 <__main> 0x5c : movl 0x1234,%eax 0x61 : movl %fs:(%ecx),%eax 0x64 : movl %ebp,%esp 0x66 : popl %ebp 0x67 : ret End of assembler dump. (gdb) Csaba Biegl csaba AT vuse DOT vanderbilt DOT edu