March 16th Friday (三月 十六日 金曜日)

  Today I wrote a function in assembly language.  I wrote a test program in C language to call that
function.  I used "ld -dynamic-linker /lib/ld-linux.so.2 ...".  I got a warning report.  After running
the binary program I got a "segment fault" message.  For this quesion I tried other ways to link these
two program together.  Finally, I found I can used "gcc" to make a correct binary program.  Why I can
use a linker tool to make?

  After trial again and again, and many thought, I found the answer.  I used "gcc -S ..." to produce
a assembly program from the original C program.  From the assembly source, I found "gcc" made a "main"
label for main() funciton in the C source file.  But the "ld", a linker tool, must consided "_start"
label as a entry point.  In other words, it can not find out a correct entry point in that there is not a "_start" label in main program.  So, although I loaded the ".so" library there is still a run error.

  今日白さんの彼の卓球試合があります。 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值