gcc可以通过-Wl将参数传入ld命令
GCC:
-Wl,option
LD:
-Tbss
org -Tdata
org -Ttext
org.bss
, .data
or .text
as the sectionname.
-T
scriptfile --script=
scriptfileld
looks for it in the directories specified by any preceding -L options. Multiple -T options accumulate.
例子:
gcc -g -nostdlib -Wl,-N,-Ttext,7C00 -Wl,-T../ldscript -o stage1.exec.exe stage1.o
objcopy -O binary stage1.exec.exe stage1