bug-binutils
[Top][All Lists]
Advanced

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

GAS m68k-aout relocation bug ?


From: Vincent Rivière
Subject: GAS m68k-aout relocation bug ?
Date: Mon, 17 Nov 2003 01:45:51 +0100

I'm using GAS 2.14 m68k-aout.
I found a strange behavior which looks like a bug...

Here is a simple program :

|----------------------------------------
 .data
 .word SOMEDEFINE

SOMEDEFINE = 3

|----------------------------------------

As you can see, I use the symbol SOMEDEFINE *BEFORE* declaring it.

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.

If I declare SOMEDEFINE before using it, it works as expected : no relocation 
entry is generated.

So I think the rule is : "Always declare symbols before using them". In that 
case, it should be nice to display a warning if this is not the case.


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 ?

Vincent.






reply via email to

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