代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libcareplus 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 3ecebe9ea858d5502af5f5cd79141e4546ae3fe8 Mon Sep 17 00:00:00 2001
From: Jiajie Li <lijiajie11@huawei.com>
Date: Mon, 12 Oct 2020 13:58:58 +0800
Subject: [PATCH 30/89] kpatch_parse: Split function is_function_start
The function is_function_start is arch related, so make two
separate definations in arch/x86/arch_parse.c and arch/aarch64/arch_parse.c
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
Signed-off-by: Ying Fang <fangying1@huawei.com>
---
src/arch/aarch64/arch_parse.c | 32 ++++++++++++++++++++++++++++++++
src/arch/x86/arch_parse.c | 32 ++++++++++++++++++++++++++++++++
src/kpatch_parse.c | 33 ---------------------------------
3 files changed, 64 insertions(+), 33 deletions(-)
diff --git a/src/arch/aarch64/arch_parse.c b/src/arch/aarch64/arch_parse.c
index fea09f6..e0f0c8b 100644
--- a/src/arch/aarch64/arch_parse.c
+++ b/src/arch/aarch64/arch_parse.c
@@ -4,6 +4,38 @@
#include "include/kpatch_parse.h"
#include "include/kpatch_flags.h"
+int is_function_start(struct kp_file *f, int l, kpstr_t *nm)
+{
+ char *s;
+ kpstr_t nm2, attr;
+ int l0 = l, func = 0;
+
+ kpstrset(nm, "", 0);
+ for (; l < f->nr_lines; l++) {
+ if (l != l0 && cline(f, l)[0] == '\0')
+ continue;
+ if ((is_sect_cmd(f, l) && is_code_sect(csect(f, l))) ||
+ ctype(f, l) == DIRECTIVE_ALIGN)
+ continue;
+ get_type_args(cline(f, l), &nm2, &attr);
+ if ((ctype(f, l) == DIRECTIVE_WEAK && l0 != l) ||
+ ctype(f, l) == DIRECTIVE_GLOBL || ctype(f, l) == DIRECTIVE_HIDDEN ||
+ ctype(f, l) == DIRECTIVE_PROTECTED || ctype(f, l) == DIRECTIVE_INTERNAL ||
+ (ctype(f, l) == DIRECTIVE_TYPE && !kpstrcmpz(&attr, "%function"))) {
+ s = cline(f, l);
+ get_token(&s, &nm2); /* skip command */
+ get_token(&s, &nm2);
+ if (nm->l && kpstrcmp(nm, &nm2)) /* verify name matches in all .weak/.globl/.type commands */
+ return 0;
+ *nm = nm2;
+ func = func ? 1 : ctype(f, l) == DIRECTIVE_TYPE;
+ continue;
+ }
+ break;
+ }
+ return func;
+}
+
int is_data_def(char *s, int type)
{
kpstr_t t;
diff --git a/src/arch/x86/arch_parse.c b/src/arch/x86/arch_parse.c
index 81edaf8..c51c49b 100644
--- a/src/arch/x86/arch_parse.c
+++ b/src/arch/x86/arch_parse.c
@@ -4,6 +4,38 @@
#include "include/kpatch_parse.h"
#include "include/kpatch_flags.h"
+int is_function_start(struct kp_file *f, int l, kpstr_t *nm)
+{
+ char *s;
+ kpstr_t nm2, attr;
+ int l0 = l, func = 0;
+
+ kpstrset(nm, "", 0);
+ for (; l < f->nr_lines; l++) {
+ if (l != l0 && cline(f, l)[0] == '\0')
+ continue;
+ if ((is_sect_cmd(f, l) && is_code_sect(csect(f, l))) ||
+ ctype(f, l) == DIRECTIVE_ALIGN)
+ continue;
+ get_type_args(cline(f, l), &nm2, &attr);
+ if ((ctype(f, l) == DIRECTIVE_WEAK && l0 != l) ||
+ ctype(f, l) == DIRECTIVE_GLOBL || ctype(f, l) == DIRECTIVE_HIDDEN ||
+ ctype(f, l) == DIRECTIVE_PROTECTED || ctype(f, l) == DIRECTIVE_INTERNAL ||
+ (ctype(f, l) == DIRECTIVE_TYPE && !kpstrcmpz(&attr, "@function"))) {
+ s = cline(f, l);
+ get_token(&s, &nm2); /* skip command */
+ get_token(&s, &nm2);
+ if (nm->l && kpstrcmp(nm, &nm2)) /* verify name matches in all .weak/.globl/.type commands */
+ return 0;
+ *nm = nm2;
+ func = func ? 1 : ctype(f, l) == DIRECTIVE_TYPE;
+ continue;
+ }
+ break;
+ }
+ return func;
+}
+
int is_data_def(char *s, int type)
{
kpstr_t t;
diff --git a/src/kpatch_parse.c b/src/kpatch_parse.c
index f486b55..3df658d 100644
--- a/src/kpatch_parse.c
+++ b/src/kpatch_parse.c
@@ -625,39 +625,6 @@ void init_sections(struct kp_file *f)
}
/* ----------------------------------------- code block boundaries detection ---------------------------------------- */
-
-int is_function_start(struct kp_file *f, int l, kpstr_t *nm)
-{
- char *s;
- kpstr_t nm2, attr;
- int l0 = l, func = 0;
-
- kpstrset(nm, "", 0);
- for (; l < f->nr_lines; l++) {
- if (l != l0 && cline(f, l)[0] == '\0')
- continue;
- if ((is_sect_cmd(f, l) && is_code_sect(csect(f, l))) ||
- ctype(f, l) == DIRECTIVE_ALIGN)
- continue;
- get_type_args(cline(f, l), &nm2, &attr);
- if ((ctype(f, l) == DIRECTIVE_WEAK && l0 != l) ||
- ctype(f, l) == DIRECTIVE_GLOBL || ctype(f, l) == DIRECTIVE_HIDDEN ||
- ctype(f, l) == DIRECTIVE_PROTECTED || ctype(f, l) == DIRECTIVE_INTERNAL ||
- (ctype(f, l) == DIRECTIVE_TYPE && !kpstrcmpz(&attr, "@function"))) {
- s = cline(f, l);
- get_token(&s, &nm2); /* skip command */
- get_token(&s, &nm2);
- if (nm->l && kpstrcmp(nm, &nm2)) /* verify name matches in all .weak/.globl/.type commands */
- return 0;
- *nm = nm2;
- func = func ? 1 : ctype(f, l) == DIRECTIVE_TYPE;
- continue;
- }
- break;
- }
- return func;
-}
-
int is_function_end(struct kp_file *f, int l, kpstr_t *nm)
{
/* Functions should always end by .size directive. Previously used to detect .LFe labels, but they are not generated w/o frame pointers */
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。