This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] [gold] Do not attempt to merge sections with an entsize of 0.
- From: Peter Collingbourne <pcc at google dot com>
- To: binutils at sourceware dot org
- Cc: Peter Collingbourne <pcc at google dot com>
- Date: Wed, 4 Feb 2015 12:09:55 -0800
- Subject: [PATCH] [gold] Do not attempt to merge sections with an entsize of 0.
- Authentication-results: sourceware.org; auth=none
It seems to be invalid for a section to have the SHF_MERGE flag set and an
entsize of 0, but we should cope with this gracefully instead of crashing.
2015-02-04 Peter Collingbourne <pcc@google.com>
* merge.cc (Output_merge_data::do_add_input_section): Do not attempt to
merge sections with an entsize of 0.
---
gold/merge.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gold/merge.cc b/gold/merge.cc
index 269e6bf..450fd62 100644
--- a/gold/merge.cc
+++ b/gold/merge.cc
@@ -412,7 +412,7 @@ Output_merge_data::do_add_input_section(Relobj* object, unsigned int shndx)
section_size_type entsize = convert_to_section_size_type(this->entsize());
- if (len % entsize != 0)
+ if (entsize == 0 || len % entsize != 0)
{
if (is_new)
delete[] p;
--
2.2.0.rc0.207.ga3a616c