Fix build for ARM targets 51/155951/1 accepted/tizen/4.0/unified/20171017.212538 submit/tizen_4.0/20171017.050132
authorDmitry Kovalenko <d.kovalenko@samsung.com>
Mon, 16 Oct 2017 13:58:56 +0000 (16:58 +0300)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Mon, 16 Oct 2017 13:58:56 +0000 (16:58 +0300)
Change-Id: I8412bf8be7ebd648feb0683ea0aa2c8c99bdf491
Signed-off-by: Dmitry Kovalenko <d.kovalenko@samsung.com>
arch/arm/probes/tramps_arm.h
arch/arm/probes/tramps_arm_img.c [deleted file]
arch/arm/probes/tramps_thumb.h
arch/arm/probes/tramps_thumb_img.c [deleted file]
kprobe/Kbuild
uprobe/Kbuild

index 27f0a35bbaf28ecc21dd40aaccec1bd062bbfb44..0fc5d72c933acfa52ea67c96b2a264bed98fbfde 100644 (file)
 #include <linux/types.h>
 
 
-extern u32 gen_insn_execbuf[];
-extern u32 pc_dep_insn_execbuf[];
-extern u32 b_r_insn_execbuf[];
-extern u32 b_cond_insn_execbuf[];
-extern u32 blx_off_insn_execbuf[];
+/*
+ * These arrays generated from tramps_arm.c
+ * using 32 bit compiler:
+ *   $ gcc tramps_arm.c -c -o tramps_arm.o
+ *   $ objdump -d tramps_arm.o
+ */
+
+static u32 __attribute__((unused)) gen_insn_execbuf[] = {
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe59ff004,     //   ldr        pc, [pc, #4]
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+};
+
+static u32 __attribute__((unused)) pc_dep_insn_execbuf[] = {
+       0xe50d0004,     //   str        r0, [sp, #-4]
+       0xe59f000c,     //   ldr        r0, [pc, #12]
+       0xe320f000,     //   nop
+       0xe51d0004,     //   ldr        r0, [sp, #-4]
+       0xe59ff004,     //   ldr        pc, [pc, #4]
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+};
+
+static u32 __attribute__((unused)) b_r_insn_execbuf[] = {
+       0xe320f000,     //   nop
+       0xe59ff010,     //   ldr        pc, [pc, #16]
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+};
+
+static u32 __attribute__((unused)) b_cond_insn_execbuf[] = {
+       0x0a000000,     //   beq        68 <condway>
+       0xe59ff010,     //   ldr        pc, [pc, #16]
+       0xe59ff008,     //   ldr        pc, [pc, #8]
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+};
+
+static u32 __attribute__((unused)) blx_off_insn_execbuf[] = {
+       0x059fe010,     //   ldreq      lr, [pc, #16]
+       0x012fff3e,     //   blxeq      lr
+       0xe59ff00c,     //   ldr        pc, [pc, #12]
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+       0xe320f000,     //   nop
+};
 
 
 #endif /* _SWAP_ASM_TRAMPS_ARM_H */
diff --git a/arch/arm/probes/tramps_arm_img.c b/arch/arm/probes/tramps_arm_img.c
deleted file mode 100644 (file)
index 22f4fac..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Copyright (C) Samsung Electronics, 2016
- *
- * 2016         Vyacheslav Cherkashin <v.cherkashin@samsung.com>
- *
- */
-
-
-#include "tramps_arm.h"
-
-
-/*
- * These arrays generated from tramps_arm.c
- * using 32 bit compiler:
- *   $ gcc tramps_arm.c -c -o tramps_arm.o
- *   $ objdump -d tramps_arm.o
- */
-
-u32 gen_insn_execbuf[] = {
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe59ff004,     //   ldr        pc, [pc, #4]
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-};
-
-u32 pc_dep_insn_execbuf[] = {
-       0xe50d0004,     //   str        r0, [sp, #-4]
-       0xe59f000c,     //   ldr        r0, [pc, #12]
-       0xe320f000,     //   nop
-       0xe51d0004,     //   ldr        r0, [sp, #-4]
-       0xe59ff004,     //   ldr        pc, [pc, #4]
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-};
-
-u32 b_r_insn_execbuf[] = {
-       0xe320f000,     //   nop
-       0xe59ff010,     //   ldr        pc, [pc, #16]
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-};
-
-u32 b_cond_insn_execbuf[] = {
-       0x0a000000,     //   beq        68 <condway>
-       0xe59ff010,     //   ldr        pc, [pc, #16]
-       0xe59ff008,     //   ldr        pc, [pc, #8]
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-};
-
-u32 blx_off_insn_execbuf[] = {
-       0x059fe010,     //   ldreq      lr, [pc, #16]
-       0x012fff3e,     //   blxeq      lr
-       0xe59ff00c,     //   ldr        pc, [pc, #12]
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-       0xe320f000,     //   nop
-};
index 45245304db2623b89739dfc8e8528fb0f598984b..eb34275844580429f677bfe42b5f17d124e3a2a8 100644 (file)
 #include <linux/types.h>
 
 
-extern u16 gen_insn_execbuf_thumb[];
-extern u16 pc_dep_insn_execbuf_thumb[];
-extern u16 b_r_insn_execbuf_thumb[];
-extern u16 b_off_insn_execbuf_thumb[];
-extern u16 b_cond_insn_execbuf_thumb[];
-extern u16 cbz_insn_execbuf_thumb[];
+/*
+ * These arrays generated from tramps_thumb.c
+ * using 32 bit compiler:
+ *   $ gcc tramps_thumb.c -c -o tramps_thumb.o
+ *   $ objdump -d tramps_thumb.o
+ */
+
+static u16 __attribute__((unused)) gen_insn_execbuf_thumb[] = {
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xb082,         //   sub        sp, #8
+       0x9000,         //   str        r0, [sp, #0]
+       0x4803,         //   ldr        r0, [pc, #12]
+       0x9001,         //   str        r0, [sp, #4]
+       0xbf00,         //   nop
+       0xbd01,         //   pop        {r0, pc}
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+};
+
+static u16 __attribute__((unused)) pc_dep_insn_execbuf_thumb[] = {
+       0xb4c0,         //   push       {r6, r7}
+       0x4e06,         //   ldr        r6, [pc, #24]
+       0x466f,         //   mov        r7, sp
+       0x46b5,         //   mov        sp, r6
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0x46bd,         //   mov        sp, r7
+       0xbcc0,         //   pop        {r6, r7}
+       0xb403,         //   push       {r0, r1}
+       0x4803,         //   ldr        r0, [pc, #12]
+       0xbf00,         //   nop
+       0x9001,         //   str        r0, [sp, #4]
+       0xbd01,         //   pop        {r0, pc}
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+};
+
+static u16 __attribute__((unused)) b_r_insn_execbuf_thumb[] = {
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xb403,         //   push       {r0, r1}
+       0x4804,         //   ldr        r0, [pc, #16]
+       0xbf00,         //   nop
+       0x9001,         //   str        r0, [sp, #4]
+       0xbd01,         //   pop        {r0, pc}
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+};
+
+static u16 __attribute__((unused)) b_off_insn_execbuf_thumb[] = {
+       0xb403,         //   push       {r0, r1}
+       0x4806,         //   ldr        r0, [pc, #24]
+       0x9001,         //   str        r0, [sp, #4]
+       0xbd01,         //   pop        {r0, pc}
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xb403,         //   push       {r0, r1}
+       0x4804,         //   ldr        r0, [pc, #16]
+       0xbf00,         //   nop
+       0x9001,         //   str        r0, [sp, #4]
+       0xbd01,         //   pop        {r0, pc}
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+};
+
+static u16 __attribute__((unused)) b_cond_insn_execbuf_thumb[] = {
+       0xf000, 0x8005, //   beq.w      ce <condway>
+       0xb403,         //   push       {r0, r1}
+       0x4807,         //   ldr        r0, [pc, #28]
+       0xbf00,         //   nop
+       0x9001,         //   str        r0, [sp, #4]
+       0xbd01,         //   pop        {r0, pc}
+       0xb403,         //   push       {r0, r1}
+       0xf8df, 0x000c, //   ldr.w      r0, [pc, #12]
+       0x9001,         //   str        r0, [sp, #4]
+       0xbd01,         //   pop        {r0, pc}
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+};
+
+static u16 __attribute__((unused)) cbz_insn_execbuf_thumb[] = {
+       0xbf00,         //   nop
+       0xb403,         //   push       {r0, r1}
+       0x4806,         //   ldr        r0, [pc, #24]
+       0xbf00,         //   nop
+       0x9001,         //   str        r0, [sp, #4]
+       0xbd01,         //   pop        {r0, pc}
+       0xb403,         //   push       {r0, r1}
+       0x4803,         //   ldr        r0, [pc, #12]
+       0x9001,         //   str        r0, [sp, #4]
+       0xbd01,         //   pop        {r0, pc}
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+       0xbf00,         //   nop
+};
 
 
 #endif /* _SWAP_ASM_TRAMPS_THUMB_H */
diff --git a/arch/arm/probes/tramps_thumb_img.c b/arch/arm/probes/tramps_thumb_img.c
deleted file mode 100644 (file)
index 27fe7e8..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- * @author Alexey Gerenkov <a.gerenkov@samsung.com> User-Space Probes initial
- * implementation; Support x86/ARM/MIPS for both user and kernel spaces.
- * @author Ekaterina Gorelkina <e.gorelkina@samsung.com>: redesign module for
- * separating core and arch parts
- *
- * @section LICENSE
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * @section COPYRIGHT
- *
- * Copyright (C) Samsung Electronics, 2006-2016
- *
- */
-
-
-#include "tramps_thumb.h"
-
-
-/*
- * These arrays generated from tramps_thumb.c
- * using 32 bit compiler:
- *   $ gcc tramps_thumb.c -c -o tramps_thumb.o
- *   $ objdump -d tramps_thumb.o
- */
-
-u16 gen_insn_execbuf_thumb[] = {
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xb082,         //   sub        sp, #8
-       0x9000,         //   str        r0, [sp, #0]
-       0x4803,         //   ldr        r0, [pc, #12]
-       0x9001,         //   str        r0, [sp, #4]
-       0xbf00,         //   nop
-       0xbd01,         //   pop        {r0, pc}
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-};
-
-u16 pc_dep_insn_execbuf_thumb[] = {
-       0xb4c0,         //   push       {r6, r7}
-       0x4e06,         //   ldr        r6, [pc, #24]
-       0x466f,         //   mov        r7, sp
-       0x46b5,         //   mov        sp, r6
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0x46bd,         //   mov        sp, r7
-       0xbcc0,         //   pop        {r6, r7}
-       0xb403,         //   push       {r0, r1}
-       0x4803,         //   ldr        r0, [pc, #12]
-       0xbf00,         //   nop
-       0x9001,         //   str        r0, [sp, #4]
-       0xbd01,         //   pop        {r0, pc}
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-};
-
-u16 b_r_insn_execbuf_thumb[] = {
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xb403,         //   push       {r0, r1}
-       0x4804,         //   ldr        r0, [pc, #16]
-       0xbf00,         //   nop
-       0x9001,         //   str        r0, [sp, #4]
-       0xbd01,         //   pop        {r0, pc}
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-};
-
-u16 b_off_insn_execbuf_thumb[] = {
-       0xb403,         //   push       {r0, r1}
-       0x4806,         //   ldr        r0, [pc, #24]
-       0x9001,         //   str        r0, [sp, #4]
-       0xbd01,         //   pop        {r0, pc}
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xb403,         //   push       {r0, r1}
-       0x4804,         //   ldr        r0, [pc, #16]
-       0xbf00,         //   nop
-       0x9001,         //   str        r0, [sp, #4]
-       0xbd01,         //   pop        {r0, pc}
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-};
-
-u16 b_cond_insn_execbuf_thumb[] = {
-       0xf000, 0x8005, //   beq.w      ce <condway>
-       0xb403,         //   push       {r0, r1}
-       0x4807,         //   ldr        r0, [pc, #28]
-       0xbf00,         //   nop
-       0x9001,         //   str        r0, [sp, #4]
-       0xbd01,         //   pop        {r0, pc}
-       0xb403,         //   push       {r0, r1}
-       0xf8df, 0x000c, //   ldr.w      r0, [pc, #12]
-       0x9001,         //   str        r0, [sp, #4]
-       0xbd01,         //   pop        {r0, pc}
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-};
-
-u16 cbz_insn_execbuf_thumb[] = {
-       0xbf00,         //   nop
-       0xb403,         //   push       {r0, r1}
-       0x4806,         //   ldr        r0, [pc, #24]
-       0xbf00,         //   nop
-       0x9001,         //   str        r0, [sp, #4]
-       0xbd01,         //   pop        {r0, pc}
-       0xb403,         //   push       {r0, r1}
-       0x4803,         //   ldr        r0, [pc, #12]
-       0x9001,         //   str        r0, [sp, #4]
-       0xbd01,         //   pop        {r0, pc}
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-       0xbf00,         //   nop
-};
index adc6caca15c47cd0f8635c3fee71999287995729..e6d12ca7d1ddd50d1c7ad831bdf839c8a2a9d4f7 100644 (file)
@@ -25,8 +25,7 @@ swap_kprobe-y += swap_kprobes.o
 ### ARM
 swap_kprobe-$(CONFIG_ARM) += \
        arch/arm/swap-asm/swap_kprobes.o \
-       ../arch/arm/probes/probes_arm.o \
-       ../arch/arm/probes/tramps_arm_img.o
+       ../arch/arm/probes/probes_arm.o
 
 ifeq ($(CONFIG_STRICT_MEMORY_RWX), y)
 swap_kprobe-$(CONFIG_ARM) += arch/arm/swap-asm/memory_rwx.o
index 94f0b7e279d5ae91eefaddadd9022620c57a97dc..ad4d051c69a81f936be50510e1c0b0fa8dc5a623 100644 (file)
@@ -9,7 +9,6 @@ swap_uprobe-$(CONFIG_ARM) += \
        arch/arm/swap-asm/swap_uprobes.o \
        ../arch/arm/probes/probes_thumb.o \
        ../arch/arm/probes/decode_thumb.o \
-       ../arch/arm/probes/tramps_thumb_img.o \
        ../arch/arm/probes/probes.o \
        ../arch/arm/uprobe/swap_uprobe.o
 
@@ -19,10 +18,8 @@ swap_uprobe-$(CONFIG_ARM64) += \
        arch/arm64/swap-asm/swap_uprobes.o \
        arch/arm64/swap-asm/uprobes-arm64.o \
        ../arch/arm/probes/probes_arm.o \
-       ../arch/arm/probes/tramps_arm_img.o \
        ../arch/arm/probes/decode_thumb.o \
        ../arch/arm/probes/probes_thumb.o \
-       ../arch/arm/probes/tramps_thumb_img.o \
        ../arch/arm/probes/probes.o \
        ../arch/arm/uprobe/swap_uprobe.o