bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hardcode_direct_absolute description


From: Bruno Haible
Subject: hardcode_direct_absolute description
Date: Wed, 24 May 2006 14:48:31 +0200
User-agent: KMail/1.5

Hi,

Albert Chin-A-Young pointed me to this description of hardcode_direct_absolute
in the libtool CVS:

_LT_TAGDECL([], [hardcode_direct_absolute], [0],
    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
    DIR into the resulting binary and the resulting library dependency is
    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
    library is relocated])

The phrase "hardcodes DIR into the resulting binary" is misleading, because

1) This hardcoding affects only the given library dependency, not other
   library dependencies. See execution trace below. In other words, it hardcodes
   the file name DIR/libNAME${shared_ext} in the resulting binary.

2) If DIR is a relative pathname, it is first made absolute before being
   hardcoded in the binary. In other words, it's not DIR/libNAME${shared_ext}
   which is hardcoded, but `cd DIR && pwd`/libNAME${shared_ext}.

I would therefore suggest to change this description to

_LT_TAGDECL([], [hardcode_direct_absolute], [0],
    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
    the absolute filename `cd DIR && pwd`/libNAME${shared_ext} into the 
resulting
    binary and the resulting library dependency is "absolute", i.e impossible to
    change by setting ${shlibpath_var} if the library is relocated])

Bruno

====================== execution log on HP-UX 11 ======================

$ ls -l hplibs*/*
lrwxrwxrwx   1 haible            13 May 23 20:00 hplibs1/libiconv.sl -> 
libiconv.sl.3
-r-xr-xr-x   1 haible        996057 Feb 19  2003 hplibs1/libiconv.sl.3
lrwxrwxrwx   1 haible            12 May 23 20:00 hplibs2/libintl.sl -> 
libintl.sl.7
-r-xr-xr-x   1 haible         61723 Feb 12  2005 hplibs2/libintl.sl.7

$ cc hello.c hplibs1/libiconv.sl.3 -Lhplibs2 -lintl
$ chatr a.out
...
         shared library list:
             static    /home/haible/hplibs1/libiconv.sl.3
             dynamic   hplibs2/libintl.sl.7
             dynamic   /usr/lib/libc.2
...
$ mv hplibs2/libintl.sl* hplibs1/
$ chatr a.out
...
         shared library list:
             static    /home/haible/hplibs1/libiconv.sl.3
             dynamic   hplibs2/libintl.sl.7
             dynamic   /usr/lib/libc.2
...
$ ./a.out 
/usr/lib/dld.sl: Can't open shared library: hplibs2/libintl.sl.7
/usr/lib/dld.sl: No such file or directory
ABORT instruction





reply via email to

[Prev in Thread] Current Thread [Next in Thread]