- Package:
- binutils-doc
- Source:
- binutils
- Submitter:
- Dave Love
- Date:
- 2022-01-12 20:03:05 UTC
- Severity:
- normal
The Info and man pages for ld say "--no-as-needed restores the default
behaviour", but the default changed at some stage to --as-needed.
$ cc -shared -lm -o x.so
$ lddtree x.so
x.so => ./x.so (interpreter => none)
$ cc -shared -Wl,--no-as-needed -lm -o x.so
$ lddtree x.so
x.so => ./x.so (interpreter => none)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
ld-linux-x86-64.so.2 => /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6