]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* doc/as.texinfo (Previous): Clarify explanation of the behaviour of this
authorNick Clifton <nickc@redhat.com>
Mon, 8 Oct 2007 15:29:40 +0000 (15:29 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 8 Oct 2007 15:29:40 +0000 (15:29 +0000)
  pseudo-op and add a couple of examples.

gas/ChangeLog
gas/doc/as.texinfo

index 9e13cd4c484c1f8ba416b36588cc71403c4c765c..c9af1a308cb1247967afc556ed72da9566f25d19 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-08  Nick Clifton  <nickc@redhat.com>
+
+       * doc/as.texinfo (Previous): Clarify explanation of the behaviour
+       of this pseudo-op and add a couple of examples.
+
 2007-10-08  Nick Clifton  <nickc@redhat.com>
 
        PR gas/5121 gas/5122 gas/5123
index a59b272f6038556790fe8808f3ef126f8a50ef8d..4e07ef0e7d09f545b81c2a2c962f602aef209165 100644 (file)
@@ -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.