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: Peter Collingbourne <pcc at google dot com>
- To: binutils at sourceware dot org
- Cc: Peter Collingbourne <pcc at google dot com>
- Date: Wed, 18 Feb 2015 16:36:31 -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>
Ping.
On Wed, Feb 4, 2015 at 12:09 PM, Peter Collingbourne <pcc@google.com> wrote:
> 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
>