I am trying to run this command
我正在尝试运行这个命令。
ld -Ttext 0x1000 -o kernel.bin loader.o main.o video.o
but it returns ld: unknown option: -Ttext
但是它返回ld:未知选项:-Ttext。
Is there any alternatives to this action or a way to make ld work?
有什么办法可以替代这一行动或让ld工作?
Here is written, that option -Ttext exists, but in my case it shows that no http://linux.about.com/library/cmd/blcmdl1_ld.htm
这里写着,选项-Ttext存在,但在我的例子中,它显示了没有http://linux.about.com/library/cmd/blcmdl1_ld.htm。
2 个解决方案
#1
0
"-Ttext" is where in memory the text(code) segment will be. The macintosh ld does not support that option. It does support "-segaddr text"(it might not be text, though, it might be _text or __text). If you are writing an operating system, you probably want a separate toolchain because the macintosh toolchain is only designed for mach-o objects for use on the macintosh.
“-Ttext”是内存中文本(代码)段的位置。macintosh ld不支持这个选项。它支持“-segaddr文本”(它可能不是文本,但是可能是_text或__text)。如果您正在编写一个操作系统,您可能需要一个单独的工具链,因为macintosh工具链只是为macintosh上的mach-o对象设计的。
#2
-1
ld
's man
page says:
ld的手册页说:
-T scriptfile
--script=scriptfile
Use scriptfile as the linker script. This script replaces ld's
default linker script (rather than adding to it), so commandfile
must specify everything necessary to describe the output file.
If scriptfile does not exist in the current directory, "ld" looks
for it in the directories specified by any preceding -L options.
Multiple -T options accumulate.
So you should
所以你应该
- Use the correct format:
ld -T text 0x1000 -o kernel.bin loader.o main.o video.o
- 使用正确的格式:ld -T文本0x1000 -o内核。本加载程序。o主要。o video.o
- Make sure
text
exists in the current directory and is indeed a linker script. - 确保文本存在于当前目录中,并且确实是一个链接器脚本。
#1
0
"-Ttext" is where in memory the text(code) segment will be. The macintosh ld does not support that option. It does support "-segaddr text"(it might not be text, though, it might be _text or __text). If you are writing an operating system, you probably want a separate toolchain because the macintosh toolchain is only designed for mach-o objects for use on the macintosh.
“-Ttext”是内存中文本(代码)段的位置。macintosh ld不支持这个选项。它支持“-segaddr文本”(它可能不是文本,但是可能是_text或__text)。如果您正在编写一个操作系统,您可能需要一个单独的工具链,因为macintosh工具链只是为macintosh上的mach-o对象设计的。
#2
-1
ld
's man
page says:
ld的手册页说:
-T scriptfile
--script=scriptfile
Use scriptfile as the linker script. This script replaces ld's
default linker script (rather than adding to it), so commandfile
must specify everything necessary to describe the output file.
If scriptfile does not exist in the current directory, "ld" looks
for it in the directories specified by any preceding -L options.
Multiple -T options accumulate.
So you should
所以你应该
- Use the correct format:
ld -T text 0x1000 -o kernel.bin loader.o main.o video.o
- 使用正确的格式:ld -T文本0x1000 -o内核。本加载程序。o主要。o video.o
- Make sure
text
exists in the current directory and is indeed a linker script. - 确保文本存在于当前目录中,并且确实是一个链接器脚本。