关于作者

姓名:朱海东

性别:男

出生日期:1982-01-15

地区:北京-海淀

联系电话:

QQ:65031729婚否:未婚
用户名:朱海东
笔名:朱海东
地区: 北京-海淀
行业:其他

日历  

快速登录

+ 用户名:
+ 密 码:

在线留言



战友

访问统计:
文章个数:225
评论个数:405
留言条数:3




Powered by BlogDriver 2.1

seast

 

Subscribe with Bloglines

文章

Garfield  (作者置顶)

- 作者: 朱海东 2005年08月10日, 星期三 22:46  回复(2) |  引用(2) 加入博采

《独自等待》——献给从你身边溜走的那个人
伍士贤导演

“没女人在脑子里转,我可以专心的写我的小说,不用浪费时间在鸡毛蒜皮的小事上。可是有时候又觉得很孤独,更没劲的是,好像全世界都知道我是个没伴的失败者。还故意在我面前展示,因为不管我往哪儿看,都是一对对的情侣。。。。。。”

简直就是说我。

当然,可以把小说换成程序,或者电影,或者,what ever。

- 作者: 朱海东 2005年10月11日, 星期二 21:22  回复(31) |  引用(2) 加入博采

上帝的电影(zz)
摘要:有些东西,总是值得尊敬的。 查看全文

- 作者: 朱海东 2005年09月21日, 星期三 15:56  回复(3) |  引用(2) 加入博采

电影术语
摘要:平时看片看到结尾字幕的时候有些东西都不知道说什么。 查看全文

- 作者: 朱海东 2005年09月20日, 星期二 20:01  回复(2) |  引用(2) 加入博采

暂且当白板来用
《哭泣的骆驼》,《黄狗的洞穴》——蒙古女导演宾巴苏伦·达瓦

《鳗鱼》,《赤桥下的暖流》——今村昌平

将来如果遇到,记得去看。

- 作者: 朱海东 2005年09月15日, 星期四 17:35  回复(1) |  引用(2) 加入博采

电影介绍——伴
摘要:好久没有写电影了,最近看了一些不需要动脑子的片,比如《头文字D》《史密斯夫妇》等,所以也没什么可以写的。今天来个介绍吧,我还没看到这部片子。 查看全文

- 作者: 朱海东 2005年09月14日, 星期三 17:40  回复(4) |  引用(2) 加入博采

好记性不如烂笔头——再论编译和链接
In Solaris’ libc.so
there are stub functions for mutexes and condition variables. These functions do
nothing (they just return -1) and will be overridden if libpthread.so is linked
in. This way printf() will use the real definition for mutexes in multithreaded
programs and the stub version in single threaded programs. This is also why
libpthread.so must be linked in after libc.so. (Other OSs accomplish the
same thing by different methods.)


参考文献
PThreads Primer
A Guide to Multithreaded Programming

Bil Lewis
Daniel J. Berg

- 作者: 朱海东 2005年09月14日, 星期三 14:56  回复(1) |  引用(2) 加入博采

好记性不如烂笔头——编译帮你读代码
Most compilers have an option (often -E) that passes the program source
through the preprocessor and outputs the resulting code. You can then read the code
to understand how a particular macro expands, or why a constant #defined in a
library include file generates an obscure error message in code that appears
legitimate. Keep in mind that it will be difficult to navigate through the preprocessed
code: included header files, expanded macros and constants, and removed
comments all conspire to make your life difficult.


参考文献
《Code Reading: The Open Source Perspective》
By Diomidis Spinellis
Publisher: Addison Wesley
Pub Date: May 30, 2003
ISBN: 0-201-79940-5

- 作者: 朱海东 2005年09月6日, 星期二 11:09  回复(1) |  引用(102) 加入博采

好记性不如烂笔头——链接时库文件的顺序
将多个.o文件链接成可执行文件的时候。如果链接的顺序不对,会产生错误。
《An introduction of gcc》里面有下面一段话:
On Unix-like systems, the traditional behavior of compilers and linkers
is to search for external functions from left to right in the object files
specified on the command line. This means that the object file which
contains the definition of a function should appear after any files which
call that function.

但是也说了:
Most current compilers and linkers will search all object files, regardless
of order, but since not all compilers do this it is best to follow the
convention of ordering object files from left to right.

链接库的时候,也存在这个问题。
今天写程序做了一下试验,发现gcc和我现在用的一个板子的编译器都可以不用严格按照顺序。
但是同时发现了另一个问题,就是我们自己的操作系统提供的库文件有两个:libgcc.a和libcs.a。
链接的时候要加上 -lcs -lgcc ,如果这两个顺序搞乱了,就会报错。

xscale-elf-ld -L../../lib -o main test1.o test2.o main.o \
-lgcc \
-lcs
xscale-elf-ld: warning: cannot find entry symbol _start; defaulting to 00008000
../../lib/libcs.a(_uprint.o): In function `outnum':
_uprint.o(.text+0x1ac): undefined reference to `__modsi3'
_uprint.o(.text+0x1c8): undefined reference to `__divsi3'
../../lib/libcs.a(_uprint.o): In function `outnum_u':
_uprint.o(.text+0x2e0): undefined reference to `__umodsi3'
_uprint.o(.text+0x2f4): undefined reference to `__udivsi3'
../../lib/libcs.a(fvwrite.o): In function `__sfvwrite':
fvwrite.o(.text+0x270): undefined reference to `__udivsi3'
make.exe: *** [main] Error 1

为什么编译器在搜索目标文件的时候可以不看顺序,搜索库文件的时候却会报错呢?


下面是hh的解答:
不依命令行的顺序的话就得重复扫描目标文件,我猜可能是重复扫描库文件的开销比较大所以必须在命令行指定正确的顺序。海东有空也可读读此书:
http://www.iecc.com/linker/

我认为很有道理。

- 作者: 朱海东 2005年08月30日, 星期二 19:02  回复(1) |  引用(2) 加入博采

已锁定
此日志的浏览权限已被作者锁定,请同作者联系,发送短消息,如果你的身份符合作者的要求,点击此处可以进行浏览

- 作者: 朱海东 2005年08月30日, 星期二 13:56  回复(0) |  引用(2) 加入博采