mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-02 08:42:52 +00:00
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
This commit is contained in:
parent
3ad0f06b06
commit
8c9b79fab0
@ -52,6 +52,12 @@ proc run_boot_dir {binaries {core_type core}} {
|
|||||||
#
|
#
|
||||||
set boot_modules "[run_dir]/boot_modules.s"
|
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
|
# introduce boot module headers
|
||||||
exec echo -e \
|
exec echo -e \
|
||||||
"/**" \
|
"/**" \
|
||||||
@ -73,10 +79,10 @@ proc run_boot_dir {binaries {core_type core}} {
|
|||||||
foreach binary $binaries {
|
foreach binary $binaries {
|
||||||
if {$binary == $core_bin} { continue }
|
if {$binary == $core_bin} { continue }
|
||||||
exec echo -e \
|
exec echo -e \
|
||||||
"\n.long _boot_module_${i}_name" \
|
"\n${address_type} _boot_module_${i}_name" \
|
||||||
"\n.long _boot_module_${i}_begin" \
|
"\n${address_type} _boot_module_${i}_begin" \
|
||||||
"\n.long _boot_module_${i}_end - _boot_module_${i}_begin" \
|
"\n${address_type} _boot_module_${i}_end -" \
|
||||||
>> $boot_modules
|
" _boot_module_${i}_begin" >> $boot_modules
|
||||||
incr i
|
incr i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user