aboutsummaryrefslogtreecommitdiff
path: root/gas/doc
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-10-08 15:29:40 +0000
committerNick Clifton <nickc@redhat.com>2007-10-08 15:29:40 +0000
commit8b040e0a493dbabd5e8d2f921ea4a9ac9ad3e190 (patch)
tree1cc5b7b22d944f27fb34057b9cc1e3dee46744fa /gas/doc
parentbd3ba5d1b3c7d421d3e61f67a11ed06d6fff93fa (diff)
downloadgdb-8b040e0a493dbabd5e8d2f921ea4a9ac9ad3e190.zip
gdb-8b040e0a493dbabd5e8d2f921ea4a9ac9ad3e190.tar.gz
gdb-8b040e0a493dbabd5e8d2f921ea4a9ac9ad3e190.tar.bz2
* doc/as.texinfo (Previous): Clarify explanation of the behaviour of this
pseudo-op and add a couple of examples.
Diffstat (limited to 'gas/doc')
-rw-r--r--gas/doc/as.texinfo37
1 files changed, 35 insertions, 2 deletions
diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo
index a59b272..4e07ef0 100644
--- a/gas/doc/as.texinfo
+++ b/gas/doc/as.texinfo
@@ -5346,9 +5346,42 @@ This is one of the ELF section stack manipulation directives. The others are
(@pxref{PopSection}).
This directive swaps the current section (and subsection) with most recently
-referenced section (and subsection) prior to this one. Multiple
+referenced section/subsection pair prior to this one. Multiple
@code{.previous} directives in a row will flip between two sections (and their
-subsections).
+subsections). For example:
+
+@smallexample
+.section A
+ .subsection 1
+ .word 0x1234
+ .subsection 2
+ .word 0x5678
+.previous
+ .word 0x9abc
+@end smallexample
+
+Will place 0x1234 and 0x9abc into subsection 1 and 0x5678 into subsection 2 of
+section A. Whilst:
+
+@smallexample
+.section A
+.subsection 1
+ # Now in section A subsection 1
+ .word 0x1234
+.section B
+.subsection 0
+ # Now in section B subsection 0
+ .word 0x5678
+.subsection 1
+ # Now in section B subsection 1
+ .word 0x9abc
+.previous
+ # Now in section B subsection 0
+ .word 0xdef0
+@end smallexample
+
+Will place 0x1234 into section A, 0x5678 and 0xdef0 into subsection 0 of
+section B and 0x9abc into subsection 1 of section B.
In terms of the section stack, this directive swaps the current section with
the top section on the section stack.