我想编写一个看起来像这样的链接器脚本:
SECTIONS {
. = 0x0;
.startup . : { startup.o(.text) }
.text : { *(.text) }
.data : { *(.data) }
.bss : { *(.bss COMMON) }
. = 0x4000;
other.text : { other.o(.text) }
other.data : { other.o(.data) }
other.bss : { other.o(.bss) }
}
我的意图是按以下顺序:
- 带有
.textfrom的部分startup.o .text,.data并.bss包含来自所有其他输入文件的那些部分,除了other.o- ,
.text和.data部分.bss来自other.o
当然,我给出的脚本存在问题:other.o包含在*之前使用的通配符中,因此它没有放在输出部分other中。
除了手动列出所有输入目标文件栏other.o代替*s 之外,还有什么方法可以在这里实现我想要的吗?