How to use Linker script in kernel module

Hi,
I am new to FreeBSD and FreeBSD kernel programming and facing some issue in context to linker script.
Requesting for your inputs/pointers on the following :
I have done changes in ldscript.i386 for adding a new lookup "set" and I am able to read/get the set data successfully inside kernel using function linker_file_lookup_set. But I am unable to use the above logic for kernel module and after investigation found that the "sets" are not added for the kernel module. I feel that the ldscript.i386 is not getting used while linking the kernel module hence the above call returns that no sets are found.

I tried adding the below in kernel module's Makefile :
Code:
LDFLAGS+= -T @/conf/ldscript.${MACHINE_ARCH}
But it gives me compilation error as follow:
Code:
Warning: Object directory not changed from original /usr/home/hrishi/hellow
ld  -T/usr/src/sys/conf/ldscript.i386 -d -warn-common -r -d -o hello.kld hello.o
/usr/src/sys/conf/ldscript.i386:136 invalid assignment to location counter
*** Error code 1

Thanks & Regards,
Hrishikesh Gokhale
 
Back
Top