This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: _bfd_elf_init_private_section_data setting output section type improperly for .stabstr

"H. J. Lu" <> writes:

> --- bfd/elf.c.stabs	2006-05-11 08:52:56.000000000 -0700
> +++ bfd/elf.c	2006-05-11 09:26:36.000000000 -0700
> @@ -5911,8 +5911,7 @@ _bfd_elf_init_private_section_data (bfd 
>       output BFD section flags has been set to something different.
>       elf_fake_sections will set ELF section type based on BFD
>       section flags.  */
> -  if (osec->flags == isec->flags
> -      || (osec->flags == 0 && elf_section_type (osec) == SHT_NULL))
> +  if (osec->flags == isec->flags || !osec->flags)
>      elf_section_type (osec) = elf_section_type (isec);

This code does not make sense to me.  It assumes that a zero in the
flags field means that the section flags have not been initialized.
Why is that correct?

And, you seem to have ignored Nick's comments about this code here:

I think it is reasonable to want to make --set-section-flags work for
ELF.  But I think that to do that we need to clearly separate the
value that the flags hold from whether the flags hold any value at
all.  Your patch seems to me to be quite fragile, and I'm not
surprised that something broke.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]