1 Star 0 Fork 6

邓雨雨01/mingw-binutils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
binutils_24267.patch 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
zhiyi 提交于 2020-10-08 17:29 . Initial version
diff -rupN --no-dereference binutils-2.32/bfd/coffgen.c binutils-2.32-new/bfd/coffgen.c
--- binutils-2.32/bfd/coffgen.c 2019-11-19 20:47:08.571628378 +0100
+++ binutils-2.32-new/bfd/coffgen.c 2019-11-19 20:47:17.460680520 +0100
@@ -2639,6 +2639,9 @@ _bfd_coff_section_already_linked (bfd *a
struct bfd_section_already_linked_hash_entry *already_linked_list;
struct coff_comdat_info *s_comdat;
+ if (sec->output_section == bfd_abs_section_ptr)
+ return FALSE;
+
flags = sec->flags;
if ((flags & SEC_LINK_ONCE) == 0)
return FALSE;
diff -rupN --no-dereference binutils-2.32/bfd/cofflink.c binutils-2.32-new/bfd/cofflink.c
--- binutils-2.32/bfd/cofflink.c 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/cofflink.c 2019-11-19 20:47:17.460680520 +0100
@@ -310,7 +310,9 @@ coff_link_add_symbols (bfd *abfd,
case COFF_SYMBOL_GLOBAL:
flags = BSF_EXPORT | BSF_GLOBAL;
section = coff_section_from_bfd_index (abfd, sym.n_scnum);
- if (! obj_pe (abfd))
+ if (discarded_section (section))
+ section = bfd_und_section_ptr;
+ else if (! obj_pe (abfd))
value -= section->vma;
break;
@@ -327,6 +329,8 @@ coff_link_add_symbols (bfd *abfd,
case COFF_SYMBOL_PE_SECTION:
flags = BSF_SECTION_SYM | BSF_GLOBAL;
section = coff_section_from_bfd_index (abfd, sym.n_scnum);
+ if (discarded_section (section))
+ section = bfd_und_section_ptr;
break;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/deng-yuyu-01/mingw-binutils.git
[email protected]:deng-yuyu-01/mingw-binutils.git
deng-yuyu-01
mingw-binutils
mingw-binutils
master

搜索帮助