[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GAS m68k-aout relocation bug ?
From: |
Vincent Rivière |
Subject: |
Re: GAS m68k-aout relocation bug ? |
Date: |
Tue, 18 Nov 2003 09:16:49 +0100 |
> > - If the resulting address is still 16-bit wide, the constant is
> > silently relocated. In my example, the constant is 3. When I load
> > the resulting program, after the bogus-relocation, the constant
> > changes to 0x7f1f (so the value of the constant is invalid, and
> > depends on where the program is located in memory).
>
> OK, that answers the question of whether the linker generates > correct
> output. It does not. That means that this is a real bug.
>
> I would say that it is an assembler bug, as you suggested initially.
> However, I don't have any particular suggestions as to where to look
> to fix it. For a BFD_ASSEMBLER gas, the routine fixup_segment() in
> gas/write.c should avoid emitting a reloc for a reference to a symbol
> which is defined. I think fixup_segment() is also called for the
> m68k-aout target; I don't know why it isn't skipping this reloc.
Ok.
For now, this bug isn't blocking thanks to the define-before-use workaround.
When I have time, I'll take a closer look to the GAS m68k-aout relocating
routines and "=" operator. If I find how to fix the bug, I'll post the patch
here.
The only real problem is that this bug may be present in all m68k-aout targets.
If so, bogus relocations will be generated on the test-case described here, and
invalid constants may be silently emitted by the linker. Note that it is the
case in GCC m68k fpu-emulation routines...
Thank you for your help.
Vincent.