After answering the previous question: Adding a .S file to linux kernel code I was able to add a .S file to Linux kernel files. However, my .S file contains several sections that replace functions written in C. I commented on these functions and declared the replacement functions as global, but when I try to bind the kernel (using make), I get the following error:
arch/x86/kernel/vmlinux.lds:XXX: non constant or forward reference address expression for section .YYY
The original functions that I replaced were declared using:
__attribute__ ((unused, __section__("YYY"))) notrace
Asm sections are declared using:
.text
.globl YYY
I also tried adding:
.type YYY,@function
I might have missed an ad somewhere, but I'm not sure where to look.
Any ideas?
source
share