aboutsummaryrefslogtreecommitdiff
path: root/gas/doc
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@acm.org>2006-08-25 00:08:55 +0000
committerBob Wilson <bob.wilson@acm.org>2006-08-25 00:08:55 +0000
commit74869ac7a4dcde1530155889456cbaa37f87b60c (patch)
tree32cc691da7fb5deb179c941ac93ec9c1455a0052 /gas/doc
parentca0ef6cdf077270a80c887eafe8a41806a6bd8ad (diff)
downloadgdb-74869ac7a4dcde1530155889456cbaa37f87b60c.zip
gdb-74869ac7a4dcde1530155889456cbaa37f87b60c.tar.gz
gdb-74869ac7a4dcde1530155889456cbaa37f87b60c.tar.bz2
bfd/
* elf32-xtensa.c (xtensa_get_property_section_name): Delete. (xtensa_get_property_section): New. (xtensa_read_table_entries): Use xtensa_get_property_section. (relax_property_section, xtensa_get_property_predef_flags): Handle group name suffixes in property section names. (match_section_group): New. gas/ * config/tc-xtensa.c (FINI_LITERAL_SECTION_NAME): Delete. (INIT_LITERAL_SECTION_NAME): Delete. (lit_state struct): Remove segment names, init_lit_seg, and fini_lit_seg. Add lit_prefix and current_text_seg. (init_literal_head_h, init_literal_head): Delete. (fini_literal_head_h, fini_literal_head): Delete. (xtensa_begin_directive): Move argument parsing to xtensa_literal_prefix function. (xtensa_end_directive): Deallocate lit_prefix field of lit_state. (xtensa_literal_prefix): Parse the directive argument here and record it in the lit_prefix field. Remove code to derive literal section names. (linkonce_len): New. (get_is_linkonce_section): Use linkonce_len. Check for any ".gnu.linkonce.*" section, not just text sections. (md_begin): Remove initialization of deleted lit_state fields. (xtensa_reorder_segments, xtensa_post_relax_hook): Remove references to init_literal_head and fini_literal_head. (xtensa_move_literals): Likewise. Skip literals for .init and .fini when traversing literal_head list. (match_section_group): New. (cache_literal_section): Rewrite to determine the literal section name on the fly, create the section and return it. (xtensa_switch_to_literal_fragment): Adjust for cache_literal_section. (xtensa_switch_to_non_abs_literal_fragment): Likewise. (xtensa_create_property_segments, xtensa_create_xproperty_segments): Use xtensa_get_property_section from bfd. (retrieve_xtensa_section): Delete. * doc/c-xtensa.texi (Xtensa Options): Fix --text-section-literals description to refer to plural literal sections and add xref to the Literal Directive section. (Literal Directive): Describe new rules for deriving literal section names. Add footnote for special case of .init/.fini with --text-section-literals. (Literal Prefix Directive): Replace old naming rules with xref to the Literal Directive section. ld/ * emulparams/elf32xtensa.sh (.xt.prop): Add .xt.prop.*. * scripttempl/elfxtensa.sc (.text): Add .literal.*.
Diffstat (limited to 'gas/doc')
-rw-r--r--gas/doc/c-xtensa.texi93
1 files changed, 57 insertions, 36 deletions
diff --git a/gas/doc/c-xtensa.texi b/gas/doc/c-xtensa.texi
index 2a1fb54..1a683fc 100644
--- a/gas/doc/c-xtensa.texi
+++ b/gas/doc/c-xtensa.texi
@@ -37,8 +37,8 @@ special options:
@kindex --text-section-literals
@kindex --no-text-section-literals
Control the treatment of literal pools. The default is
-@samp{--no-@-text-@-section-@-literals}, which places literals in a
-separate section in the output file. This allows the literal pool to be
+@samp{--no-@-text-@-section-@-literals}, which places literals in
+separate sections in the output file. This allows the literal pool to be
placed in a data RAM/ROM. With @samp{--text-@-section-@-literals}, the
literals are interspersed in the text section in order to keep them as
close as possible to their references. This may be necessary for large
@@ -46,6 +46,7 @@ assembly files, where the literals would otherwise be out of range of the
@code{L32R} instructions in the text section. These options only affect
literals referenced via PC-relative @code{L32R} instructions; literals
for absolute mode @code{L32R} instructions are handled separately.
+@xref{Literal Directive, ,literal}.
@item --absolute-literals | --no-absolute-literals
@kindex --absolute-literals
@@ -617,13 +618,14 @@ can be used to load a pointer to the symbol @code{sym} into register
@code{ENTRY} and @code{L32R} instructions; instead, the assembler puts
the data in a literal pool.
-Literal pools for absolute mode @code{L32R} instructions
-(@pxref{Absolute Literals Directive}) are placed in a separate
-@code{.lit4} section. By default literal pools for PC-relative mode
-@code{L32R} instructions are placed in a separate @code{.literal}
-section; however, when using the @samp{--text-@-section-@-literals}
+Literal pools are placed by default in separate literal sections;
+however, when using the @samp{--text-@-section-@-literals}
option (@pxref{Xtensa Options, ,Command Line Options}), the literal
-pools are placed in the current section. These text section literal
+pools for PC-relative mode @code{L32R} instructions
+are placed in the current section.@footnote{Literals for the
+@code{.init} and @code{.fini} sections are always placed in separate
+sections, even when @samp{--text-@-section-@-literals} is enabled.}
+These text section literal
pools are created automatically before @code{ENTRY} instructions and
manually after @samp{.literal_position} directives (@pxref{Literal
Position Directive, ,literal_position}). If there are no preceding
@@ -631,6 +633,46 @@ Position Directive, ,literal_position}). If there are no preceding
must be used to place the text section literal pools; otherwise,
@command{@value{AS}} will report an error.
+When literals are placed in separate sections, the literal section names
+are derived from the names of the sections where the literals are
+defined. The base literal section names are @code{.literal} for
+PC-relative mode @code{L32R} instructions and @code{.lit4} for absolute
+mode @code{L32R} instructions (@pxref{Absolute Literals Directive,
+,absolute-literals}). These base names are used for literals defined in
+the default @code{.text} section. For literals defined in other
+sections or within the scope of a @code{literal_prefix} directive
+(@pxref{Literal Prefix Directive, ,literal_prefix}), the following rules
+determine the literal section name:
+
+@enumerate
+@item
+If the current section is a member of a section group, the literal
+section name includes the group name as a suffix to the base
+@code{.literal} or @code{.lit4} name, with a period to separate the base
+name and group name. The literal section is also made a member of the
+group.
+
+@item
+If the current section name (or @code{literal_prefix} value) begins with
+``@code{.gnu.linkonce.@var{kind}.}'', the literal section name is formed
+by replacing ``@code{.@var{kind}}'' with the base @code{.literal} or
+@code{.lit4} name. For example, for literals defined in a section named
+@code{.gnu.linkonce.t.func}, the literal section will be
+@code{.gnu.linkonce.literal.func} or @code{.gnu.linkonce.lit4.func}.
+
+@item
+If the current section name (or @code{literal_prefix} value) ends with
+@code{.text}, the literal section name is formed by replacing that
+suffix with the base @code{.literal} or @code{.lit4} name. For example,
+for literals defined in a section named @code{.iram0.text}, the literal
+section will be @code{.iram0.literal} or @code{.iram0.lit4}.
+
+@item
+If none of the preceding conditions apply, the literal section name is
+formed by adding the base @code{.literal} or @code{.lit4} name as a
+suffix to the current section name (or @code{literal_prefix} value).
+@end enumerate
+
@node Literal Position Directive
@subsection literal_position
@cindex @code{literal_position} directive
@@ -679,45 +721,24 @@ continue:
@subsection literal_prefix
@cindex @code{literal_prefix} directive
-The @code{literal_prefix} directive allows you to specify different
-sections to hold literals from different portions of an assembly file.
-With this directive, a single assembly file can be used to generate code
-into multiple sections, including literals generated by the assembler.
+The @code{literal_prefix} directive allows you to override the default
+literal section names, which are derived from the names of the sections
+where the literals are defined.
@smallexample
.begin literal_prefix [@var{name}]
.end literal_prefix
@end smallexample
-By default the assembler places literal pools in sections separate from
-the instructions, using the default literal section names of
-@code{.literal} for PC-relative mode @code{L32R} instructions and
-@code{.lit4} for absolute mode @code{L32R} instructions (@pxref{Absolute
-Literals Directive}). The @code{literal_prefix} directive causes
-different literal sections to be used for the code inside the delimited
-region. The new literal sections are determined by including @var{name}
-as a prefix to the default literal section names. If the @var{name}
+For literals defined within the delimited region, the literal section
+names are derived from the @var{name} argument instead of the name of
+the current section. The rules used to derive the literal section names
+do not change. @xref{Literal Directive, ,literal}. If the @var{name}
argument is omitted, the literal sections revert to the defaults. This
directive has no effect when using the
@samp{--text-@-section-@-literals} option (@pxref{Xtensa Options,
,Command Line Options}).
-Except for two special cases, the assembler determines the new literal
-sections by simply prepending @var{name} to the default section names,
-resulting in @code{@var{name}.literal} and @code{@var{name}.lit4}
-sections. The @code{literal_prefix} directive is often used with the
-name of the current text section as the prefix argument. To facilitate
-this usage, the assembler uses special case rules when it recognizes
-@var{name} as a text section name. First, if @var{name} ends with
-@code{.text}, that suffix is not included in the literal section name.
-For example, if @var{name} is @code{.iram0.text}, then the literal
-sections will be @code{.iram0.literal} and @code{.iram0.lit4}. Second,
-if @var{name} begins with @code{.gnu.linkonce.t.}, then the literal
-section names are formed by replacing the @code{.t} substring with
-@code{.literal} and @code{.lit4}. For example, if @var{name} is
-@code{.gnu.linkonce.t.func}, the literal sections will be
-@code{.gnu.linkonce.literal.func} and @code{.gnu.linkonce.lit4.func}.
-
@node Absolute Literals Directive
@subsection absolute-literals
@cindex @code{absolute-literals} directive