[PATCH 28/78] ARM: relocate_to_current_adr: Use unsigned long for variables

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

 



relocate_to_current_adr() fixes up pointers in the binary, so unsigned
long is a better match as it works on aarch64 aswell.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 arch/arm/cpu/common.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/common.c b/arch/arm/cpu/common.c
index 7c07d00c1b..3766116d97 100644
--- a/arch/arm/cpu/common.c
+++ b/arch/arm/cpu/common.c
@@ -30,8 +30,8 @@
  */
 void relocate_to_current_adr(void)
 {
-	uint32_t offset;
-	uint32_t *dstart, *dend, *dynsym, *dynend;
+	unsigned long offset;
+	unsigned long *dstart, *dend, *dynsym, *dynend;
 
 	/* Get offset between linked address and runtime address */
 	offset = get_runtime_offset();
@@ -43,14 +43,14 @@ void relocate_to_current_adr(void)
 	dynend = (void *)__dynsym_end + offset;
 
 	while (dstart < dend) {
-		uint32_t *fixup = (uint32_t *)(*dstart + offset);
-		uint32_t type = *(dstart + 1);
+		unsigned long *fixup = (unsigned long *)(*dstart + offset);
+		unsigned long type = *(dstart + 1);
 
 		if ((type & 0xff) == 0x17) {
 			*fixup = *fixup + offset;
 		} else {
 			int index = type >> 8;
-			uint32_t r = dynsym[index * 4 + 1];
+			unsigned long r = dynsym[index * 4 + 1];
 
 			*fixup = *fixup + r + offset;
 		}
-- 
2.16.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux