From: ttate@... Date: 1999-07-31T01:11:41+09:00 Subject: [ruby-list:15776] Re: about postgres-0.5.1 立石です。 Date: Sat, 31 Jul 1999 00:26:00 +0900 From: Kawakami kawakami> > dln.cのRTLD_LAZYをRTLD_NOWに変えても何も支障がないようなら kawakami> > そうしませんか? kawakami> kawakami> すいません、これ良く分かりません。 kawakami> ruby 本体の話ですよね。どんなご利益があるのでしょうか? man dlopenすると次のような記述があります。 flag must be either RTLD_LAZY, meaning resolve undefined symbols as code from the dynamic library is executed, or RTLD_NOW, meaning resolve all undefined symbols before dlopen returns, and fail if this cannot be done. Option- ally, RTLD_GLOBAL may be or'ed with flag, in which case the external symbols defined in the library will be made available to subsequently loaded libraries. ようするにRTLD_LAZYだとコードが実行されるまで未定義な関数や変数 はエラーにならなず、RTLD_NOWだとdlopen(つまりrubyのrequire)時に 未定義なものを見つけてくれるようです。 で、変更してみてインストールをしたところobj_as_stringが解決され ないというエラーをちゃんと吐いてくれました。 ちなみにSolaris2.6でのman dlopenでは次のようにあります。 RTLD_LAZY Only references to data symbols are relo- cated when the object is first loaded. References to functions are not relocated until a given function is invoked for the first time. This mode should improve per- formance, since a process may not refer- ence all of the functions in any given object. This behavior mimics the normal loading of dependencies during process initialization. RTLD_NOW All necessary relocations are performed when the object is first loaded. This may waste some processing, if relocations are performed for functions that are never referenced. This behavior may be useful for applications that need to know as soon as an object is loaded that all symbols referenced during execution will be avail- able. This option mimics the loading of dependencies when the environment variable LD_BIND_NOW is in effect. Takaaki Tateishi