原文引用自:http://kylix.linuxaid.com.cn/xoo ... hp?cid=8&lid=60
[PHP]
fix kylix3-bcb core dump in kernel 2.6 patch
copy ilink and ilink.so to $(BCB)/bin
$(BCB) is the kylix3 install dir.(sample:/usr/local/kylix3)
http://kylix.linuxaid.com.cn/xoops2/
roc <roc@linuxaid.com.cn>
2004/08/03
from:
SUSE 9.1 running a 2.6.x kernel, so the first fix is kernel
2.6 related. When kernel shift from 2.4 to 2.6, the
/proc/self/maps is changed slightly. This make
VMem_FindUnmappedRegion thought the memory region beyond
0xc0000000 is also usable. But in fact, mostly, our TASK_SIZE is
configured to 0xc0000000. So I assume all address above
0xbfff0000 is not available to user space. And also, I assume
/proc/self/maps is always readable for the process itself, so
assert is not need at all. Based the two assumptions above, I
patched ilink and ilink.so like this:
-----------------------> ilink<----------------------- 00045480
orig:
808d48f: 83 7d fc 00 cmpl $0x0,0xfffffffc(%ebp)
808d493: 75 1e jne 808d4b3 <VMem_FindUnmappedRegion+0x4f>
808d495: 68 16 6a 0a 08 push $0x80a6a16
808d49a: 68 b0 01 00 00 push $0x1b0
808d49f: 68 88 69 0a 08 push $0x80a6988
808d4a4: 68 f7 69 0a 08 push $0x80a69f7
808d4a9: e8 12 cd fb ff call 804a1c0 <_init+0x1c0>
808d4ae: 83 c4 10 add $0x10,%esp
808d4b1: eb 00 jmp 808d4b3 <VMem_FindUnmappedRegion+0x4f>
change to:
808d48f: 81 7d 08 00 00 ff bf cmpl $0xbfff0000,0x8(%ebp)
808d496: 0f 82 17 00 00 00 jb 808d4b3
808d49c: 31 c0 xor %eax, %eax
808d49e: e9 13 01 00 00 jmp 808d5b6
808d4a3: 90 nop
----------------------->ilink.so<----------------------- 000548a0
orig:
548af: 83 7d fc 00 cmpl $0x0,0xfffffffc(%ebp)
548b3: 75 2b jne 548e0 <VMem_FindUnmappedRegion+0x70>
548b5: 8d 93 5e 75 ff ff lea 0xffff755e(%ebx),%edx
548bb: 89 d0 mov %edx,%eax
548bd: 50 push %eax
548be: 68 b0 01 00 00 push $0x1b0
548c3: 8d 93 d0 74 ff ff lea 0xffff74d0(%ebx),%edx
548c9: 89 d0 mov %edx,%eax
548cb: 50 push %eax
548cc: 8d 93 3f 75 ff ff lea 0xffff753f(%ebx),%edx
548d2: 89 d0 mov %edx,%eax
548d4: 50 push %eax
548d5: e8 ee 63 fb ff call acc8 <_init+0x1c0>
548da: 83 c4 10 add $0x10,%esp
548dd: eb 01 jmp 548e0 <VMem_FindUnmappedRegion+0x70>
548df: 90 nop
change to:
548af: 81 7d 08 00 00 ff bf cmpl $0xbfff0000, 0x8(%ebp)
548b6: 0f 82 24 00 00 00 jb 548e0
548bc: 31 c0 xor %eax, %eax
548be: e9 2d 01 00 00 jmp 549f0
Second. I found injected_execve is not need for SUSE 9.1. If
you want to use IDE integrated debugger, you have to remove
init_ExecveRedirect() in __libc_csu_init() first, then recompile
_initfini32.cpp, then ar it into libborcrtl.a and
libborcrtl_noshare.a. I dont know why yet, but I think that
mention it in the README file will be a great helpful.
I've test these two fixed for several hours, and BCB runs
quite stable for me.
If you have any further questions, pls mail
huxw1980 AT hotmail DOT com.
----------------------------------
配合以前做的补丁解决Kylix3-BCB在MandrakeLinux9.1和RedHat9.0等新版Linux不能编译的补丁
就可以在最新的Linux发行版(Mandrake10/FC1/FC2)下用Kylix3-BCB进行编程开发工作了,COOL
[/PHP]
补丁下载:
http://kylix.linuxaid.com.cn/xoo ... hp?cid=8&lid=60
特别感谢:Kylix中文社区(http://kylix.linuxaid.com.cn/xoops2/) 管理员 ROC 朋友 |