Originally Posted by
Salem
> I seem to be able to compile other programs though
Yeah, that's what I would have guessed.
Is there anything peculiar about your source code?
- was it downloaded from somewhere?
- does it have any odd #pragma of __attribute__ syntax? (also check any local header files)
- what about inline assembler?
Do the objdump thing on known good .o files and .exe files, and see what formats they are.
Doing objdump on working files shows that the files are of the same form.
I do have __attribute__ syntax, of the following form:
Code:
__attribute__ ((section ("GPARMS"))) struct ConfigTableType ConfigTable = {
1, 3, 0x1F, 0x1F, 0xF, 0xF, &main};
But this code is in several files and does not cause a problem elsewhere.
I suspect the inline assembler is the issue. The source files were written for an m68k processor and had to be converted to be compiled for the i686. The only thing I had to change was the inline assembly in one of the files, which I may have done incorrectly. Here is the original code:
Code:
#define REG __asm__ volatile ("move.b #0x1,-(%sp)\n");
#define DREG __asm__ volatile ("move.b #0x0,-(%sp)\n");
#define REG_AP(mr,reg_flag) \
({ \
reg_flag \
__asm__ volatile ("pea %0\n" :"=m"(*mr)); \
__asm__ volatile ("jsr 0x8000\n"); \
})
#define SCH_IO(mi,follow,rcode) \
({ \
__asm__ volatile ("pea %0\n" :"=m"(*mi)); \
__asm__ volatile ("pea %0\n" :"=m"(*follow)); \
__asm__ volatile ("pea %0\n" :"=m"(*rcode)); \
__asm__ volatile ("jsr 0x8200\n"); \
})
#define SCH_IO_NO_FOLLOW_ON(mi,rcode) \
({ \
__asm__ volatile ("pea %0\n" :"=m"(*mi)); \
__asm__ volatile ("move.l #0x0,-(%sp)\n"); \
__asm__ volatile ("pea %0\n" :"=m"(*rcode)); \
__asm__ volatile ("jsr 0x8200\n"); \
})
And this is what I changed it to:
Code:
#define REG __asm__ __volatile__("movb $0x1,(%ESP)\n");
#define DREG __asm__ __volatile__("movb $0x0,(%ESP)\n");
#define G_AP(mr,reg_flag) \
({ \
reg_flag \
__asm__ __volatile__("push %0\n" :"=m"(*mr)); \
__asm__ __volatile__("call 0x8000\n"); \
})
#define SCHED_IO(mi,follow,rcode) \
({ \
__asm__ __volatile__("push %0\n" :"=m"(*mi)); \
__asm__ __volatile__("push %0\n" :"=m"(*follow)); \
__asm__ __volatile__("push %0\n" :"=m"(*rcode)); \
__asm__ __volatile__("call 0x8200\n"); \
})
#define SCHED_IO_NO_FOLLOW_ON(mi,rcode) \
({ \
__asm__ __volatile__("push %0\n" :"=m"(*mi)); \
__asm__ __volatile__("movl (%ESP),$0x0\n"); \
__asm__ __volatile__("push %0\n" :"=m"(*rcode)); \
__asm__ __volatile__("call 0x8200\n"); \
})
I had previous problems with this step and it's really the only code I have changed from the working version, so I think it is the main cause of the issue