mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
asm: make all text section labels .L local
To help with backtraces if we ever fix them due to the lkmc_asm_main_after_prologue debacle.
This commit is contained in:
@@ -6,14 +6,14 @@
|
||||
data_label:
|
||||
.word 0x1234678
|
||||
LKMC_PROLOGUE
|
||||
adr r4, label
|
||||
adr r4, .Llabel
|
||||
/* objdump tells us that this uses the literal pool,
|
||||
* it does not get converted to adr, which is the better
|
||||
* alternative here.
|
||||
*/
|
||||
ldr r5, =label
|
||||
adrl r6, label
|
||||
label:
|
||||
ldr r5, =.Llabel
|
||||
adrl r6, .Llabel
|
||||
.Llabel:
|
||||
LKMC_ASSERT_EQ_REG(r4, r5)
|
||||
LKMC_ASSERT_EQ_REG(r4, r6)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <lkmc.h>
|
||||
LKMC_PROLOGUE
|
||||
/* Jump over the fail. 26-bit PC-relative. */
|
||||
b ok
|
||||
b .Lok
|
||||
LKMC_ASSERT_FAIL
|
||||
ok:
|
||||
.Lok:
|
||||
LKMC_EPILOGUE
|
||||
|
||||
@@ -48,7 +48,6 @@ LKMC_PROLOGUE
|
||||
10:
|
||||
|
||||
/* Another example with mov reading from pc. */
|
||||
pc_addr:
|
||||
mov r0, pc
|
||||
/* Why sub 8:
|
||||
* https://stackoverflow.com/questions/24091566/why-does-the-arm-pc-register-point-to-the-instruction-after-the-next-one-to-be-e
|
||||
|
||||
@@ -46,8 +46,8 @@ LKMC_PROLOGUE
|
||||
* This construct is not possible in ARMv8 for str:
|
||||
* https://github.com/cirosantilli/linux-kernel-module-cheat#armv8-aarch64-str-instruction
|
||||
*/
|
||||
str r1, var_in_same_section
|
||||
var_in_same_section:
|
||||
str r1, .Lvar_in_same_section
|
||||
.Lvar_in_same_section:
|
||||
#endif
|
||||
|
||||
/* = sign just doesn't make sense for str, you can't set the
|
||||
|
||||
Reference in New Issue
Block a user