PATCH: Tidy up code in elf32-arm.c
Christophe LYON
christophe.lyon@st.com
Tue Aug 26 12:52:00 GMT 2008
Hi Nick,
On 17.08.2008 22:47, Nick Clifton wrote:
> Hi Guys,
>
> Whilst looking into the ARM interworking problems I had cause to
> note that the code in elf32-arm.c hand become rather untidy, so I am
> checking in the attached patch to spruce it up. The patch does not
> fix any bugs (or introduce any new ones!).
>
Are you sure about the comment reformatting below?
In the code fragment on the left, shouldn't "b func" be the last
instruction and "__func_back_to_thumb" be moved the right side (after
.arm) ?
Christophe.
*************** static const insn32 a2t3p_bx_r12_insn =
*** 3845,3863 ****
/* Thumb->ARM: Thumb->(non-interworking
aware) ARM
! .thumb .thumb
! .align 2 .align 2
! __func_from_thumb: __func_from_thumb:
! bx pc push {r6, lr}
! nop ldr r6, __func_addr
! .arm mov lr, pc
! __func_change_to_arm: bx r6
! b func .arm
! __func_back_to_thumb:
! ldmia r13! {r6, lr}
! bx lr
! __func_addr:
! .word func */
#define THUMB2ARM_GLUE_SIZE 8
static const insn16 t2a1_bx_pc_insn = 0x4778;
--- 3845,3862 ----
/* Thumb->ARM: Thumb->(non-interworking
aware) ARM
! .thumb .thumb
! .align 2 .align 2
! __func_from_thumb: __func_from_thumb:
! bx pc push {r6, lr}
! nop ldr r6, __func_addr
! .arm mov lr, pc
! b func bx r6
! ;; back_to_thumb .arm
! ldmia r13! {r6, lr} ldmia r13! {r6, lr}
! bx lr bx lr
! __func_addr:
! .word func */
#define THUMB2ARM_GLUE_SIZE 8
static const insn16 t2a1_bx_pc_insn = 0x4778;
More information about the Binutils
mailing list