<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EmbLogic &#187; Sumit Gemini</title>
	<atom:link href="https://www.emblogic.com/blog/author/sumit-e2/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Seeing Dubugging symbols which are added by gcc using -g option</title>
		<link>https://www.emblogic.com/blog/12/seeing-dubugging-symbols-which-are-added-by-gcc-using-g-option/</link>
		<comments>https://www.emblogic.com/blog/12/seeing-dubugging-symbols-which-are-added-by-gcc-using-g-option/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 08:30:31 +0000</pubDate>
		<dc:creator><![CDATA[Sumit Gemini]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://emblogic.org/blog/?p=270</guid>
		<description><![CDATA[A Debugging Symbol Table maps instructions in the compiled binary program to their corresponding variable, function, or line in the source code. This mapping could be something like: Program instruction =&#62; item name, item type, original file, line number defined. &#8230; <a href="https://www.emblogic.com/blog/12/seeing-dubugging-symbols-which-are-added-by-gcc-using-g-option/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A Debugging Symbol Table maps instructions in the compiled binary program to their corresponding variable, function, or line in the source code. This mapping could be something like:</p>
<ul>
<li>Program instruction =&gt; item name, item type, original file, line number defined.</li>
</ul>
<p>Symbol tables may be embedded into the program, or stored as a separate file. So if you plan to debug your program then it is required to create Symbol table which will have required information to debug the program.</p>
<p>We can infer a few facts about symbol tables:</p>
<ul>
<li>A symbol table works for a particular version of the program –if the program changes, a new table must be made.</li>
<li>Debug builds are often larger and slower than retail (non-debug) builds; debug builds contain the symbol table and other ancillary information.</li>
<li>If you wish to debug a binary program you did not compile yourself, you must get the symbol tables from the author.</li>
</ul>
<p>First when you write your c, c++ program your symbol table shows as :-</p>
<p>gcc -c hello1 hello.c</p>
<p>objdump -t hello.o  //  objdump command analysis object file and -t is a option to show symbol table.</p>
<p>hello.o:     file format elf32-i386</p>
<p>SYMBOL TABLE:<br />
00000000 l    df *ABS*    00000000 hello.c<br />
00000000 l    d  .text    00000000 .text<br />
00000000 l    d  .data    00000000 .data<br />
00000000 l    d  .bss    00000000 .bss<br />
00000000 l    d  .rodata    00000000 .rodata<br />
00000000 l    d  .note.GNU-stack    00000000 .note.GNU-stack<br />
00000000 l    d  .comment    00000000 .comment<br />
00000000 g     F .text    00000054 main<br />
00000000         *UND*    00000000 printf</p>
<p>When you add -g option for de bugging in you program like:-</p>
<p>gcc -g -c hello hello.c</p>
<p>symbol table looks as :-</p>
<p>objdump -t hello.o</p>
<p>hello.o:     file format elf32-i386</p>
<p>SYMBOL TABLE:<br />
00000000 l    df *ABS*    00000000 hello.c<br />
00000000 l    d  .text    00000000 .text<br />
00000000 l    d  .data    00000000 .data<br />
00000000 l    d  .bss    00000000 .bss<br />
00000000 l    d  .debug_abbrev    00000000 .debug_abbrev<br />
00000000 l    d  .debug_info    00000000 .debug_info<br />
00000000 l    d  .debug_line    00000000 .debug_line<br />
00000000 l    d  .rodata    00000000 .rodata<br />
00000000 l    d  .debug_frame    00000000 .debug_frame<br />
00000000 l    d  .debug_loc    00000000 .debug_loc<br />
00000000 l    d  .debug_pubnames    00000000 .debug_pubnames<br />
00000000 l    d  .debug_aranges    00000000 .debug_aranges<br />
00000000 l    d  .debug_str    00000000 .debug_str<br />
00000000 l    d  .note.GNU-stack    00000000 .note.GNU-stack<br />
00000000 l    d  .comment    00000000 .comment<br />
00000000 g     F .text    00000054 main<br />
00000000         *UND*    00000000 printf</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/12/seeing-dubugging-symbols-which-are-added-by-gcc-using-g-option/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
