Opened 3 years ago

Closed 3 years ago

#17482 closed bug (no change required)

libtextenconding.so isn't linked against libiconv.so.2 but need it

Reported by: zeusjr Owned by: nobody
Priority: normal Milestone: R1/beta4
Component: Kits/libtextencoding.so Version: R1/Development
Keywords: libiconv Cc:
Blocked By: Blocking:
Platform: All

Description

Tested on 64 bit hrev55736

~> objdump -x /system/lib/libtextencoding.so | grep libiconv
000000000001b290 1	F .text	000000000000015b		libiconvctl
000000000001aeb0 1	F .text	00000000000003aa		libiconv_open
000000000001b3f0 1	F .text	000000000000019c		libiconvlist
000000000001b280 1	F .text	000000000000000d		libiconv_close
000000000001b260 1	F .text	000000000000001c		libiconv
00000000002fc5c8 1	O .data	0000000000000004		_libiconvctl_version

It's dependences also don't link against libiconv.so.2, due that if you link against libtextenconding.so and execute it you will get a resolve symbol error.

Change History (3)

comment:1 by korli, 3 years ago

readelf -s objects/haiku/x86_64/release/kits/textencoding/libtextencoding.so | grep iconv
    14: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS iconv.c
  1183: 000000000001b290   347 FUNC    LOCAL  DEFAULT   11 libiconvctl
  1184: 000000000001b590   387 FUNC    LOCAL  DEFAULT   11 iconv_canonicalize
  1185: 000000000001aeb0   938 FUNC    LOCAL  DEFAULT   11 libiconv_open
  1190: 000000000001b3f0   412 FUNC    LOCAL  DEFAULT   11 libiconvlist
  1191: 000000000001b280    13 FUNC    LOCAL  DEFAULT   11 libiconv_close
  1196: 000000000001b260    28 FUNC    LOCAL  DEFAULT   11 libiconv
  1198: 00000000002fc5c8     4 OBJECT  LOCAL  DEFAULT   23 _libiconv_version

Symbols are local and defined.

When submitting a bug report, please define your test case.

comment:2 by zeusjr, 3 years ago

Oops. It's statically compiled, I'm so sorry. I was testing the packaged fpc and the bundled cwstring unit:

~> cat strtest.pas
program strtest;

{$mode objfpc}{H+}

uses cwstring;

begin
end.
~> ppcx64 strtest.pas
Free Pascal Compiler version 3.2.2 [2021/07/02] for x86_64
Copyright (c) 1993-2021 by Florian Klaemfl and others
Target OS: Haiku for x86_64
Compiling strtest.pas
Linking strtest
8 lines compiled, 0.1 sec
~> ./strtest
runtime_loader: /boot/home/strtest: Could not resolve symbol 'libiconv'
resolve symbol "libiconv" returned: -2147478780
runtime_loader: /boot/home/strtest: Troubles relocating: Symbol not found
~> readelf -s ./strtest | grep iconv
  1273: 0000000000000000	0 NOTYPE	GLOBAL	DEFAULT	UND	libiconv
  1748: 0000000000000000	0 NOTYPE	GLOBAL	DEFAULT	UND	libiconv_open
  2227: 0000000000000000	0 NOTYPE	GLOBAL	DEFAULT	UND	libiconv_close
~> objdump -x ./strtest | grep NEEDED
  NEEDED		libroot.so
  NEEDED		libnetwork.so
  NEEDED		libtextencoding.so
~> 

As I did see that libtextencoding.so used iconv and don't link it, I supposed that was the fault, but it seems to be fpc related, anyway I can't understand why fpc aren't linking it properly, but this is an another issue.

Thank you for your time.

Last edited 3 years ago by zeusjr (previous) (diff)

comment:3 by pulkomandy, 3 years ago

Milestone: UnscheduledR1/beta4
Resolution: no change required
Status: newclosed
Note: See TracTickets for help on using tickets.