[freetds] tsql problem

kevin bartz kbartz at loyaltymatrix.com
Fri Jun 18 19:03:55 EDT 2004

Hi James! Thanks for your help. I learned quite a bit from your response,
and am now a bit more comfortable with my runtime linker! I thought I would
let you know what happened when I ran the commands you suggested. First,

kevin at redtail:~/test> readelf -d `which tsql` |sed -ne1,/rpath/p

Dynamic segment at offset 0x3428 contains 22 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libreadline.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libtds.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000c (INIT)               0x4014f8
... (nothing more interesting)...

Looks pretty similar to yours, except for the libreadline instead of curses
and a 6 instead of a 5. Is that a potential problem?

On my system, libreadline.so.4 points to libreadline.so.4.3.old, not
libreadline.so.4.3. I also have libreadline.so.4.3, though, so I tried
linking libreadline.so.4 to libreadline.so.4.3, but tsql gave the same

Running the next line you suggested, I get

kevin at redtail:~/test> nm /usr/local/lib/libreadline.so.4 |grep BC
                 U abort@@GLIBC_2.2.5
                 U access@@GLIBC_2.2.5
                 U BC
                 U closedir@@GLIBC_2.2.5

Does this mean anything?

As far as ncurses, I do have three of them installed, one regular, one
32-bit and one for YaST (a SuSE administrative program). Is there some way I
can tell which ncurses tsql is trying to use? Then maybe you could tell me
whether it's the right one, wrong one, etc. and I could link it to the right

Anyway, thanks so much for all your help. I'm learning a lot, and I think
I'm getting close! Let me know if there's anything you think I could do


-----Original Message-----
From: freetds-bounces at lists.ibiblio.org
[mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of James K. Lowden
Sent: Friday, June 18, 2004 3:44 PM
To: FreeTDS Development Group
Subject: Re: [freetds] tsql problem

On Fri, 18 Jun 2004, "kevin bartz" <kbartz at loyaltymatrix.com> wrote:
> ldd gives
> kevin at redtail:~/test> ldd /usr/local/bin/tsql
>         libreadline.so.4 => /usr/local/lib/libreadline.so.4
>         libtds.so.3 => not found
>         libc.so.6 => /lib64/libc.so.6

You want to understand your runtime linker a little better, not that
that's everyone's favorite pasttime. 

And ELF binary can incorporate runtime link paths.  I'm curious, what does
your machine show for this:

$ readelf -d `which tsql` |sed -ne1,/rpath/p

Dynamic segment at offset 0x2e6c contains 20 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libcurses.so.5]
 0x00000001 (NEEDED)                     Shared library: [libtds.so.3]
 0x00000001 (NEEDED)                     Shared library: [libc.so.12]
 0x0000000f (RPATH)                      Library rpath: [/usr/local/lib]

(ISTR Linux systems often don't use the RPATH entry.  I guess it would be
set by libtool.)

Regarding readline, 

$ nm /usr/pkg/lib/libreadline.so.4 |grep BC
00028ebc B BC

On my system, libreadline.so.4 points to libreadline.so.4.3.  Yours?  

Note, my binary uses libcurses.so.5 and you (seem to) have three ncurses
installed.  Maybe tsql is linked to the wrong one?  


FreeTDS mailing list
FreeTDS at lists.ibiblio.org

More information about the FreeTDS mailing list