2010-01-13 3 views
1

MonoDevelop를 사용하여 "hello world"를 인쇄하는 간단한 모노 실행 파일을 만들었습니다. 나는 AOT의 'asmonly'옵션을 시험해보고 싶었다. 따라서 :Mono 'asmonly'옵션

[[email protected] Debug]# ls 
abc.exe 
[[email protected] 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 
[[email protected] Debug]# ls 
abc.exe abc.exe.s 
[[email protected] Debug]# as -o hello_world.o abc.exe.s 
[[email protected] Debug]# ls 
abc.exe abc.exe.s hello_world.o 
[[email protected] Debug]# ld -o hello_world.so hello_world.o 
ld: warning: cannot find entry symbol _start; defaulting to 0000000008049000 
[[email protected] Debug]# ls 
abc.exe abc.exe.s hello_world.o hello_world.so 
[[email protected] Debug]# ./hello_world.so 
Segmentation fault (core dumped) 
[[email protected] Debug]# 

왜 분할 오류가 발생합니까? Fedora 12 x64를 사용하고 있습니다. 그리고 ld에서 "entry symbol _start를 찾을 수 없습니다"오류가 무엇입니까?

감사합니다!

답변

2

AOT는 GC, IO- 레이어, 리플렉션, 스레딩, 런타임 코드 생성 등을 위해 여전히 Mono 런타임이 필요합니다. JIT가 컴파일 할 코드를 미리 컴파일하고 공유 가능한 도서관. Mono 런타임을 시작하는 "실제"진입 점은 여전히 ​​Mono입니다.

0

_start은 바이너리의 진입 점입니다. OS가 호출하여 바이너리를 실행하는 기능입니다. Main 함수가 정의되어 있습니까?

AOT를 사용하지 않을 때 작동합니까? (예 : mono hello_world.exe을 실행 중입니다.)

+0

물론 Main 함수가 정의되어 있습니다. 모든 예, 그것은 AOT를 사용하지 않을 때 작동합니다. –