Debugging sections.
So we know if I want to compile my C code and load in GDP and GDP to work properly, I need to pass
hyphen g option.
So if I need to compile my C code with hyphen G, right.
And let's see what happens when I compile with f and g.
Before that I need to know what is a daf d w a r F is a standardized format for representing debug information.
This information includes symbol names, structure layouts, and how to recover backtraces, etc. it
is a full form of Dword office debugging with arbitrary record formats.
Whenever you compile your C code with debug information, that is the hyphen G flag, this information
will be written into a special debug l f section, so there will be a lot of debug underscore L f sections
will be created.
So for example now I have the C code okay.
And now we have seen using Rudolph there are 28 sections because I have not compiled this using hyphen
g option I don't see the debug sections.
Now I will compile this code using hyphen g option.
Now let's look into the number of sections.
The number of sections have been increased.
Previously we had 29 sections.
Now 34 sections have been added and it has extra sections.
This five sections here okay.
It is again type program bits but it is not having any flags.
It has debug arranges debug info debug abbreviation something something debug string.
So this all information is used by GDB during debugging.
Debugging.
If you don't have this section then gdb will not be able to work properly.
So when you add hyphen g then this additional debug sections are added by the linker.
The linker adds additional this many sections related to GDP.
If I don't add hyphen g, then this g debug sections are gone.