Replace The Macro In The GCC Link Script

Run gcc -E -D BOOTDIR=$(pwd) -P -x c boot/arch/riscv/boot0.lds

Demo

pwd
/home/source/workspace/riscv-flare
sed -n '9,12p' boot/arch/riscv/boot0.lds 
        .head   :
        {
                BOOTDIR/boot0_head.o    (.rodata)
        }
gcc -E -D BOOTDIR=$(pwd) -P -x c boot/arch/riscv/boot0.lds | sed -n '8,11p'
 .head :
 {
  /home/source/workspace/riscv-flare/boot0_head.o (.rodata)
 }

Notes

(1) run gcc --help | grep "\-x".