This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Speed up AR for ELF
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 2 May 2005 11:41:55 +0930
- Subject: Re: PATCH: Speed up AR for ELF
- References: <20050430193655.GA17821@lucon.org>
On Sat, Apr 30, 2005 at 12:36:55PM -0700, H. J. Lu wrote:
> * elf.c (_bfd_elf_new_section_hook): Don't call
> _bfd_elf_get_sec_type_attr on sections from input files.
What happens for linker created sections?
> --- bfd/elf.c.speed 2005-04-29 23:30:28.000000000 -0700
> +++ bfd/elf.c 2005-04-30 10:23:02.000000000 -0700
> @@ -2251,12 +2251,18 @@ _bfd_elf_new_section_hook (bfd *abfd, as
> sec->used_by_bfd = sdata;
> }
>
> - elf_section_type (sec) = SHT_NULL;
> - ssect = _bfd_elf_get_sec_type_attr (abfd, sec->name);
> - if (ssect != NULL)
> - {
> - elf_section_type (sec) = ssect->type;
> - elf_section_flags (sec) = ssect->attr;
> + /* When we read a file, we don't need to section type and flags.
grammar.
> + They will be overridden in _bfd_elf_make_section_from_shdr
> + anyway. */
> + if (abfd->direction != read_direction)
> + {
> + elf_section_type (sec) = SHT_NULL;
The above line isn't needed.
> + ssect = _bfd_elf_get_sec_type_attr (abfd, sec->name);
> + if (ssect != NULL)
> + {
> + elf_section_type (sec) = ssect->type;
> + elf_section_flags (sec) = ssect->attr;
> + }
> }
>
> /* Indicate whether or not this section should use RELA relocations. */
--
Alan Modra
IBM OzLabs - Linux Technology Centre