title: Linux kernel debugging warning: No Symbol table is loaded
body: <p>I have been trying to learn Linux kernel debugging and created a sample module with some export symbols.</p>
  
  <p><code>int rday_3 = 30;
  EXPORT_SYMBOL(rday_3);</code></p>
  
  <p>after doing insmod, I am able to see dmesg of my init module and command <code>cat /proc/kallsyms</code> gives me the symbol loaded. But when i run the command <code>gdb /boot/vmlinuz-3.5.0-23-generic /proc/kcore</code>, it gives a warning </p>
  
  <blockquote>
    <p>Reading symbols from /boot/vmlinuz-3.5.0-23-generic...(no debugging symbols found)...done.</p>
    
    <p>warning: core file may not match specified executable file.
    [New process 1]
    Core was generated by `BOOT_IMAGE=/boot/vmlinuz-3.5.0-23-generic root=UUID=FE4E68E74E689A63 loop=/ubunt'.</p>
    
    <h1>0  0x00000000 in ?? ()</h1>
    
    <p>(gdb) whatis rday_3</p>
    
    <p>No symbol table is loaded.  Use the "file" command.</p>
  </blockquote>
  
  <p>Then i added debug flags in my Makefile generated .ko file in debug mode. And i added the command <code>add-symbol-file hello_driver.ko 0x00</code>. The i got the result as </p>
  
  <blockquote>
    <p>(gdb) whatis rday_3</p>
    
    <p>type = int</p>
    
    <p>(gdb) p rday_3</p>
    
    <p>Cannot access memory at address 0x0</p>
  </blockquote>
  
  <p>Can anyone help me out with whats going wrong and what more i need to add?</p>