From 8c9b79fab098e8f6d6f743c15dfd51a616197bca Mon Sep 17 00:00:00 2001 From: Adrian-Ken Rueegsegger Date: Thu, 12 Mar 2015 10:27:40 +0100 Subject: [PATCH] hw: Use properly sized asm type in boot_modules.s The boot modules assembled by the generated boot_modules.s file is accessed from core using struct Bm_header. Unfortunately the assembler .long directive is synonym to .int [1] and thus has the same size as the C++ int type and *not* long. Use the matching assembly type .quad in boot_modules.s when generating the file for 64-bit platforms such as x86_64. [1] - https://sourceware.org/binutils/docs/as/Long.html --- tool/run/boot_dir/hw | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tool/run/boot_dir/hw b/tool/run/boot_dir/hw index c8e0278b6..44c1ab78f 100644 --- a/tool/run/boot_dir/hw +++ b/tool/run/boot_dir/hw @@ -52,6 +52,12 @@ proc run_boot_dir {binaries {core_type core}} { # set boot_modules "[run_dir]/boot_modules.s" + if {[have_spec "64bit"]} { + set address_type ".quad" + } else { + set address_type ".long" + } + # introduce boot module headers exec echo -e \ "/**" \ @@ -73,10 +79,10 @@ proc run_boot_dir {binaries {core_type core}} { foreach binary $binaries { if {$binary == $core_bin} { continue } exec echo -e \ - "\n.long _boot_module_${i}_name" \ - "\n.long _boot_module_${i}_begin" \ - "\n.long _boot_module_${i}_end - _boot_module_${i}_begin" \ - >> $boot_modules + "\n${address_type} _boot_module_${i}_name" \ + "\n${address_type} _boot_module_${i}_begin" \ + "\n${address_type} _boot_module_${i}_end -" \ + " _boot_module_${i}_begin" >> $boot_modules incr i }