title: Linkage problems when adding S file to Linux kernel
body: <p>After a previous question got answered: <a href="https://stackoverflow.com/questions/4226233/adding-a-s-file-to-the-linux-kernel-code">Adding a .S file to the linux kernel code</a> I was able to add a .S file to the Linux kernel make files.
  However, my .S file includes several sections that replace functions that were written in C.
  I commented out these functions, and declared the replacement functions as globals, but when I try to link the kernel (using make) I get the following error:</p>
  
  <pre><code>arch/x86/kernel/vmlinux.lds:XXX: non constant or forward reference address expression for section .YYY
  </code></pre>
  
  <p>The original functions that I replaced were declared using:
  <code>__attribute__ ((unused, __section__("YYY"))) notrace</code></p>
  
  <p>The asm sections are declared using:</p>
  
  <pre><code>.text
  .globl YYY
  </code></pre>
  
  <p>I also tried adding:</p>
  
  <pre><code>.type YYY,@function
  </code></pre>
  
  <p>I probably missed some declaration somewhere, but I'm not sure where to look.</p>
  
  <p>Any ideas?</p>