bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GAS m68k-aout relocation bug ?


From: Ian Lance Taylor
Subject: Re: GAS m68k-aout relocation bug ?
Date: 16 Nov 2003 21:08:08 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Vincent Rivière <address@hidden> writes:

> I'm using GAS 2.14 m68k-aout.

Before we consider anything else, why are you using m68k-aout?  The
a.out format is very obsolete.  If you have any flexibility here, I
strongly recommend using m68k-elf instead.

Your test case does not generate a relocation entry when using
m68k-elf.

> Now I use objdump --reloc in order to see the relocation table
> 
> RELOCATION RECORDS FOR [.data]:
> OFFSET   TYPE              VALUE
> 00000000 16                *ABS*
> 
> This is abnormal : it means that the value of SOMEDEFINE will be relocated ! 
> Of course, it shouldn't, because it is a local constant.

>From the evidence presented, it's not obviously broken, since the
relocation is against an absolute symbol value.

What does this address look like after you link it?

> Because of this problem, there is a bug in the gcc sources :
> file : gcc/config/m68k/lb1sf68.asm
> 
> The symbols ROUND_TO_NEAREST, NIL and NOOP are used before they are declared. 
> So they generate 3 invalid  relocation entries...
> It can be easyly fixed by moving the declarations before their use.
> 
> So what might be fixed ? GAS or lb1sf68.asm ?

First, let's see if we really need to worry about m68k-aout.  Second,
let's see if there is a real bug--if the fully linked file has the
wrong value.  Third, let's see how hard it would be to fix in gas, if
anybody wants to tackle this target at all.

(m68k-aout is an interesting target in gas, since it is one of the few
remaining targets which does not define BFD_ASSEMBLER.  It would be
nice to either eliminate it or convert it to use BFD_ASSEMBLER, and
eliminate the ugly code in write.c and config/obj-aout.c.)

Ian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]