Issue #16558 has been reported by vo.x (Vit Ondruch).

----------------------------------------
Bug #16558: What is special about GB2312
https://bugs.ruby-lang.org/issues/16558

* Author: vo.x (Vit Ondruch)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Checking Ruby in Fedora, rpmlint complains about standard library:

~~~
$ rpmlint ./ruby-libs-2.7.0-126.fc32.x86_64.rpm 
ruby-libs.x86_64: W: spelling-error %description -l en_US libruby -> lib ruby, lib-ruby, library
ruby-libs.x86_64: W: obsolete-not-provided ruby-tcltk
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/continuation.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/digest/bubblebabble.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/digest/md5.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/digest/rmd160.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/digest/sha1.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/digest/sha2.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/big5.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/cesu_8.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/cp949.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/emacs_mule.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/encdb.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/euc_jp.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/euc_kr.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/euc_tw.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/gb18030.so
ruby-libs.x86_64: E: shared-lib-without-dependency-information /usr/lib64/ruby/enc/gb2312.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/gbk.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_1.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_10.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_11.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_13.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_14.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_15.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_16.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_2.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_3.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_4.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_5.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_6.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_7.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_8.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/iso_8859_9.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/koi8_r.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/koi8_u.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/shift_jis.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/big5.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/cesu_8.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/chinese.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/ebcdic.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/emoji.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/emoji_iso2022_kddi.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/emoji_sjis_docomo.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/emoji_sjis_kddi.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/emoji_sjis_softbank.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/escape.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/gb18030.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/gbk.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/iso2022.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/japanese.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/japanese_euc.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/japanese_sjis.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/korean.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/single_byte.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/transdb.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/trans/utf_16_32.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/utf_16be.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/utf_16le.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/utf_32be.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/utf_32le.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/windows_1250.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/windows_1251.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/windows_1252.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/windows_1253.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/windows_1254.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/windows_1257.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/enc/windows_31j.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/fcntl.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/fiber.so
ruby-libs.x86_64: E: library-not-linked-against-libc /usr/lib64/ruby/rbconfig/sizeof.so
1 packages and 0 specfiles checked; 69 errors, 2 warnings.
~~~

I guess that the `E: library-not-linked-against-libc` errors are false positive, because these are providing internal Ruby functionality and they are always loaded later, when libc is already loaded.

But I wonder what is the difference for `enc/gb2312.so`. Looking into details, these are the information I am able to obtani:

~~~
$ ldd /usr/lib64/ruby/enc/gb2312.so
	statically linked

$ readelf -d /usr/lib64/ruby/enc/gb2312.so

Dynamic section at offset 0x2e20 contains 22 entries:
  Tag        Type                         Name/Value
 0x000000000000000c (INIT)               0x1000
 0x000000000000000d (FINI)               0x1118
 0x0000000000000019 (INIT_ARRAY)         0x3e08
 0x000000000000001b (INIT_ARRAYSZ)       8 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x3e10
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x2f0
 0x0000000000000005 (STRTAB)             0x3a8
 0x0000000000000006 (SYMTAB)             0x318
 0x000000000000000a (STRSZ)              97 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000003 (PLTGOT)             0x3fc0
 0x0000000000000002 (PLTRELSZ)           24 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x4b8
 0x0000000000000007 (RELA)               0x410
 0x0000000000000008 (RELASZ)             168 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x0000000000000018 (BIND_NOW)           
 0x000000006ffffffb (FLAGS_1)            Flags: NOW
 0x000000006ffffff9 (RELACOUNT)          3
 0x0000000000000000 (NULL)               0x0
~~~

This says it is statically linked. If yes, the question is why and why not the others. Please note that `enc/gb2312.so` used to be similar to all other libraries in Ruby 2.6, so I wonder what is the reason, what has changed?



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>