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: PATCH: Multiple sections with same name don't work


Hi H.J.

> 2004-05-01  H.J. Lu  <hongjiu.lu@intel.com>
> 
> 	* subsegs.c (section_symbol): Create a new section symbol if
> 	the existing one doesn't match.
> 
> 	* symbols.c (symbol_set_bfdsym): Don't reset BFD section
> 	symbol.

Approved and applied.

I also generated and applied a patch to add a testcase for this patch,
although I now see that you have posted a separate patch to do this.
Sorry for missing that.

I also took the opportunity to update the gas documentation for the
.section pseudo op to include the G and T flags.  The patch is
attached and this is the ChangeLog entry:

gas/ChangeLog
2004-05-11  Nick Clifton  <nickc@redhat.com>

	* doc/as.texinfo (Section): Document G and T flags to .section
	directive.  Document the extra arguments that the G flag
	requires.  Document the #tls flag.


Cheers
  Nick

Index: as.texinfo
===================================================================
RCS file: /cvs/src/src/gas/doc/as.texinfo,v
retrieving revision 1.99
retrieving revision 1.100
diff -c -3 -p -r1.99 -r1.100
*** as.texinfo	23 Apr 2004 04:50:53 -0000	1.99
--- as.texinfo	11 May 2004 15:53:47 -0000	1.100
*************** This is one of the ELF section stack man
*** 5211,5217 ****
  For ELF targets, the @code{.section} directive is used like this:
  
  @smallexample
! .section @var{name} [, "@var{flags}"[, @@@var{type}[, @@@var{entsize}]]]
  @end smallexample
  
  The optional @var{flags} argument is a quoted string which may contain any
--- 5211,5217 ----
  For ELF targets, the @code{.section} directive is used like this:
  
  @smallexample
! .section @var{name} [, "@var{flags}"[, @@@var{type}[,@var{flag_specific_arguments}]]
  @end smallexample
  
  The optional @var{flags} argument is a quoted string which may contain any
*************** section is executable
*** 5227,5232 ****
--- 5227,5236 ----
  section is mergeable
  @item S
  section contains zero terminated strings
+ @item G
+ section is a member of a section group
+ @item T
+ section is used for thread-local-storage
  @end table
  
  The optional @var{type} argument may contain one of the following constants:
*************** The optional @var{type} argument may con
*** 5235,5252 ****
  section contains data
  @item @@nobits
  section does not contain data (i.e., section only occupies space)
  @end table
  
  Note on targets where the @code{@@} character is the start of a comment (eg
  ARM) then another character is used instead.  For example the ARM port uses the
  @code{%} character.
  
! If @var{flags} contains @code{M} flag, @var{type} argument must be specified
! as well as @var{entsize} argument. Sections with @code{M} flag but not
! @code{S} flag must contain fixed size constants, each @var{entsize} octets
! long. Sections with both @code{M} and @code{S} must contain zero terminated
! strings where each character is @var{entsize} bytes long. The linker may remove
! duplicates within sections with the same name, same entity size and same flags. 
  
  If no flags are specified, the default flags depend upon the section name.  If
  the section name is not recognized, the default will be for the section to have
--- 5239,5288 ----
  section contains data
  @item @@nobits
  section does not contain data (i.e., section only occupies space)
+ @item @@note
+ section contains data which is used by things other than the program
  @end table
  
  Note on targets where the @code{@@} character is the start of a comment (eg
  ARM) then another character is used instead.  For example the ARM port uses the
  @code{%} character.
  
! If @var{flags} contains the @code{M} symbol then the @var{type} argument must
! be specified as well as an extra argument - @var{entsize} - like this:
! 
! @smallexample
! .section @var{name} , "@var{flags}"M, @@@var{type}, @var{entsize}
! @end smallexample
! 
! Sections with the @code{M} flag but not @code{S} flag must contain fixed size
! constants, each @var{entsize} octets long. Sections with both @code{M} and
! @code{S} must contain zero terminated strings where each character is
! @var{entsize} bytes long. The linker may remove duplicates within sections with
! the same name, same entity size and same flags.  @var{entsize} must be an
! absolute expression.
! 
! If @var{flags} contains the @code{G} symbol then the @var{type} argument must
! be present along with an additional field like this:
! 
! @smallexample
! .section @var{name} , "@var{flags}"G, @@@var{type}, @var{GroupName}[, @var{linkage}]
! @end smallexample
! 
! The @var{GroupName} field specifies the name of the section group to which this
! particular section belongs.  The optional linkage field can contain:
! @table @code
! @item comdat
! indicates that only one copy of this section should be retained
! @item .gnu.linkonce
! an alias for comdat
! @end table
! 
! Note - if both the @var{M} and @var{G} flags are present then the fields for
! the Merge flag should come first, like this:
! 
! @smallexample
! .section @var{name} , "@var{flags}"MG, @@@var{type}, @var{entsize}, @var{GroupName}[, @var{linkage}]
! @end smallexample
  
  If no flags are specified, the default flags depend upon the section name.  If
  the section name is not recognized, the default will be for the section to have
*************** section is allocatable
*** 5269,5274 ****
--- 5305,5312 ----
  section is writable
  @item #execinstr
  section is executable
+ @item #tls
+ section is used for thread local storage
  @end table
  
  This directive replaces the current section and subsection.  The replaced

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