title: Linux Kernel Module (*.ko) compatibility between kernels
body: <p>I have a simple kernel object that I built for probing around at kernel memory.</p>
  
  <p>If I build it on my 64-bit Ubuntu (3.2) machine it works fine on that machine.  But it won't insmod on my 64-bit Ubuntu (3.9) machine.  And vice versa.  It gives me a "-1 Invalid module format" error if I try to run it on a Kernel rev other than the one I'd built it on.</p>
  
  <p>I thought insmod linked it dynamically against the exported symbol table and the exported symbol table does not change between kernel revisions.  (It gets appended.)</p>
  
  <p>Can someone tell me how I can build a kernel module (.ko) that is compatible with future (or past) Linux kernels without having to be rebuilt on that kernel?</p>
  
  <p>Here's my make file:</p>
  
  <p>ccflags-y = -g</p>
  
  <p>obj-m += access_mem.o</p>
  
  <p>all:
      make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules</p>
  
  <p>clean:
      make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean</p>