This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: LD patch to silence warnings about removed sections
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Richard Sandiford <rsandifo at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 8 Jun 2002 11:49:40 +0930
- Subject: Re: LD patch to silence warnings about removed sections
- References: <wvnptz3vwu3.fsf@talisman.cambridge.redhat.com>
On Fri, Jun 07, 2002 at 06:10:28PM +0100, Richard Sandiford wrote:
> I'm not sure what the best fix is. The patch below makes
> lang_size_sections_1 skip sections that we've already removed,
> but it seems a bit hackish. I couldn't find a way of checking
> for removed sections directly (is there one?) so I made
> _bfd_strip_section_from_output set the SEC_EXCLUDE flag in
> output sections too.
I don't think there is a test you can use for output sections.
> + /* The section might have been removed after its statement was
> + added. For example, ldemul_before_allocation can remove
> + dynamic sections if they turn out not to be needed. */
> + if ((bfd_get_section_flags (output_bfd, os->bfd_section)
> + & SEC_EXCLUDE) != 0)
> + break;
> +
Hmm, this will break "ld -r". eg. for objects containing ELF
SHT_GROUP sections, and probably other cases. Please test
!link_info.relocateable too. OK with that change.
--
Alan Modra
IBM OzLabs - Linux Technology Centre