Skip to content

Commit 41da0a2

Browse files
committed
Resolve symlinks when gathering libtool version.
1 parent a01b715 commit 41da0a2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/elfdeps.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ typedef struct elfInfo_s {
4444
static char *getLibtoolVer(const char *filename)
4545
{
4646
const char *so;
47+
char dest[PATH_MAX];
48+
int destsize = 0;
4749
int found_digit, found_dot = 0;
50+
51+
destsize = readlink(filename, dest, PATH_MAX);
52+
if (destsize > 0) {
53+
dest[destsize] = 0;
54+
filename = dest;
55+
}
4856
// Start from the end of the string. Verify that it ends with
4957
// numbers and dots, preceded by ".so.".
5058
so = filename + strlen(filename);

0 commit comments

Comments
 (0)