x86-64 large data sections updated

Jan Hubicka jh@suse.cz
Thu Jun 16 10:34:00 GMT 2005


> 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?

I didn't try it but it should be via ordinary .comm keyword and -G
set higher than it's size.  There is generic code in gas that arrange
things into scommon in such case and mips backend then trick in the
SHN_MIPS_SCOMMON.

Honza
> 
> 
> H.J.



More information about the Binutils mailing list