bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/11973] mn10300 assembler produce incorrect calls address f


From: DaLiV at apollo dot lv
Subject: [Bug binutils/11973] mn10300 assembler produce incorrect calls address for far calls (32bit) when command contain nonzero stack and/or saving registers
Date: 8 Sep 2010 19:33:09 -0000

------- Additional Comments From DaLiV at apollo dot lv  2010-09-08 19:33 
-------
example of code with assembling will be ok ?
look at 11 and 17 - that is not patched , address ofset field passed to linker
equal to registers and stack offset values part (=incorrect).

$ mn10300-as.exe 40.asm -al
GAS LISTING 40.asm                      page 1


   1                    .org 0x00000000
   2                    _baseAddress:
   3                    .equ _base40,_baseAddress
   4                    .equ _base7B,_baseAddress+0x3B000000
   5                    .equ sub_7BC01234,_base7B+0xC01234
   6
   8 0000 00000000      .org 0x00000100
   8      00000000
   8      00000000
   8      00000000
   8      00000000
   9                    SomeProc_40000100:
  10 0100 2C2301        mov 0x123, D0
  11 0103 DD000080      call sub_7BC01234, [D2], 0x04
  11      048004
  12
  14 010a 00000000      .org 0x00000200
  14      00000000
  14      00000000
  14      00000000
  14      00000000
  15                    SomeProc_40000200:
  16 0200 2C2301        mov 0x123, D0
  17 0203 DD000080      call sub_7BC01234, [D2], 0x04
  17      048004
  18 020a CD000080      call SomeProc_40000100, [D2], 0x04
  18      04


and patched (32 bit offset field to linker passed as needed =0x00000000 ):

$ mn10300-as.exe 40.asm -al
GAS LISTING 40.asm                      page 1


   1                    .org 0x00000000
   2                    _baseAddress:
   3                    .equ _base40,_baseAddress
   4                    .equ _base7B,_baseAddress+0x3B000000
   5                    .equ sub_7BC01234,_base7B+0xC01234
   6
   8 0000 00000000      .org 0x00000100
   8      00000000
   8      00000000
   8      00000000
   8      00000000
   9                    SomeProc_40000100:
  10 0100 2C2301        mov 0x123, D0
  11 0103 DD000000      call sub_7BC01234, [D2], 0x04
  11      008004
  12
  14 010a 00000000      .org 0x00000200
  14      00000000
  14      00000000
  14      00000000
  14      00000000
  15                    SomeProc_40000200:
  16 0200 2C2301        mov 0x123, D0
  17 0203 DD000000      call sub_7BC01234, [D2], 0x04
  17      008004
  18 020a CD000080      call SomeProc_40000100, [D2], 0x04
  18      04


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11973

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



reply via email to

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