2010年4月12日 星期一

qemu 在 user mode 下是用 static code gen buffer,size為32mb
in ./exec.c line 408 it mentioned:
Currently it is not recommended to allocate big chunks of data in
user mode. It will change when a dedicated libc will be used

but don't know why. Why not use mmap as system mode use?

Segment selector Format:

15 ...... 32 10
indexTIRPL

TI Table indicator:
0 means selector indexes into GDT
1 means selector indexes into LDT
RPL Privelege level. Linux uses only two privelege levels.
0 means kernel
3 means user

Examples:

Kernel code segment
TI=0, index=1, RPL=0, therefore selector = 0x08 (GDT[1])
User data segment
TI=1, index=2, RPL=3, therefore selector = 0x17 (LDT[2])
stack 弄壞了!

先弄一個 exit basic block,然後再將 pass 給去掉。

現在要focus 在 indirect branch 上,要知道的是第一個參數的 address 是什麼?
FP->getPassName()
lib/CodeGen/StackProtector.cpp

DefaultJITMemoryManager

lib/CodeGen/LLVMTargetMachine.cpp:
LLVMTargetMachine::addPassesToEmitMachineCode
LLVMTargetMachine::addCommonCodeGenPasses

=============================
Prevent spill register code gen.
enable to emit epilog for branch and indirect brance
=============================
錯在這:0x40095872: mov (%edx),%eax
%edx 為 init_stack+c 的位置,其中的值
在 loader_exec 中就放了!
在 create_elf_tables() 之後!
在 loader_build_argptr() 之後!
在 put_user_ual(stringp, envp) 之後!

沒有留言:

張貼留言