This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] PR ld/21884: Check ELF section header only for ELF output
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org, Nick Clifton <nickc at redhat dot com>
- Date: Wed, 2 Aug 2017 22:24:18 +0930
- Subject: Re: [PATCH] PR ld/21884: Check ELF section header only for ELF output
- Authentication-results: sourceware.org; auth=none
- References: <20170802115351.GA29044@gmail.com>
On Wed, Aug 02, 2017 at 04:53:51AM -0700, H.J. Lu wrote:
> --- a/ld/emultempl/elf32.em
> +++ b/ld/emultempl/elf32.em
> @@ -2136,7 +2136,8 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
> }
>
> /* Look through the script to see where to place this section. */
> - if (constraint == 0)
> + if (constraint == 0
> + && link_info.output_bfd->xvec->flavour == bfd_target_elf_flavour)
> for (os = lang_output_section_find (secname);
> os != NULL;
> os = next_matching_output_section_statement (os, 0))
This doesn't look to be the right place to me. I think the loop
should run but the ELF specific tests be omitted when either input or
output is non-ELF.
Also, there is a similar problem with the .mbind code just a little
earlier.
--
Alan Modra
Australia Development Lab, IBM