Hi,
First of all, good job! It's good to see there are still such projects like yours!
iliak wrote:
My question is how to configure CMake to make a binary file which contains every sections of the code this way :
Short answer, you don't. CMake is not capable of doing that. CMake will create Makefiles (or whatever), which will call a linker (for Clang that would most likely be LLVM-lld). It is the linker's job to do what you want, using the linker script you provide to it.
iliak wrote:
AND relocate all the above code at memory location 0xF00000 ?
Your linker script looks OK to me (you have added "> rom", and you've included all sections), but it's been decades since I last linked a ROM. But I'm certain it's the linker and the linker script that needs your attention, not CMake. First, I suggest to check the exact command. Is the linker called with all the .o files, or only just one? Is the linker script passed to the linker? Second, check if the ELFs really have those sections (try readelf in your toolchain). Once you can run ld from the command line correctly, it is only then when I suggest to move to CMake to generate the exact same command.
Moreover,
Code:
m68k-amigaos-objcopy -O binary -j .text bootstrap rom.bin
and that you have "bootstrap.s" suggests that you're not linking properly, and you only convert the bootstrap ELF into rom.bin. There should be something like:
Code:
m68k-amigaos-ld -L linker.lds bootstrap.o exec.o graphic.o... -o rom.elf
m68k-amigaos-objcopy -O binary -j .text rom.elf rom.bin
Ah, another thing. This command removes everything except the text segment. Did you redirect all your sections into the text segment in the linker script? Otherwise this command will wipe out everything that's not strictly code.
Cheers,
bzt