This is the mail archive of the binutils@sources.redhat.com 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: x86-64 large data sections updated


> On Wed, Jun 15, 2005 at 03:34:58PM -0400, Ian Lance Taylor wrote:
> > Richard Henderson <rth@redhat.com> writes:
> > 
> > > > OK, so dropping here the lcommon test sounds sane?
> > > 
> > > The entire function is not sane.  The .largecomm assembler directive
> > > should set the section to SHN_X86_64_LARGE_COMMON, and that should be
> > > the end of it.  Once COMMON symbols get mapped into .lcommon/.lbss
> > > sections, they don't return.
> > 
> > There is no interface for gas to set the ELF section of a symbol,
> > except to set the symbol of the BFD symbol to some BFD section.  So
> > unless we introduce such an interface, the only way to do this is to
> > use a magic BFD section, which then gets translated into the
> > appropriate ELF section code.  That is how the MIPS backend handles
> > SHN_MIPS_SCOMMON--gas puts the symbol in ".scommon" and
> > _bfd_mips_elf_section_from_bfd_section translates ".scommon" into
> > SHN_MIPS_SCOMMON.  That seems to be what Jan is emulating in his code.
> 
> Do you have a MIPS assembly example to put a symbol in
> SHN_MIPS_SCOMMON?

Hi,
I am sort of suck here and I would like to make progress as it would be
nice to have the GCC patch ready before it comes into stage3 in half of
July.
There seems to be two major problems I don't know how to cope with yet:

1) I am unsure how to get page alignment only when .lrosegment is
non-zero.  I tried to play around with SIZEOF operator but I am not sure
if I can apply SIZEOF to the alignment before .lrodata that might (in
theory) change size of .lrodata due to alignments.

2) I am completely such with the SHN issue.  I've dicussed this with
Ian on IRC and he quite convinced me that the code I copied is the way
this is done currently in the frontend due to missing interface to do it
more cleanly.  I tried to follow both m32r and mips backends and both go
via this mechanizm:  Create fake scommon/sbss sections in gas, arrange
common symbols that whould end up with SHN_something into those sections
and have elf_section_from_bfd_section hook later assigning them proper
SHN.  So the scommon section never gets out of gas even tought it is
created intermidately.

I also tried to follow way currently TLS storage is done.  The situation
here is just slightly different - the symbols get different STT  this
time set by generic code in elf.c based on BFD section flag set by GAS
and there is special code in elflink.c that knows to place these in
special section...

Does someone happen to have any helpful toughts about these two issues?

Thanks,
Honza
> 
> 
> H.J.


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