5 ms·
It's possible to define symbols in header files (for example, inline functions).
by caf 16y ago
It's possible to define symbols in header files (for example, inline functions).
- _delirium 16y agoI thought the way the C preprocessor worked, those ended up getting literally copy and pasted into the .c file that #include'd them, and should be indistinguishable from the case where you wrote them directly in the .c file? Or does gcc keep track of where #include'd files came from, and write that info into the binary?
- parbo 16y agoYes, otherwise you'd never find syntax errors in the header files.
- scott_s 16y agoBut that's during the compilation phase - this is the compiled binary. Binaries that are compiled with debugging information turned on will include this information for a similar reason: so that when you're debugging a program, or when it breaks, you can map that to places in your source file.
- caf 16y agoRight - and `nm` uses the debugging information to identify the file:line where each symbol was defined. The original scripts used to generate the treemap use `nm`.
- illumen 16y agoyes, and no. Whole program optimization kinda changes that. So do precompiled headers etc. Also chrome is C++.