This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Writing addend into instructions


Alan Modra <alan@linuxcare.com.au> writes:

  On 13 Mar 2001, Torbjorn Granlund wrote:
  
  > But for ELF, writing the addends into, say, a 16-bit instruction field
  > seems like a strange thing to do.  Most ELF ABIs require that such
  > addends are ignored anyway.
  
  One (rather poor) reason why you might want to write the addend into
  the insn is to make disassembly of object files "look right".  It would be
  better to teach the disassembler how to apply the relocation.
  
Such as with for example:

        .section ".text"
        lis      3,foo+0xf000baba@h
        lwz      3,foo+0xf000baba@l(3)

This then yields this disassembly output:

   0:   3c 60 0f 00     lis     r3,-4096
                        2: R_PPC64_ADDR16_HI    foo+0xf00baba
   4:   80 63 ba ba     lwz     r3,-17734(r3)
                        6: R_PPC64_ADDR16_LO    foo+0xf00baba

That really "looks right"...  :-)

-- 
Torbjörn


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]