Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Oct 2020 17:30:54 -0700
From:      "Jin Guojun[VFF]" <>
Subject:   strange binary status when linked with shared binary in 11.4-R
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help
In 11.4-Release, the binary linked with shared library (.so) is MUCH 
bigger then expected,
and ldd shows the binary linked with shared binary is not really 
dynamically linked.
This has not been seen in 10.x-Release and earlier.

Does anyone know if the dynamic link flag has been changed in CLang 10?


$ CC -v
FreeBSD clang version 10.0.0 ( 
Target: x86_64-unknown-freebsd11.4

Move libccs.a to to demo that this is not a mistake:

-rw-r--r--  1 jin  100   435688 Sep  7 14:59 /usr/local/lib/
lrwxr-xr-x  1 jin  100         13 Sep  7 15:00 /usr/local/lib/ 
-rw-r--r--  1 jin  100   339648 Sep  7 15:00 /usr/local/lib/

# static linker fails due to no static library

$ cc -I$HOME/include stol.c -o stol -L/usr/local/lib -Xlinker -Bstatic 
-lccs -lm
/usr/bin/ld: cannot find -lccs
cc: error: linker command failed with exit code 1 (use -v to see invocation)

# now we know binary is linked to a shared library, but the binary is 
big and no dynamic link sign (ldd)

$ cc -I$HOME/include stol.c -o stol -L/usr/local/lib -Xlinker -Bdynamic 
-lccs -lm

$ ll stol
-rwxr-xr-x  1 jin  wheel  229130 Oct 12 16:49 stol*
$ ldd stol
stol: => /lib/ (0x800854000) => /lib/ (0x800a84000)

# move .ax back to .a and try static link

$ cc -I$HOME/include stol.c -o stol -L/usr/local/lib -Xlinker -Bstatic 
-lccs -lm
$  ll stol
-rwxr-xr-x  1 jin  wheel  13855 Oct 12 16:56 stol*
$ ldd stol
stol: => /lib/ (0x800824000) => /lib/ (0x800a54000)

Want to link to this message? Use this URL: <>