1 Star 0 Fork 98

yu_boyun/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0107-Don-t-attempt-to-export-the-start-and-_start-symbols.patch 1.65 KB
一键复制 编辑 原始数据 按行查看 历史
hanzj0122_admin 提交于 2020-07-29 20:47 . update to 2.04
From c6522389c9a795007a54aedeb10f8c3afd9dab24 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <[email protected]>
Date: Sat, 12 May 2018 11:29:07 +0200
Subject: [PATCH 107/220] Don't attempt to export the start and _start symbols
for grub-emu
Commit 318ee04aadc ("make better backtraces") reworked the backtrace logic
but the changes lead to the following build error on the grub-emu platform:
grub_emu_lite-symlist.o:(.data+0xf08): undefined reference to `start'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:25959: grub-emu-lite] Error 1
make[3]: *** Waiting for unfinished jobs....
cat kernel_syms.input | grep -v '^#' | sed -n \
-e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/defined kernel '""'\1/;p;}' \
-e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/defined kernel '""'\1/;p;}' \
| sort -u >kernel_syms.lst
The problem is that start and _start symbols are exported unconditionally,
but these aren't defined for grub-emu since is an emultaed platform so it
doesn't have a startup logic. Don't attempt to export those for grub-emu.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
include/grub/kernel.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/grub/kernel.h b/include/grub/kernel.h
index e5a5f43..de48cd4 100644
--- a/include/grub/kernel.h
+++ b/include/grub/kernel.h
@@ -110,8 +110,10 @@ grub_addr_t grub_modules_get_end (void);
#endif
+#if !defined(GRUB_MACHINE_EMU)
void EXPORT_FUNC(start) (void);
void EXPORT_FUNC(_start) (void);
+#endif
/* The start point of the C code. */
void grub_main (void) __attribute__ ((noreturn));
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yu_boyun/grub2.git
[email protected]:yu_boyun/grub2.git
yu_boyun
grub2
grub2
master

搜索帮助