aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-07-28 14:49:07 +0930
committerAlan Modra <amodra@gmail.com>2020-07-28 16:56:14 +0930
commit67411cbf63a0e841ac6801bf59c854fed8b8dd80 (patch)
treebe0ab703152c22ed7f341aa5520aece81bc155ae /bfd/elflink.c
parentf437dadd89944254165d076f55f29f7290c00aed (diff)
downloadbinutils-67411cbf63a0e841ac6801bf59c854fed8b8dd80.zip
binutils-67411cbf63a0e841ac6801bf59c854fed8b8dd80.tar.gz
binutils-67411cbf63a0e841ac6801bf59c854fed8b8dd80.tar.bz2
PR25022 testcase segfault for generic ELF linker targets
Even a testcase that is expected to fail shouldn't segfault. * elf.c (assign_section_numbers): Comment. Don't segfault on discarded sections when setting linked-to section for generic ELF linker. * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 286fc11..a3823e6 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -8179,7 +8179,7 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2,
if (isymbuf1 == NULL)
goto done;
- if (!info->reduce_memory_overheads)
+ if (info != NULL && !info->reduce_memory_overheads)
{
ssymbuf1 = elf_create_symbuf (symcount1, isymbuf1);
elf_tdata (bfd1)->symbuf = ssymbuf1;
@@ -8193,7 +8193,7 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2,
if (isymbuf2 == NULL)
goto done;
- if (ssymbuf1 != NULL && !info->reduce_memory_overheads)
+ if (ssymbuf1 != NULL && info != NULL && !info->reduce_memory_overheads)
{
ssymbuf2 = elf_create_symbuf (symcount2, isymbuf2);
elf_tdata (bfd2)->symbuf = ssymbuf2;