diff --git a/sys/modules/arch/arm/kmodhide.awk b/sys/modules/arch/arm/kmodhide.awk new file mode 100644 index 000000000000..f7adc1235d23 --- /dev/null +++ b/sys/modules/arch/arm/kmodhide.awk @@ -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; +} diff --git a/sys/modules/arch/arm/kmodtramp.awk b/sys/modules/arch/arm/kmodtramp.awk new file mode 100644 index 000000000000..2c2261bb4e41 --- /dev/null +++ b/sys/modules/arch/arm/kmodtramp.awk @@ -0,0 +1,18 @@ +# $NetBSD: kmodtramp.awk,v 1.1 2013/08/07 17:06:22 matt Exp $ +# +BEGIN { + print "#include " +} + +$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]="."; +} diff --git a/sys/modules/arch/arm/kmodwrap.awk b/sys/modules/arch/arm/kmodwrap.awk new file mode 100644 index 000000000000..5ba12ed855d8 --- /dev/null +++ b/sys/modules/arch/arm/kmodwrap.awk @@ -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]="."; +}