1 Star 0 Fork 25

hanshuang/binutils

forked from src-anolis-os/binutils 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
binutils-CVE-2021-20284.patch 2.74 KB
一键复制 编辑 原始数据 按行查看 历史
Renbo 提交于 2021-11-29 15:14 . update to binutils-2.30-108.el8_5.1
diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.30/bfd/elf-bfd.h
--- binutils.orig/bfd/elf-bfd.h 2021-05-19 15:05:30.988901261 +0100
+++ binutils-2.30/bfd/elf-bfd.h 2021-05-19 15:05:55.477815716 +0100
@@ -1487,7 +1487,7 @@ struct elf_backend_data
bfd_boolean (*init_secondary_reloc_section) (bfd *, Elf_Internal_Shdr *, const char *, unsigned int);
/* Called when after loading the normal relocs for a section. */
- bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **);
+ bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **, bfd_boolean);
/* Called after writing the normal relocs for a section. */
bfd_boolean (*write_secondary_relocs) (bfd *, asection *);
@@ -2721,7 +2721,7 @@ extern bfd_vma elf32_r_sym (bfd_vma);
extern bfd_boolean _bfd_elf_init_secondary_reloc_section
(bfd *, Elf_Internal_Shdr *, const char *, unsigned int);
extern bfd_boolean _bfd_elf_slurp_secondary_reloc_section
- (bfd *, asection *, asymbol **);
+(bfd *, asection *, asymbol **, bfd_boolean);
extern bfd_boolean _bfd_elf_copy_special_section_fields
(const bfd *, bfd *, const Elf_Internal_Shdr *, Elf_Internal_Shdr *);
extern bfd_boolean _bfd_elf_write_secondary_reloc_section
Only in binutils-2.30/bfd: elf-bfd.h.orig
diff -rup binutils.orig/bfd/elf.c binutils-2.30/bfd/elf.c
--- binutils.orig/bfd/elf.c 2021-05-19 15:05:30.989901257 +0100
+++ binutils-2.30/bfd/elf.c 2021-05-19 15:05:55.478815712 +0100
@@ -11663,7 +11663,8 @@ _bfd_elf_init_secondary_reloc_section (b
bfd_boolean
_bfd_elf_slurp_secondary_reloc_section (bfd * abfd,
asection * sec,
- asymbol ** symbols)
+ asymbol ** symbols,
+ bfd_boolean dynamic)
{
const struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
asection * relsec;
@@ -11728,7 +11729,10 @@ _bfd_elf_slurp_secondary_reloc_section (
continue;
}
- symcount = bfd_get_symcount (abfd);
+ if (dynamic)
+ symcount = bfd_get_dynamic_symcount (abfd);
+ else
+ symcount = bfd_get_symcount (abfd);
for (i = 0, internal_reloc = internal_relocs, native_reloc = native_relocs;
i < reloc_count;
Only in binutils-2.30/bfd: elf.c.orig
diff -rup binutils.orig/bfd/elfcode.h binutils-2.30/bfd/elfcode.h
--- binutils.orig/bfd/elfcode.h 2021-05-19 15:05:30.990901254 +0100
+++ binutils-2.30/bfd/elfcode.h 2021-05-19 15:07:34.098471218 +0100
@@ -1577,7 +1577,7 @@ elf_slurp_reloc_table (bfd *abfd,
return FALSE;
if (bed->slurp_secondary_relocs != NULL
- && ! bed->slurp_secondary_relocs (abfd, asect, symbols))
+ && ! bed->slurp_secondary_relocs (abfd, asect, symbols, dynamic))
return FALSE;
asect->relocation = relents;
Only in binutils-2.30/bfd: elfcode.h.orig
Only in binutils-2.30/bfd: elfcode.h.rej
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hanshuang123456/binutils.git
git@gitee.com:hanshuang123456/binutils.git
hanshuang123456
binutils
binutils
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385