まつもと ゆきひろです

以下にある報告のように freebsdelf4.0ではオブジェクトファイル
中のシンボルに "_" が付いていないようです(が、dln.cは要求し
ているらしい)。

(defined(__FreeBSD__) && __FreeBSD__ < 3)って条件があるんで、
"_"を付けないようにしていると思うのですが、どうしてなんでしょ
う? 再現できる人はいらっしゃいますか?

------- Start of forwarded message -------
Date: Thu, 21 Jun 2001 11:33:28 -0700
From: Bob Alexander <balexander / rsv.ricoh.com>
To: Yukihiro Matsumoto <matz / zetabits.com>
Subject: Re: [ruby-talk:16677] Re: Problem running irb with Ruby 1.6.4 under FreeBSD 4.0

> Hmm, can you load any other dynamic link extensions on your machine?
> For example, would
>
>   require "etc"
>
> success?

Hi  Matz --

As you suspected,

    require "etc"

failed in a similar way:

# ruby
require 'etc'
- -:1:in `require': Undefined symbol "_Init_etc" -
/usr/local/lib/ruby/1.6/i386-freebsdelf4.0/etc.so (LoadError)
        from -:1


Running "nm" on etc.so shows:

# nm /usr/local/lib/ruby/1.6/i386-freebsdelf4.0/etc.so
00000e78 T Init_etc
..

Note that there is no leading underscore in "Init_etc".  That looks suspicious! I wish
I could be more helpful, but I'm not very familiar with Unix linking conventions. Let
me know if I can provide any more info.

Bob
------- End of forwarded message -------