From 5cebe5e9ccbbbd8e4759f11969a807a0c7aa6e1c Mon Sep 17 00:00:00 2001 From: HimbeerserverDE Date: Fri, 16 Sep 2022 20:28:03 +0200 Subject: [PATCH] Define linker memory origin flags in the target .json --- Makefile | 2 +- stage2/x86-loadnothing.json | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ec74fc8..4e7ca34 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ magic.bin: echo -en "\x55\xAA" > magic.bin stage2/target/x86-loadnothing/release/stage2: stage2/src/main.rs - cd stage2 && cargo rustc --release -- -C link-arg=-Ttext=0x7e00 -C link-arg=-Tdata=0x7e00 -C link-arg=--oformat=binary + cd stage2 && cargo build --release nothing.img: magic.bin stage2/target/x86-loadnothing/release/stage2 stage1/boot.bin dd if=/dev/zero of=nothing.img bs=32M count=1 diff --git a/stage2/x86-loadnothing.json b/stage2/x86-loadnothing.json index 556f46e..973ff90 100644 --- a/stage2/x86-loadnothing.json +++ b/stage2/x86-loadnothing.json @@ -13,5 +13,12 @@ "disable-redzone": true, "features": "-mmx,-sse,+soft-float", "cpu": "pentium", - "relocation-model": "static" + "relocation-model": "static", + "pre-link-args": { + "ld.lld": [ + "-Ttext=0x7e00", + "-Tdata=0x7e00", + "--oformat=binary" + ] + } } -- 2.44.0