This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Store ELF section index for input file
On Thu, Mar 17, 2005 at 12:58:27PM -0800, H. J. Lu wrote:
> @@ -4823,9 +4830,16 @@ _bfd_elf_section_from_bfd_section (bfd *
> const struct elf_backend_data *bed;
> int index;
>
> - if (elf_section_data (asect) != NULL
> - && elf_section_data (asect)->this_idx != 0)
> - return elf_section_data (asect)->this_idx;
> + if (elf_section_data (asect) != NULL)
> + {
> + index = elf_section_data (asect)->this_idx;
> + if (index != 0)
> + {
> + Elf_Internal_Shdr **i_shdrp = elf_elfsections (abfd);
> + if (!i_shdrp || i_shdrp [index]->bfd_section == asect)
> + return index;
> + }
> + }
Please explain why this change is necessary.
--
Alan Modra
IBM OzLabs - Linux Technology Centre