Skip to contentSkip to conversation

ARM: arm32: fix realocate_to_curr_addr

PATCH Applied Andreas Schmidt 2 participants 2 messages Apr 22, 2018 – Apr 25, 2018 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: arm32: fix realocate_to_curr_addr

After add aarch64 support (commit 868df08038a91d674a0c50b0c0a2f70dbc445510) to realocation, MLO on beaglebone black do not boot any more. The issue is, that addition of offset in one if-case was not done. This patch fix this.

---
Hi!

I've tested this patch only on beablebone black REV C.

Regards,
Andreas

---
 arch/arm/cpu/common.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/cpu/common.c +1 -0
index 00ce3efb2..51fe7ed98 100644
@@ -85,6 +85,7 @@ void relocate_to_current_adr(void)
 			unsigned long *fixup = (unsigned long *)(rel->r_offset + offset);
 
 			*fixup = *fixup + r + offset;
+			rel->r_offset += offset;
 		} else {
 			putc_ll('>');
 			puthex_ll(rel->r_info);
Signature · 7 lines
2.14.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw

Hi Andreas,

Quoted 10 lines · Andreas Schmidt

After add aarch64 support (commit 868df08038a91d674a0c50b0c0a2f70dbc445510) to realocation, MLO on beaglebone black do not boot any more. The issue is, that addition of offset in one if-case was not done. This patch fix this.

---
Hi!

I've tested this patch only on beablebone black REV C.

Applied, thanks.

It took me a while to reproduce this. I switched to gcc7 a while ago and this gcc version no longer uses these types of relocation. Then after using a gcc-4.9.2 I could really see the same issue. The problem arises when relocate_to_current_adr() is called multiple times, as happens when the board lowlevel code calls it and the startup code later again. Some boards do this, one of them being the beagle bone.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox