awk support scripts to generate trampolines in modules.
(adapted from previous LKM method). <machine/asm.h> now has a KMODTRAMPOLINE macro to generate the trampoline
This commit is contained in:
parent
f3344e2765
commit
1e205987d1
5
sys/modules/arch/arm/kmodhide.awk
Normal file
5
sys/modules/arch/arm/kmodhide.awk
Normal file
@ -0,0 +1,5 @@
|
||||
# $NetBSD: kmodhide.awk,v 1.1 2013/08/07 17:06:22 matt Exp $
|
||||
|
||||
substr($NF, 1, 7) == "__wrap_" {
|
||||
print " --localize-symbol "$NF;
|
||||
}
|
18
sys/modules/arch/arm/kmodtramp.awk
Normal file
18
sys/modules/arch/arm/kmodtramp.awk
Normal file
@ -0,0 +1,18 @@
|
||||
# $NetBSD: kmodtramp.awk,v 1.1 2013/08/07 17:06:22 matt Exp $
|
||||
#
|
||||
BEGIN {
|
||||
print "#include <machine/asm.h>"
|
||||
}
|
||||
|
||||
$2 == "R_ARM_PC24" || $2 == "R_ARM_CALL" || $2 == "R_ARM_JUMP24" {
|
||||
if (x[$3] != "")
|
||||
next;
|
||||
if (index($3, ".text") > 0)
|
||||
next;
|
||||
fn=$3
|
||||
sub("__wrap_", "", fn)
|
||||
if (fn == $3)
|
||||
next;
|
||||
print "KMODTRAMPOLINE("fn")"
|
||||
x[$3]=".";
|
||||
}
|
10
sys/modules/arch/arm/kmodwrap.awk
Normal file
10
sys/modules/arch/arm/kmodwrap.awk
Normal file
@ -0,0 +1,10 @@
|
||||
# $NetBSD: kmodwrap.awk,v 1.1 2013/08/07 17:06:22 matt Exp $
|
||||
|
||||
$2 == "R_ARM_PC24" || $2 == "R_ARM_CALL" || $2 == "R_ARM_JUMP24" {
|
||||
if (x[$3] != "")
|
||||
next;
|
||||
if (index($3, ".text") > 0)
|
||||
next
|
||||
printf " --wrap="$3;
|
||||
x[$3]=".";
|
||||
}
|
Loading…
Reference in New Issue
Block a user