代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libcareplus 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From eaff972f8edd58491eeca17f4b7553cceb1fb5d4 Mon Sep 17 00:00:00 2001
From: Jiajie Li <lijiajie11@huawei.com>
Date: Mon, 12 Oct 2020 13:53:01 +0800
Subject: [PATCH 29/89] kpatch_parse: Split function is_data_def
The function is_data_def is arch related, so let's make two
separate definations in arch/x86/arch_parse.c and arch/aarch64/arch_parse.c
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
---
src/arch/aarch64/arch_parse.c | 64 +++++++++++++++++++++++++++++++++++
src/arch/x86/arch_parse.c | 34 +++++++++++++++++++
src/kpatch_parse.c | 33 ------------------
3 files changed, 98 insertions(+), 33 deletions(-)
diff --git a/src/arch/aarch64/arch_parse.c b/src/arch/aarch64/arch_parse.c
index abbc38c..fea09f6 100644
--- a/src/arch/aarch64/arch_parse.c
+++ b/src/arch/aarch64/arch_parse.c
@@ -4,6 +4,70 @@
#include "include/kpatch_parse.h"
#include "include/kpatch_flags.h"
+int is_data_def(char *s, int type)
+{
+ kpstr_t t;
+
+ get_token(&s, &t);
+ if (
+ /* strings */
+ !kpstrcmpz(&t, ".ascii") ||
+ !kpstrcmpz(&t, ".asciz") ||
+ !kpstrcmpz(&t, ".string") ||
+ !kpstrcmpz(&t, ".string8") ||
+ !kpstrcmpz(&t, ".string16") ||
+ !kpstrcmpz(&t, ".string32") ||
+ !kpstrcmpz(&t, ".string64") ||
+ /* numeric */
+ !kpstrcmpz(&t, ".byte") ||
+ !kpstrcmpz(&t, ".1byte") ||
+ !kpstrcmpz(&t, ".dc.b") ||
+
+ !kpstrcmpz(&t, ".hword") ||
+ !kpstrcmpz(&t, ".short") ||
+ !kpstrcmpz(&t, ".2byte") ||
+ !kpstrcmpz(&t, ".dc") ||
+ !kpstrcmpz(&t, ".dc.w") ||
+ !kpstrcmpz(&t, ".value") ||
+ !kpstrcmpz(&t, ".octa") ||
+
+ !kpstrcmpz(&t, ".word") ||
+ !kpstrcmpz(&t, ".4byte") ||
+ !kpstrcmpz(&t, ".long") ||
+ !kpstrcmpz(&t, ".int") ||
+ !kpstrcmpz(&t, ".dc.l") ||
+ !kpstrcmpz(&t, ".dc.a") ||// (AArch32 only)
+
+ !kpstrcmpz(&t, ".quad") ||
+ !kpstrcmpz(&t, ".8byte") ||
+ !kpstrcmpz(&t, ".xword") ||//(AArch64 only)
+ !kpstrcmpz(&t, ".dc.a") ||//(AArch64 only)
+
+ !kpstrcmpz(&t, ".short") ||
+ !kpstrcmpz(&t, ".int") ||
+ !kpstrcmpz(&t, ".long") ||
+ !kpstrcmpz(&t, ".quad") ||
+ /* float */
+ !kpstrcmpz(&t, ".double") ||
+ !kpstrcmpz(&t, ".dc.d") ||
+ !kpstrcmpz(&t, ".float") ||
+ !kpstrcmpz(&t, ".single") ||
+ !kpstrcmpz(&t, ".dc.s") ||
+ /* other */
+ !kpstrcmpz(&t, ".value") ||
+ !kpstrcmpz(&t, ".comm") ||
+ !kpstrcmpz(&t, ".zero") ||
+ !kpstrcmpz(&t, ".fill") ||
+ !kpstrcmpz(&t, ".space") ||
+ !kpstrcmpz(&t, ".skip") ||
+ /* dwarf types */
+ !kpstrcmpz(&t, ".uleb128") ||
+ !kpstrcmpz(&t, ".sleb128")
+ )
+ return 1;
+ return 0;
+}
+
int is_variable_start(struct kp_file *f, int l, int *e, int *pglobl, kpstr_t *nm)
{
char *s;
diff --git a/src/arch/x86/arch_parse.c b/src/arch/x86/arch_parse.c
index ca57507..81edaf8 100644
--- a/src/arch/x86/arch_parse.c
+++ b/src/arch/x86/arch_parse.c
@@ -4,6 +4,40 @@
#include "include/kpatch_parse.h"
#include "include/kpatch_flags.h"
+int is_data_def(char *s, int type)
+{
+ kpstr_t t;
+
+ get_token(&s, &t);
+ if (
+ /* strings */
+ !kpstrcmpz(&t, ".ascii") ||
+ !kpstrcmpz(&t, ".asciz") ||
+ !kpstrcmpz(&t, ".string") ||
+ /* numeric */
+ !kpstrcmpz(&t, ".byte") ||
+ !kpstrcmpz(&t, ".word") ||
+ !kpstrcmpz(&t, ".short") ||
+ !kpstrcmpz(&t, ".int") ||
+ !kpstrcmpz(&t, ".long") ||
+ !kpstrcmpz(&t, ".quad") ||
+ /* float */
+ !kpstrcmpz(&t, ".double") ||
+ !kpstrcmpz(&t, ".float") ||
+ !kpstrcmpz(&t, ".single") ||
+ /* other */
+ !kpstrcmpz(&t, ".value") ||
+ !kpstrcmpz(&t, ".comm") ||
+ !kpstrcmpz(&t, ".zero") ||
+ /* dwarf types */
+ !kpstrcmpz(&t, ".uleb128") ||
+ !kpstrcmpz(&t, ".sleb128") ||
+ !kpstrcmpz(&t, ".4byte")
+ )
+ return 1;
+ return 0;
+}
+
int is_variable_start(struct kp_file *f, int l, int *e, int *pglobl, kpstr_t *nm)
{
char *s;
diff --git a/src/kpatch_parse.c b/src/kpatch_parse.c
index a3be7c0..f486b55 100644
--- a/src/kpatch_parse.c
+++ b/src/kpatch_parse.c
@@ -674,37 +674,4 @@ int is_function_end(struct kp_file *f, int l, kpstr_t *nm)
return 1;
}
-int is_data_def(char *s, int type)
-{
- kpstr_t t;
-
- get_token(&s, &t);
- if (
- /* strings */
- !kpstrcmpz(&t, ".ascii") ||
- !kpstrcmpz(&t, ".asciz") ||
- !kpstrcmpz(&t, ".string") ||
- /* numeric */
- !kpstrcmpz(&t, ".byte") ||
- !kpstrcmpz(&t, ".word") ||
- !kpstrcmpz(&t, ".short") ||
- !kpstrcmpz(&t, ".int") ||
- !kpstrcmpz(&t, ".long") ||
- !kpstrcmpz(&t, ".quad") ||
- /* float */
- !kpstrcmpz(&t, ".double") ||
- !kpstrcmpz(&t, ".float") ||
- !kpstrcmpz(&t, ".single") ||
- /* other */
- !kpstrcmpz(&t, ".value") ||
- !kpstrcmpz(&t, ".comm") ||
- !kpstrcmpz(&t, ".zero") ||
- /* dwarf types */
- !kpstrcmpz(&t, ".uleb128") ||
- !kpstrcmpz(&t, ".sleb128") ||
- !kpstrcmpz(&t, ".4byte")
- )
- return 1;
- return 0;
-}
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。