This is the mail archive of the
mailing list for the binutils project.
Re: [gold][PATCH] PR gold/18321: gold doesn't support SHF_COMPRESSED sections
- From: Cary Coutant <ccoutant at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 1 Jun 2015 15:13:55 -0700
- Subject: Re: [gold][PATCH] PR gold/18321: gold doesn't support SHF_COMPRESSED sections
- Authentication-results: sourceware.org; auth=none
- References: <20150424145913 dot GA388 at intel dot com> <CAJimCsGU9-L0MhvLU2SLG4r=io78wK-QLpiDcojrqtOgxkgD7g at mail dot gmail dot com> <CAMe9rOr8+cG3b8t43i+BRR-FqFuQEXM6k43XA8x+SwHzwT-RYw at mail dot gmail dot com>
+ if (decompress_if_needed
+ && (is_compressed
+ || need_decompressed_section(name)))
This is going to decompress all SHF_COMPRESSED sections; the
point of this test is to put off any decompression except for
sections whose contents we'll need during Add_sections tasks.
(See the comments for need_decompressed_sections.) I think you
should leave this test as it was, and go fix
need_decompressed_section() to deal with sections whose names
don't begin with ".z".
+ Compressed_section_map* compressed_sections =
+ build_compressed_section_map<size, big_endian>(
this->shnum(), names, sd->section_names_size, this, true);
This line is indented way too far. Should be:
Compressed_section_map* compressed_sections =
pshdrs, this->shnum(), names, sd->section_names_size, this, true);
+ Relobj *relobj = static_cast<Relobj*>(this);
This is a dangerous cast. I'd prefer to promote the elfsize() and
is_big_endian() methods to the Object class, and provide
implementations of do_elfsize() and do_is_big_endian() in
Sized_dynobj and Sized_pluginobj.