[PATCH] [MSP430] Fix incorrect assembly code in _msp430_run_array
Jozef Lawrynowicz <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <20190415181304.7da2bb45@jozef-kubuntu> |
The attached patch fixes incorrect assembly code in _msp430_run_array from
crt0.S.
When {.preinit,.init,.fini}_array sections contain pointers to functions that
need to be executed, _msp430_run_array is supposed to run through the table
and call these functions. However, currently the assembly code is wrong and
the CPU exhibits undefined behaviour when trying to execute the required
functions from these arrays.
If the patch is acceptable, I would appreciate if someone could commit it
for me, as I do not have write access.
Thanks,
Jozef
0001-MSP430-Fix-incorrect-assembly-code-in-_msp430_run_ar.patch
(text/x-patch, 679 B)
From 0b0a51a95c73dcff21639eb5f66e0686b88456bd Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz <[email protected]> Date: Mon, 15 Apr 2019 18:06:09 +0100 Subject: [PATCH] [MSP430] Fix incorrect assembly code in _msp430_run_array --- libgloss/msp430/crt0.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgloss/msp430/crt0.S b/libgloss/msp430/crt0.S index f5ab8d335..53162e6bd 100644 --- a/libgloss/msp430/crt0.S +++ b/libgloss/msp430/crt0.S @@ -246,8 +246,8 @@ _msp430_run_array: jeq _msp430_run_done mov_ @R4, R7 add_ R6, R4 - call_ @R7 - br_ _msp430_run_array + call_ R7 + br_ #_msp430_run_array _msp430_run_done: ret_ -- 2.17.1