If you “tcpdump | grep” and you have to wait some time to see the output, that’s probably because stdout is buffered via libc (eg. printf).
If you want to flush() the output at every line (aka line buffered), just use “tcpdump -l”.
If you “tcpdump | grep” and you have to wait some time to see the output, that’s probably because stdout is buffered via libc (eg. printf).
If you want to flush() the output at every line (aka line buffered), just use “tcpdump -l”.
Due to some limitation of profiling software, it may be useful to link statically some libs into our programs. The following command links statically only lcrypto – while using dynamic linking on all other libs.
# gcc test.c -o test -Wl,-Bstatic -lcrypto -Wl,-Bdynamic
If you forget the ending -Wl,-Bdynamic you’ll get the following error:
/usr/bin/ld: cannot find -lgcc_s collect2: ld returned 1 exit status
This because gcc tries to link statically libgcc too – but using the wrong file: libgcc_s.a. To link statically libgcc you have to add the -static-libgcc flag
# gcc test.c -o test -Wl,-Bstatic -lcrypto -static-libgcc