Skip to content
  • Peter Maydell's avatar
    disas: Fix printing of addresses in disassembly · 636bd289
    Peter Maydell authored
    
    
    In our disassembly code, the bfd_vma type is always 64 bits,
    even if the target's virtual address width is only 32 bits. This
    means that when we print out addresses we need to truncate them
    to 32 bits, to avoid odd output which has incorrectly sign-extended
    a value to 64 bits, for instance this ARM example:
        0x80479a60:  e59f4088     ldr  r4, [pc, #136]  ; 0xffffffff80479a4f
    
    (It would also be possible to truncate before passing the address
    to info->print_address_func(), but truncating in the final print
    function is the same approach that binutils takes to this problem.)
    
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarAndreas Färber <afaerber@suse.de>
    Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
    636bd289