1 Star 0 Fork 25

mgb01105731/binutils_1

forked from src-anolis-os/binutils 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
binutils-plugin-as-needed-correct.patch 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
Zhao Hang 提交于 2022-04-12 16:35 . update to binutils-2.30-113.el8.src.rpm
--- binutils.orig/bfd/elf-bfd.h 2021-09-20 16:06:58.320914954 +0100
+++ binutils-2.30/bfd/elf-bfd.h 2021-09-20 16:26:11.307770371 +0100
@@ -180,6 +180,8 @@ struct elf_link_hash_entry
/* Symbol has a non-weak reference from a non-shared object (other than
the object in which it is defined). */
unsigned int ref_regular_nonweak : 1;
+ /* Symbol has a non-weak reference from a LTO IR object file. */
+ unsigned int ref_ir_nonweak : 1;
/* Dynamic symbol has been adjustd. */
unsigned int dynamic_adjusted : 1;
/* Symbol needs a copy reloc. */
--- binutils.orig/bfd/elflink.c 2021-09-29 14:36:01.294185139 +0100
+++ binutils-2.30/bfd/elflink.c 2021-09-29 14:39:08.113874485 +0100
@@ -4663,7 +4663,12 @@ error_free_dyn:
/* Plugin symbols aren't normal. Don't set def/ref flags. */
if ((abfd->flags & BFD_PLUGIN) != 0)
- ;
+ {
+ /* Except for this flag to track nonweak references. */
+ if (!definition
+ && bind != STB_WEAK)
+ h->ref_ir_nonweak = 1;
+ }
else if (!dynamic)
{
if (! definition)
@@ -4906,11 +4911,13 @@ error_free_dyn:
if (!add_needed
&& matched
&& definition
+ && h->root.type != bfd_link_hash_indirect
&& ((dynsym
&& h->ref_regular_nonweak)
|| (old_bfd != NULL
&& (old_bfd->flags & BFD_PLUGIN) != 0
- && bind != STB_WEAK)
+ && h->ref_ir_nonweak
+ && !info->lto_all_symbols_read)
|| (h->ref_dynamic_nonweak
&& (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0
&& !on_needed_list (elf_dt_name (abfd),
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mgb01105731/binutils_1.git
git@gitee.com:mgb01105731/binutils_1.git
mgb01105731
binutils_1
binutils_1
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385