This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: Mark a section to be discarded for DSO and executable
- From: Ian Lance Taylor <iant at google dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: gcc at gcc dot gnu dot org, binutils at sources dot redhat dot com, generic-abi at googlegroups dot com
- Date: 09 Jan 2007 10:09:35 -0800
- Subject: Re: RFC: Mark a section to be discarded for DSO and executable
- References: <20070109175152.GA31785@lucon.org>
"H. J. Lu" <hjl@lucon.org> writes:
> With LTO, an object file may contain sections with IL, which
> can be discarded when building DSO and executable. Currently we can't
> mark such sections with gABI. With GNU linker, we can use a
> linker script to discard such sections. But it will be more generic
> to make a section to be discarded for DSO and executable in gABI.
> In that case, we don't need a special linker script to discard
> such sections. Something like
>
> #define SHF_DISCARD 0x800
>
> would work.
That is not strictly required for LTO as I see it. With LTO, the lto
program is going to read the .o files with the IL information. It
will then generate a new .s file to pass to the assembler. The IL
information will never go through the linker.
Of course, it is also possible that LTO .o files with IL information
will be passed directly to the linker, for whatever reason. In that
case, we may want the linker to remove the IL information. This is
not substantially different from the linker's current ability to strip
debugging information on request.
So if you want to propose a solution for that, I think you should
consider how it can be used for debugging information as well. And I
don't think SHF_DISCARD is a good name. We don't want to arbitrarily
discard the data, we want to discard it in certain specific scenarios.
Ian