Hi, Thank you for yet another insightful session! and thank you everyone who had joined :)
Here is the summary of the 2025-02-25 Session: TL;DR we discussed the binutils utilites like nm, objdump and c++filt, what they are and how to use them. ---- nm command is used to inspect symbol tables in object files, libraries, executables. and it lists defined and undefined symbols. Understanding nm command output: fixed digit number which is the offset the upper case 'T' refers to text and upper case 'U' refers to unresolved the upper case 'D' refers to the data section.. etc.. c++filt (C++ filter) is a utility used to demangle symbols. Mangling is process by which the compiler transforms functions and/or variable names into encoded symbols. Hence this utility comes handy. objdump is another command line utility to disassemble, analyse and inspect object files, it is part of the binutils package, and is useful for debugging, it is generally used by programmers who are working with compilation tools. Why do we need these utilities? or when does these are actually used? each of these tools can do work on a library or on a binary When you are programming with a language like C++ you have two abstractions to deal with 1. The standard library 2. The artifact that you are working with Any time you debug or you want to optimise step more and you have to develop a utility very close to the system, or you want to find out why a particular symbol is conflicting or why it is taking so much memory? That is when these utilities come handy. the six pack - linux - glibc - gcc - gdb - binutils - libstdc++ if we are standardized on these 6 then we can build any system. We can construct any thing in the world out of this. Optimization level -O0 -O3 C++ compiler can do aggressive optimisations to the code. H to HU header files contains declarations. They double up as containing the interfaces. However, in C++ when using templates, the entire code is in the header file. This explains the popularity of header-only libraries (HOL). recognise the nature of the output. References: https://sourceware.org/binutils/docs/binutils.html https://en.wikipedia.org/wiki/GNU_Binutils warm regards Ragini