This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] [gold] Do not attempt to merge sections with an entsize of 0.
- From: Cary Coutant <ccoutant at google dot com>
- To: Peter Collingbourne <pcc at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 2 Mar 2015 10:21:48 -0800
- Subject: Re: [PATCH] [gold] Do not attempt to merge sections with an entsize of 0.
- Authentication-results: sourceware.org; auth=none
- References: <1423080595-2173-1-git-send-email-pcc at google dot com> <CAHACq4p1m9YrbvyGShEA5msYpf_zTWLOxtYb_4j+DWTPPUuNUQ at mail dot gmail dot com>
>> 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.
I've committed the following patch.
-cary
2015-02-04 Peter Collingbourne <pcc@google.com>
Cary Coutant <ccoutant@google.com>
* output.cc (Output_section::add_merge_input_section): Do not
attempt to merge sections with an entsize of 0.
diff --git a/gold/output.cc b/gold/output.cc
index e9dd522..01838cc 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -2636,6 +2636,10 @@ Output_section::add_merge_input_section(Relobj*
object, unsigned int shndx,
uint64_t addralign,
bool keeps_input_sections)
{
+ // We cannot merge sections with entsize == 0.
+ if (entsize == 0)
+ return false;
+
bool is_string = (flags & elfcpp::SHF_STRINGS) != 0;
// We cannot restore merged input section states.