#can you link 64-bit code to a 32-bit executable with Zig?

1 messages · Page 1 of 1 (latest)

snow chasm
#

I am writing a bootloader and this would be valuable to me since it would avoid to load an extra executable for the BIOS loader. Thanks a lot in advance!

civic adder
#

i think you can't mix-and-match the code

#

but you should be able to just include a binary blob of one code into the other via embedFile or the linker script

snow chasm
#

I see, it's what I suspected, thanks 🙂

tawdry star
#

one should definitely not attempt to do this due to how linkers are structured

#

it's definitely possible but no

#

there are a lot of questions, just about the size of global variables, calling conventions and a lot of other things

#

just building two compilation units with different compilation flags can be disasterous if you link them together

#

imo just build it into a flat binary (the zig build system can do this) and use the binary