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: Patrice MANDIN
Subject: Re: GAS m68k-aout relocation bug ?
Date: Wed, 21 Jan 2004 10:17:22 +0100 (CET)

Hello,

This is a reply to this thread:
http://mail.gnu.org/archive/html/bug-binutils/2003-11/msg00018.html

I added some DEBUG infos to binutils 2.14 (and 2.13.2.1 to compare against), 
and here is what I found about it:

- Test code:
|----------------------------------------
 .data
 .word SOMEDEFINE

SOMEDEFINE = 3

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

-- With binutils-2.13.2.1:

processing fixup:
fix a07dbb8 binutils.S:2
    size=2 frag=a045460 where=0 offset=0 addnumber=0
   +<sym a07db88 SOMEDEFINE resolved used defined absolute 3>
result:
fix a07dbb8 binutils.S:2 done
    size=2 frag=a045460 where=0 offset=0 addnumber=0

The code that process it lies in lines 2788-2807 (gas/write.c):

  if (add_symbol_segment == absolute_section && !pcrel) {
#ifdef TC_I960
    /* See comment about reloc_callj() above.  */
    reloc_callj (fixP);
#endif /* TC_I960  */
    add_number += S_GET_VALUE (add_symbolP);

    /* Let the target machine make the final determination
       as to whether or not a relocation will be needed to
       handle this fixup.  */

    if (!TC_FORCE_RELOCATION (fixP)) {
      fixP->fx_addsy = NULL;
      add_symbolP = NULL;
    }
  } else ...


-- With (currently broken for m68kaout?) binutils-2.14:

processing fixup:
fix a07dbb8 binutils.S:2
    size=2 frag=a045460 where=0 offset=0 addnumber=0
   +<sym a07db88 SOMEDEFINE resolved used defined absolute 3>
result:
fix a07dbb8 binutils.S:2
    size=2 frag=a045460 where=0 offset=0 addnumber=0
   +<sym a07db88 SOMEDEFINE resolved used-in-reloc used defined absolute 3>

The symbol is (wrongly, I think) processed with lines 2765-2776:

  else if (add_symbol_segment != undefined_section
#ifdef BFD_ASSEMBLER
    && ! bfd_is_com_section (add_symbol_segment)
#endif
    && MD_APPLY_SYM_VALUE (fixP)) {
      add_number += S_GET_VALUE (fixP->fx_addsy);
    }
  }

instead of lines 2755-2765 (which is the code adapted from binutils-2.13.2.1):

  else if (add_symbol_segment == absolute_section
    && !TC_FORCE_RELOCATION_ABS (fixP)) {
      add_number += S_GET_VALUE (fixP->fx_addsy);
      fixP->fx_offset = add_number;
      fixP->fx_addsy = NULL;
  } else ...

I hope it is enough information to get it fixed soon. I don't know  what  to 
modify  to correct this bug without side effects.




reply via email to

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