Skip to content

CHB:ARM: add support for functions with multiple return values (R0, R1) #197

@sipma

Description

@sipma

Some functions return two separate values, in R0 and R1. To handle this case support needs to be added to translation, transmission, and the function summary. For the function summary, this may require creating a new post-condition attribute to indicate the extra return value.

Example: 752084:10958

The function __aeabi_uidivmod has two return values:

--------------------------------------------------------------------------------
   0x109cc  [  -16 ]  MOV            R1, #0x3c        R1 := 0x3c (C: 0x3c)
   0x109d0  [  -16 ]  MOV            R0, R5           R0 := t (C: t)
   0x109d4  [  -16 ]  BL             0x9bb4           call __aeabi_uidiv(t, 0x3c) (C: (t, 0x3c))
   0x109d8  [  -16 ]  MOV            R1, #0x3c        R1 := 0x3c (C: 0x3c)
   0x109dc  [  -16 ]  BL             0x9a88           call `__aeabi_uidivmod`(rtn___aeabi_uidiv, 0x3c) (C: (rtn___aeabi_uidiv, 0x3c))
   0x109e0  [  -16 ]  SUBS           R2, R1, #0       R2 := (R1 - 0x0) (= R1) (C: R1)
   0x109e4  [  -16 ]  BEQ            0x109f8          if (R1 == 0x0) then goto 0x109f8
--------------------------------------------------------------------------------

Currently R1 is abstracted away, as it is assumed clobbered by the call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions