I try to add link option in build system to generate ELF that has different base address, but currently I hasn’t found there has tutorial to do this, is there has some examples ?
Hello @ericlin1231
From command line use --image-base [addr] (from zig build-exe --help).
In build.zig set exe.image_base = 0x...;.
For build.zig examples see: Build System Tricks
Welcome to ziggit ![]()
Hi, thanks for your reply, but I also need to use my linker script to generate ELF, the linker script contain some symbols I need to use in the program, the --image-base option seems can’t override my base address setting in linker script.