aboutsummaryrefslogtreecommitdiff
path: root/gas/doc
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-10-05 14:13:31 +0000
committerNick Clifton <nickc@redhat.com>2011-10-05 14:13:31 +0000
commitd4cb0ea0caf03bea93ae6891017bb2301facb33f (patch)
treecf3cb39ee841888cd026e0063f36241cc514fefb /gas/doc
parentb1c8db38fceb8464f02f1673b52c926c56203593 (diff)
downloadgdb-d4cb0ea0caf03bea93ae6891017bb2301facb33f.zip
gdb-d4cb0ea0caf03bea93ae6891017bb2301facb33f.tar.gz
gdb-d4cb0ea0caf03bea93ae6891017bb2301facb33f.tar.bz2
* readelf.c (get_machine_dlags): Add support for RX's PID mode.
* ld-scripts/phdrs.exp: Expect to fail for the RX. * elf32-rx.c: Add support for PID mode. (rx_elf_relocate_section): Add checks for unsafe PID relocations. Include addend in R_RX_SYM relocations. * config/rx-defs.h (rx_pid_register): New. (rx_gp_register): New. * config/rx-parse.y (rx_lex): Add support for %gpreg and %pidreg. (displacement): Add PID support. * config/tc-rx.c (rx_pid_mode): New. (rx_num_int_regs): New. (rx_pid_register): New. (rx_gp_register): New. (options): Add -mpid and -mint-register= options. (md_longopts): Likewise. (md_parse_option): Likewise. (md_show_usage): Likewise. (rx_pid_symbol): New. (rx_pidreg_symbol): New. (rx_gpreg_symbol): New. (md_begin): Support PID. (rx_validate_fix_sub): Support PID. (tc_gen_reloc): Support PID. * doc/c-rx.texi: Document PID support. * rx.h (E_FLAG_RX_PID): New.
Diffstat (limited to 'gas/doc')
-rw-r--r--gas/doc/c-rx.texi51
1 files changed, 44 insertions, 7 deletions
diff --git a/gas/doc/c-rx.texi b/gas/doc/c-rx.texi
index 183fbe3..cb89bd6 100644
--- a/gas/doc/c-rx.texi
+++ b/gas/doc/c-rx.texi
@@ -74,11 +74,25 @@ This is the default.
@item -msmall-data-limit
This option tells the assembler that the small data limit feature of
the RX port of GCC is being used. This results in the assembler
-generating an undefined reference to a symbol called __gp for use by
-the relocations that are needed to support the small data limit
+generating an undefined reference to a symbol called @code{__gp} for
+use by the relocations that are needed to support the small data limit
feature. This option is not enabled by default as it would otherwise
pollute the symbol table.
+@cindex @samp{-mpid}
+@item -mpid
+This option tells the assembler that the position independent data of the
+RX port of GCC is being used. This results in the assembler
+generating an undefined reference to a symbol called @code{__pid_base},
+and also setting the RX_PID flag bit in the e_flags field of the ELF
+header of the object file.
+
+@cindex @samp{-mint-register}
+@item -mint-register=@var{num}
+This option tells the assembler how many registers have been reserved
+for use by interrupt handlers. This is needed in order to compute the
+correct values for the @code{%gpreg} and @code{%pidreg} meta registers.
+
@end table
@node RX-Modifiers
@@ -86,22 +100,45 @@ pollute the symbol table.
@cindex RX modifiers
@cindex syntax, RX
+@cindex %gp
-The assembler supports several modifiers when using symbol addresses
+The assembler supports one modifier when using symbol addresses
in RX instruction operands. The general syntax is the following:
@smallexample
-%modifier(symbol)
+%gp(symbol)
@end smallexample
+The modifier returns the offset from the @var{__gp} symbol to the
+specified symbol as a 16-bit value. The intent is that this offset
+should be used in a register+offset move instruction when generating
+references to small data. Ie, like this:
+
+@smallexample
+ mov.W %gp(_foo)[%gpreg], r1
+@end smallexample
+
+The assembler also supports two meta register names which can be used
+to refer to registers whose values may not be known to the
+programmer. These meta register names are:
+
@table @code
-@cindex symbol modifiers
-@item %gp
-@c FIXME: Add documentation here.
+@cindex @samp{%gpreg}
+@item %gpreg
+The small data address register.
+
+@cindex @samp{%pidreg}
+@item %pidreg
+The PID base address register.
@end table
+Both registers normally have the value r13, but this can change if
+some registers have been reserved for use by interrupt handlers or if
+both the small data limit and position independent data features are
+being used at the same time.
+
@node RX-Directives
@section Assembler Directives