This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Fix .tbss handling
On Fri, Jul 26, 2002 at 02:02:01AM -0400, Jakub Jelinek wrote:
> On Fri, Jul 26, 2002 at 09:50:40AM +0930, Alan Modra wrote:
> > On Thu, Jul 25, 2002 at 06:26:50PM +0200, Jakub Jelinek wrote:
> > > --- ld/ldlang.c.jj Thu Jul 18 11:38:46 2002
> > > +++ ld/ldlang.c Thu Jul 18 23:42:51 2002
> > > @@ -3055,7 +3055,8 @@ lang_size_sections_1 (s, output_section_
> > > if (bfd_is_abs_section (os->bfd_section))
> > > ASSERT (after == os->bfd_section->vma);
> > > else if ((os->bfd_section->flags & SEC_HAS_CONTENTS) == 0
> > > - && (os->bfd_section->flags & SEC_THREAD_LOCAL))
> > > + && (os->bfd_section->flags & SEC_THREAD_LOCAL)
> > > + && ! link_info.relocateable)
> > > os->bfd_section->_raw_size = 0;
> > > else
> > > os->bfd_section->_raw_size =
> >
> > Dumb question. Why is it necessary to zero _raw_size here? If you
> > managed to set correct sizes here, then you wouldn't need hacks
> > elsewhere, eg. assign_file_positions_for_segments, and the new one
> > in elf_fake_sections.
>
> It simplifies the layout routines etc., because .tbss for layout
> routines really has zero size, but unlike NOBITS that zero size is
> for the p_vaddr/p_paddr too (in addition to p_offset).
> The only place where is the real .tbss size needed
> is the final section table and PT_TLS segment size computation.
The patch is OK then.
--
Alan Modra
IBM OzLabs - Linux Technology Centre