我创建使用MonoDevelop的上打印“世界你好”一个简单的单声道的可执行文件。我想尝试的AOT“asmonly”选项。所以:

[root@localhost Debug]# ls
abc.exe
[root@localhost Debug]# mono --aot=full,static,asmonly abc.exe
Mono Ahead of Time compiler - compiling assembly /home/alon/Projects/abc/abc/bin/Debug/abc.exe
Code: 1538 Info: 50 Ex Info: 114 Class Info: 30 PLT: 5 GOT Info: 105 GOT Info Offsets: 24 GOT: 60
Output file: '/home/alon/Projects/abc/abc/bin/Debug/abc.exe.s'.
Linking symbol: 'mono_aot_module_abc_info'.
Compiled 9 out of 9 methods (100%)
Methods without GOT slots: 1 (11%)
Direct calls: 0 (100%)
JIT time: 1 ms, Generation time: 0 ms, Assembly+Link time: 0 ms.
GOT slot distribution:
    class: 1
    image: 1
    ldstr: 1
    interruption_request_flag: 7
[root@localhost Debug]# ls
abc.exe  abc.exe.s
[root@localhost Debug]# as -o hello_world.o abc.exe.s
[root@localhost Debug]# ls
abc.exe  abc.exe.s  hello_world.o
[root@localhost Debug]# ld -o hello_world.so hello_world.o
ld: warning: cannot find entry symbol _start; defaulting to 0000000008049000
[root@localhost Debug]# ls
abc.exe  abc.exe.s  hello_world.o  hello_world.so
[root@localhost Debug]# ./hello_world.so
Segmentation fault (core dumped)
[root@localhost Debug]# 

为什么会出现分段故障?我使用的Fedora 12 64。什么是“找不到入口符号_start”错误LD?

感谢您!

有帮助吗?

解决方案

AOT仍然需要单声道运行时,对于GC,IO-层,反射,线程,运行时代码生成等它只是预编译的代码,所述JIT编译会并将其置于一个可共享的库。该启动该单声道运行时“真正的”入口点仍然在单

其他提示

_start是二进制文件的入口点。这是OS来电,即可得到二进制和运行功能。你有一个主要功能定义?

是否当你不使用AOT工作? (即运行mono hello_world.exe。)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top