[PATCH] [gold] Do not attempt to merge sections with an entsize of 0.
Peter Collingbourne
pcc@google.com
Thu Feb 19 00:36:00 GMT 2015
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
>
More information about the Binutils
mailing list