OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [binutils-2.18.50/] [bfd/] [doc/] [mmo.texi] - Diff between revs 38 and 156

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 38 Rev 156
@section mmo backend
@section mmo backend
The mmo object format is used exclusively together with Professor
The mmo object format is used exclusively together with Professor
Donald E.@: Knuth's educational 64-bit processor MMIX.  The simulator
Donald E.@: Knuth's educational 64-bit processor MMIX.  The simulator
@command{mmix} which is available at
@command{mmix} which is available at
@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}
@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}
understands this format.  That package also includes a combined
understands this format.  That package also includes a combined
assembler and linker called @command{mmixal}.  The mmo format has
assembler and linker called @command{mmixal}.  The mmo format has
no advantages feature-wise compared to e.g. ELF.  It is a simple
no advantages feature-wise compared to e.g. ELF.  It is a simple
non-relocatable object format with no support for archives or
non-relocatable object format with no support for archives or
debugging information, except for symbol value information and
debugging information, except for symbol value information and
line numbers (which is not yet implemented in BFD).  See
line numbers (which is not yet implemented in BFD).  See
@url{http://www-cs-faculty.stanford.edu/~knuth/mmix.html} for more
@url{http://www-cs-faculty.stanford.edu/~knuth/mmix.html} for more
information about MMIX.  The ELF format is used for intermediate
information about MMIX.  The ELF format is used for intermediate
object files in the BFD implementation.
object files in the BFD implementation.
 
 
@c We want to xref the symbol table node.  A feature in "chew"
@c We want to xref the symbol table node.  A feature in "chew"
@c requires that "commands" do not contain spaces in the
@c requires that "commands" do not contain spaces in the
@c arguments.  Hence the hyphen in "Symbol-table".
@c arguments.  Hence the hyphen in "Symbol-table".
@menu
@menu
* File layout::
* File layout::
* Symbol-table::
* Symbol-table::
* mmo section mapping::
* mmo section mapping::
@end menu
@end menu
 
 
@node File layout, Symbol-table, mmo, mmo
@node File layout, Symbol-table, mmo, mmo
@subsection File layout
@subsection File layout
The mmo file contents is not partitioned into named sections as
The mmo file contents is not partitioned into named sections as
with e.g.@: ELF.  Memory areas is formed by specifying the
with e.g.@: ELF.  Memory areas is formed by specifying the
location of the data that follows.  Only the memory area
location of the data that follows.  Only the memory area
@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} is executable, so
@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} is executable, so
it is used for code (and constants) and the area
it is used for code (and constants) and the area
@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} is used for
@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} is used for
writable data.  @xref{mmo section mapping}.
writable data.  @xref{mmo section mapping}.
 
 
There is provision for specifying ``special data'' of 65536
There is provision for specifying ``special data'' of 65536
different types.  We use type 80 (decimal), arbitrarily chosen the
different types.  We use type 80 (decimal), arbitrarily chosen the
same as the ELF @code{e_machine} number for MMIX, filling it with
same as the ELF @code{e_machine} number for MMIX, filling it with
section information normally found in ELF objects. @xref{mmo
section information normally found in ELF objects. @xref{mmo
section mapping}.
section mapping}.
 
 
Contents is entered as 32-bit words, xor:ed over previous
Contents is entered as 32-bit words, xor:ed over previous
contents, always zero-initialized.  A word that starts with the
contents, always zero-initialized.  A word that starts with the
byte @samp{0x98} forms a command called a @samp{lopcode}, where
byte @samp{0x98} forms a command called a @samp{lopcode}, where
the next byte distinguished between the thirteen lopcodes.  The
the next byte distinguished between the thirteen lopcodes.  The
two remaining bytes, called the @samp{Y} and @samp{Z} fields, or
two remaining bytes, called the @samp{Y} and @samp{Z} fields, or
the @samp{YZ} field (a 16-bit big-endian number), are used for
the @samp{YZ} field (a 16-bit big-endian number), are used for
various purposes different for each lopcode.  As documented in
various purposes different for each lopcode.  As documented in
@url{http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz},
@url{http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz},
the lopcodes are:
the lopcodes are:
 
 
@table @code
@table @code
@item lop_quote
@item lop_quote
0x98000001.  The next word is contents, regardless of whether it
0x98000001.  The next word is contents, regardless of whether it
starts with 0x98 or not.
starts with 0x98 or not.
 
 
@item lop_loc
@item lop_loc
0x9801YYZZ, where @samp{Z} is 1 or 2.  This is a location
0x9801YYZZ, where @samp{Z} is 1 or 2.  This is a location
directive, setting the location for the next data to the next
directive, setting the location for the next data to the next
32-bit word (for @math{Z = 1}) or 64-bit word (for @math{Z = 2}),
32-bit word (for @math{Z = 1}) or 64-bit word (for @math{Z = 2}),
plus @math{Y * 2^56}.  Normally @samp{Y} is 0 for the text segment
plus @math{Y * 2^56}.  Normally @samp{Y} is 0 for the text segment
and 2 for the data segment.
and 2 for the data segment.
 
 
@item lop_skip
@item lop_skip
0x9802YYZZ.  Increase the current location by @samp{YZ} bytes.
0x9802YYZZ.  Increase the current location by @samp{YZ} bytes.
 
 
@item lop_fixo
@item lop_fixo
0x9803YYZZ, where @samp{Z} is 1 or 2.  Store the current location
0x9803YYZZ, where @samp{Z} is 1 or 2.  Store the current location
as 64 bits into the location pointed to by the next 32-bit
as 64 bits into the location pointed to by the next 32-bit
(@math{Z = 1}) or 64-bit (@math{Z = 2}) word, plus @math{Y *
(@math{Z = 1}) or 64-bit (@math{Z = 2}) word, plus @math{Y *
2^56}.
2^56}.
 
 
@item lop_fixr
@item lop_fixr
0x9804YYZZ.  @samp{YZ} is stored into the current location plus
0x9804YYZZ.  @samp{YZ} is stored into the current location plus
@math{2 - 4 * YZ}.
@math{2 - 4 * YZ}.
 
 
@item lop_fixrx
@item lop_fixrx
0x980500ZZ.  @samp{Z} is 16 or 24.  A value @samp{L} derived from
0x980500ZZ.  @samp{Z} is 16 or 24.  A value @samp{L} derived from
the following 32-bit word are used in a manner similar to
the following 32-bit word are used in a manner similar to
@samp{YZ} in lop_fixr: it is xor:ed into the current location
@samp{YZ} in lop_fixr: it is xor:ed into the current location
minus @math{4 * L}.  The first byte of the word is 0 or 1.  If it
minus @math{4 * L}.  The first byte of the word is 0 or 1.  If it
is 1, then @math{L = (@var{lowest 24 bits of word}) - 2^Z}, if 0,
is 1, then @math{L = (@var{lowest 24 bits of word}) - 2^Z}, if 0,
then @math{L = (@var{lowest 24 bits of word})}.
then @math{L = (@var{lowest 24 bits of word})}.
 
 
@item lop_file
@item lop_file
0x9806YYZZ.  @samp{Y} is the file number, @samp{Z} is count of
0x9806YYZZ.  @samp{Y} is the file number, @samp{Z} is count of
32-bit words.  Set the file number to @samp{Y} and the line
32-bit words.  Set the file number to @samp{Y} and the line
counter to 0.  The next @math{Z * 4} bytes contain the file name,
counter to 0.  The next @math{Z * 4} bytes contain the file name,
padded with zeros if the count is not a multiple of four.  The
padded with zeros if the count is not a multiple of four.  The
same @samp{Y} may occur multiple times, but @samp{Z} must be 0 for
same @samp{Y} may occur multiple times, but @samp{Z} must be 0 for
all but the first occurrence.
all but the first occurrence.
 
 
@item lop_line
@item lop_line
0x9807YYZZ.  @samp{YZ} is the line number.  Together with
0x9807YYZZ.  @samp{YZ} is the line number.  Together with
lop_file, it forms the source location for the next 32-bit word.
lop_file, it forms the source location for the next 32-bit word.
Note that for each non-lopcode 32-bit word, line numbers are
Note that for each non-lopcode 32-bit word, line numbers are
assumed incremented by one.
assumed incremented by one.
 
 
@item lop_spec
@item lop_spec
0x9808YYZZ.  @samp{YZ} is the type number.  Data until the next
0x9808YYZZ.  @samp{YZ} is the type number.  Data until the next
lopcode other than lop_quote forms special data of type @samp{YZ}.
lopcode other than lop_quote forms special data of type @samp{YZ}.
@xref{mmo section mapping}.
@xref{mmo section mapping}.
 
 
Other types than 80, (or type 80 with a content that does not
Other types than 80, (or type 80 with a content that does not
parse) is stored in sections named @code{.MMIX.spec_data.@var{n}}
parse) is stored in sections named @code{.MMIX.spec_data.@var{n}}
where @var{n} is the @samp{YZ}-type.  The flags for such a
where @var{n} is the @samp{YZ}-type.  The flags for such a
sections say not to allocate or load the data.  The vma is 0.
sections say not to allocate or load the data.  The vma is 0.
Contents of multiple occurrences of special data @var{n} is
Contents of multiple occurrences of special data @var{n} is
concatenated to the data of the previous lop_spec @var{n}s.  The
concatenated to the data of the previous lop_spec @var{n}s.  The
location in data or code at which the lop_spec occurred is lost.
location in data or code at which the lop_spec occurred is lost.
 
 
@item lop_pre
@item lop_pre
0x980901ZZ.  The first lopcode in a file.  The @samp{Z} field forms the
0x980901ZZ.  The first lopcode in a file.  The @samp{Z} field forms the
length of header information in 32-bit words, where the first word
length of header information in 32-bit words, where the first word
tells the time in seconds since @samp{00:00:00 GMT Jan 1 1970}.
tells the time in seconds since @samp{00:00:00 GMT Jan 1 1970}.
 
 
@item lop_post
@item lop_post
0x980a00ZZ.  @math{Z > 32}.  This lopcode follows after all
0x980a00ZZ.  @math{Z > 32}.  This lopcode follows after all
content-generating lopcodes in a program.  The @samp{Z} field
content-generating lopcodes in a program.  The @samp{Z} field
denotes the value of @samp{rG} at the beginning of the program.
denotes the value of @samp{rG} at the beginning of the program.
The following @math{256 - Z} big-endian 64-bit words are loaded
The following @math{256 - Z} big-endian 64-bit words are loaded
into global registers @samp{$G} @dots{} @samp{$255}.
into global registers @samp{$G} @dots{} @samp{$255}.
 
 
@item lop_stab
@item lop_stab
0x980b0000.  The next-to-last lopcode in a program.  Must follow
0x980b0000.  The next-to-last lopcode in a program.  Must follow
immediately after the lop_post lopcode and its data.  After this
immediately after the lop_post lopcode and its data.  After this
lopcode follows all symbols in a compressed format
lopcode follows all symbols in a compressed format
(@pxref{Symbol-table}).
(@pxref{Symbol-table}).
 
 
@item lop_end
@item lop_end
0x980cYYZZ.  The last lopcode in a program.  It must follow the
0x980cYYZZ.  The last lopcode in a program.  It must follow the
lop_stab lopcode and its data.  The @samp{YZ} field contains the
lop_stab lopcode and its data.  The @samp{YZ} field contains the
number of 32-bit words of symbol table information after the
number of 32-bit words of symbol table information after the
preceding lop_stab lopcode.
preceding lop_stab lopcode.
@end table
@end table
 
 
Note that the lopcode "fixups"; @code{lop_fixr}, @code{lop_fixrx} and
Note that the lopcode "fixups"; @code{lop_fixr}, @code{lop_fixrx} and
@code{lop_fixo} are not generated by BFD, but are handled.  They are
@code{lop_fixo} are not generated by BFD, but are handled.  They are
generated by @code{mmixal}.
generated by @code{mmixal}.
 
 
This trivial one-label, one-instruction file:
This trivial one-label, one-instruction file:
 
 
@example
@example
 :Main TRAP 1,2,3
 :Main TRAP 1,2,3
@end example
@end example
 
 
can be represented this way in mmo:
can be represented this way in mmo:
 
 
@example
@example
 0x98090101 - lop_pre, one 32-bit word with timestamp.
 0x98090101 - lop_pre, one 32-bit word with timestamp.
 <timestamp>
 <timestamp>
 0x98010002 - lop_loc, text segment, using a 64-bit address.
 0x98010002 - lop_loc, text segment, using a 64-bit address.
              Note that mmixal does not emit this for the file above.
              Note that mmixal does not emit this for the file above.
 0x00000000 - Address, high 32 bits.
 0x00000000 - Address, high 32 bits.
 0x00000000 - Address, low 32 bits.
 0x00000000 - Address, low 32 bits.
 0x98060002 - lop_file, 2 32-bit words for file-name.
 0x98060002 - lop_file, 2 32-bit words for file-name.
 0x74657374 - "test"
 0x74657374 - "test"
 0x2e730000 - ".s\0\0"
 0x2e730000 - ".s\0\0"
 0x98070001 - lop_line, line 1.
 0x98070001 - lop_line, line 1.
 0x00010203 - TRAP 1,2,3
 0x00010203 - TRAP 1,2,3
 0x980a00ff - lop_post, setting $255 to 0.
 0x980a00ff - lop_post, setting $255 to 0.
 0x00000000
 0x00000000
 0x00000000
 0x00000000
 0x980b0000 - lop_stab for ":Main" = 0, serial 1.
 0x980b0000 - lop_stab for ":Main" = 0, serial 1.
 0x203a4040   @xref{Symbol-table}.
 0x203a4040   @xref{Symbol-table}.
 0x10404020
 0x10404020
 0x4d206120
 0x4d206120
 0x69016e00
 0x69016e00
 0x81000000
 0x81000000
 0x980c0005 - lop_end; symbol table contained five 32-bit words.
 0x980c0005 - lop_end; symbol table contained five 32-bit words.
@end example
@end example
@node Symbol-table, mmo section mapping, File layout, mmo
@node Symbol-table, mmo section mapping, File layout, mmo
@subsection Symbol table format
@subsection Symbol table format
From mmixal.w (or really, the generated mmixal.tex) in
From mmixal.w (or really, the generated mmixal.tex) in
@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}):
@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}):
``Symbols are stored and retrieved by means of a @samp{ternary
``Symbols are stored and retrieved by means of a @samp{ternary
search trie}, following ideas of Bentley and Sedgewick. (See
search trie}, following ideas of Bentley and Sedgewick. (See
ACM--SIAM Symp.@: on Discrete Algorithms @samp{8} (1997), 360--369;
ACM--SIAM Symp.@: on Discrete Algorithms @samp{8} (1997), 360--369;
R.@:Sedgewick, @samp{Algorithms in C} (Reading, Mass.@:
R.@:Sedgewick, @samp{Algorithms in C} (Reading, Mass.@:
Addison--Wesley, 1998), @samp{15.4}.)  Each trie node stores a
Addison--Wesley, 1998), @samp{15.4}.)  Each trie node stores a
character, and there are branches to subtries for the cases where
character, and there are branches to subtries for the cases where
a given character is less than, equal to, or greater than the
a given character is less than, equal to, or greater than the
character in the trie.  There also is a pointer to a symbol table
character in the trie.  There also is a pointer to a symbol table
entry if a symbol ends at the current node.''
entry if a symbol ends at the current node.''
 
 
So it's a tree encoded as a stream of bytes.  The stream of bytes
So it's a tree encoded as a stream of bytes.  The stream of bytes
acts on a single virtual global symbol, adding and removing
acts on a single virtual global symbol, adding and removing
characters and signalling complete symbol points.  Here, we read
characters and signalling complete symbol points.  Here, we read
the stream and create symbols at the completion points.
the stream and create symbols at the completion points.
 
 
First, there's a control byte @code{m}.  If any of the listed bits
First, there's a control byte @code{m}.  If any of the listed bits
in @code{m} is nonzero, we execute what stands at the right, in
in @code{m} is nonzero, we execute what stands at the right, in
the listed order:
the listed order:
 
 
@example
@example
 (MMO3_LEFT)
 (MMO3_LEFT)
 0x40 - Traverse left trie.
 0x40 - Traverse left trie.
        (Read a new command byte and recurse.)
        (Read a new command byte and recurse.)
 
 
 (MMO3_SYMBITS)
 (MMO3_SYMBITS)
 0x2f - Read the next byte as a character and store it in the
 0x2f - Read the next byte as a character and store it in the
        current character position; increment character position.
        current character position; increment character position.
        Test the bits of @code{m}:
        Test the bits of @code{m}:
 
 
        (MMO3_WCHAR)
        (MMO3_WCHAR)
        0x80 - The character is 16-bit (so read another byte,
        0x80 - The character is 16-bit (so read another byte,
               merge into current character.
               merge into current character.
 
 
        (MMO3_TYPEBITS)
        (MMO3_TYPEBITS)
        0xf  - We have a complete symbol; parse the type, value
        0xf  - We have a complete symbol; parse the type, value
               and serial number and do what should be done
               and serial number and do what should be done
               with a symbol.  The type and length information
               with a symbol.  The type and length information
               is in j = (m & 0xf).
               is in j = (m & 0xf).
 
 
               (MMO3_REGQUAL_BITS)
               (MMO3_REGQUAL_BITS)
               j == 0xf: A register variable.  The following
               j == 0xf: A register variable.  The following
                         byte tells which register.
                         byte tells which register.
               j <= 8:   An absolute symbol.  Read j bytes as the
               j <= 8:   An absolute symbol.  Read j bytes as the
                         big-endian number the symbol equals.
                         big-endian number the symbol equals.
                         A j = 2 with two zero bytes denotes an
                         A j = 2 with two zero bytes denotes an
                         unknown symbol.
                         unknown symbol.
               j > 8:    As with j <= 8, but add (0x20 << 56)
               j > 8:    As with j <= 8, but add (0x20 << 56)
                         to the value in the following j - 8
                         to the value in the following j - 8
                         bytes.
                         bytes.
 
 
               Then comes the serial number, as a variant of
               Then comes the serial number, as a variant of
               uleb128, but better named ubeb128:
               uleb128, but better named ubeb128:
               Read bytes and shift the previous value left 7
               Read bytes and shift the previous value left 7
               (multiply by 128).  Add in the new byte, repeat
               (multiply by 128).  Add in the new byte, repeat
               until a byte has bit 7 set.  The serial number
               until a byte has bit 7 set.  The serial number
               is the computed value minus 128.
               is the computed value minus 128.
 
 
        (MMO3_MIDDLE)
        (MMO3_MIDDLE)
        0x20 - Traverse middle trie.  (Read a new command byte
        0x20 - Traverse middle trie.  (Read a new command byte
               and recurse.)  Decrement character position.
               and recurse.)  Decrement character position.
 
 
 (MMO3_RIGHT)
 (MMO3_RIGHT)
 0x10 - Traverse right trie.  (Read a new command byte and
 0x10 - Traverse right trie.  (Read a new command byte and
        recurse.)
        recurse.)
@end example
@end example
 
 
Let's look again at the @code{lop_stab} for the trivial file
Let's look again at the @code{lop_stab} for the trivial file
(@pxref{File layout}).
(@pxref{File layout}).
 
 
@example
@example
 0x980b0000 - lop_stab for ":Main" = 0, serial 1.
 0x980b0000 - lop_stab for ":Main" = 0, serial 1.
 0x203a4040
 0x203a4040
 0x10404020
 0x10404020
 0x4d206120
 0x4d206120
 0x69016e00
 0x69016e00
 0x81000000
 0x81000000
@end example
@end example
 
 
This forms the trivial trie (note that the path between ``:'' and
This forms the trivial trie (note that the path between ``:'' and
``M'' is redundant):
``M'' is redundant):
 
 
@example
@example
 203a     ":"
 203a     ":"
 40       /
 40       /
 40      /
 40      /
 10      \
 10      \
 40      /
 40      /
 40     /
 40     /
 204d  "M"
 204d  "M"
 2061  "a"
 2061  "a"
 2069  "i"
 2069  "i"
 016e  "n" is the last character in a full symbol, and
 016e  "n" is the last character in a full symbol, and
       with a value represented in one byte.
       with a value represented in one byte.
 00    The value is 0.
 00    The value is 0.
 81    The serial number is 1.
 81    The serial number is 1.
@end example
@end example
 
 
@node mmo section mapping, , Symbol-table, mmo
@node mmo section mapping, , Symbol-table, mmo
@subsection mmo section mapping
@subsection mmo section mapping
The implementation in BFD uses special data type 80 (decimal) to
The implementation in BFD uses special data type 80 (decimal) to
encapsulate and describe named sections, containing e.g.@: debug
encapsulate and describe named sections, containing e.g.@: debug
information.  If needed, any datum in the encapsulation will be
information.  If needed, any datum in the encapsulation will be
quoted using lop_quote.  First comes a 32-bit word holding the
quoted using lop_quote.  First comes a 32-bit word holding the
number of 32-bit words containing the zero-terminated zero-padded
number of 32-bit words containing the zero-terminated zero-padded
segment name.  After the name there's a 32-bit word holding flags
segment name.  After the name there's a 32-bit word holding flags
describing the section type.  Then comes a 64-bit big-endian word
describing the section type.  Then comes a 64-bit big-endian word
with the section length (in bytes), then another with the section
with the section length (in bytes), then another with the section
start address.  Depending on the type of section, the contents
start address.  Depending on the type of section, the contents
might follow, zero-padded to 32-bit boundary.  For a loadable
might follow, zero-padded to 32-bit boundary.  For a loadable
section (such as data or code), the contents might follow at some
section (such as data or code), the contents might follow at some
later point, not necessarily immediately, as a lop_loc with the
later point, not necessarily immediately, as a lop_loc with the
same start address as in the section description, followed by the
same start address as in the section description, followed by the
contents.  This in effect forms a descriptor that must be emitted
contents.  This in effect forms a descriptor that must be emitted
before the actual contents.  Sections described this way must not
before the actual contents.  Sections described this way must not
overlap.
overlap.
 
 
For areas that don't have such descriptors, synthetic sections are
For areas that don't have such descriptors, synthetic sections are
formed by BFD.  Consecutive contents in the two memory areas
formed by BFD.  Consecutive contents in the two memory areas
@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} and
@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} and
@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} are entered in
@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} are entered in
sections named @code{.text} and @code{.data} respectively.  If an area
sections named @code{.text} and @code{.data} respectively.  If an area
is not otherwise described, but would together with a neighboring
is not otherwise described, but would together with a neighboring
lower area be less than @samp{0x40000000} bytes long, it is joined
lower area be less than @samp{0x40000000} bytes long, it is joined
with the lower area and the gap is zero-filled.  For other cases,
with the lower area and the gap is zero-filled.  For other cases,
a new section is formed, named @code{.MMIX.sec.@var{n}}.  Here,
a new section is formed, named @code{.MMIX.sec.@var{n}}.  Here,
@var{n} is a number, a running count through the mmo file,
@var{n} is a number, a running count through the mmo file,
starting at 0.
starting at 0.
 
 
A loadable section specified as:
A loadable section specified as:
 
 
@example
@example
 .section secname,"ax"
 .section secname,"ax"
 TETRA 1,2,3,4,-1,-2009
 TETRA 1,2,3,4,-1,-2009
 BYTE 80
 BYTE 80
@end example
@end example
 
 
and linked to address @samp{0x4}, is represented by the sequence:
and linked to address @samp{0x4}, is represented by the sequence:
 
 
@example
@example
 0x98080050 - lop_spec 80
 0x98080050 - lop_spec 80
 0x00000002 - two 32-bit words for the section name
 0x00000002 - two 32-bit words for the section name
 0x7365636e - "secn"
 0x7365636e - "secn"
 0x616d6500 - "ame\0"
 0x616d6500 - "ame\0"
 0x00000033 - flags CODE, READONLY, LOAD, ALLOC
 0x00000033 - flags CODE, READONLY, LOAD, ALLOC
 0x00000000 - high 32 bits of section length
 0x00000000 - high 32 bits of section length
 0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits
 0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits
 0x00000000 - high 32 bits of section address
 0x00000000 - high 32 bits of section address
 0x00000004 - section address is 4
 0x00000004 - section address is 4
 0x98010002 - 64 bits with address of following data
 0x98010002 - 64 bits with address of following data
 0x00000000 - high 32 bits of address
 0x00000000 - high 32 bits of address
 0x00000004 - low 32 bits: data starts at address 4
 0x00000004 - low 32 bits: data starts at address 4
 0x00000001 - 1
 0x00000001 - 1
 0x00000002 - 2
 0x00000002 - 2
 0x00000003 - 3
 0x00000003 - 3
 0x00000004 - 4
 0x00000004 - 4
 0xffffffff - -1
 0xffffffff - -1
 0xfffff827 - -2009
 0xfffff827 - -2009
 0x50000000 - 80 as a byte, padded with zeros.
 0x50000000 - 80 as a byte, padded with zeros.
@end example
@end example
 
 
Note that the lop_spec wrapping does not include the section
Note that the lop_spec wrapping does not include the section
contents.  Compare this to a non-loaded section specified as:
contents.  Compare this to a non-loaded section specified as:
 
 
@example
@example
 .section thirdsec
 .section thirdsec
 TETRA 200001,100002
 TETRA 200001,100002
 BYTE 38,40
 BYTE 38,40
@end example
@end example
 
 
This, when linked to address @samp{0x200000000000001c}, is
This, when linked to address @samp{0x200000000000001c}, is
represented by:
represented by:
 
 
@example
@example
 0x98080050 - lop_spec 80
 0x98080050 - lop_spec 80
 0x00000002 - two 32-bit words for the section name
 0x00000002 - two 32-bit words for the section name
 0x7365636e - "thir"
 0x7365636e - "thir"
 0x616d6500 - "dsec"
 0x616d6500 - "dsec"
 0x00000010 - flag READONLY
 0x00000010 - flag READONLY
 0x00000000 - high 32 bits of section length
 0x00000000 - high 32 bits of section length
 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits
 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits
 0x20000000 - high 32 bits of address
 0x20000000 - high 32 bits of address
 0x0000001c - low 32 bits of address 0x200000000000001c
 0x0000001c - low 32 bits of address 0x200000000000001c
 0x00030d41 - 200001
 0x00030d41 - 200001
 0x000186a2 - 100002
 0x000186a2 - 100002
 0x26280000 - 38, 40 as bytes, padded with zeros
 0x26280000 - 38, 40 as bytes, padded with zeros
@end example
@end example
 
 
For the latter example, the section contents must not be
For the latter example, the section contents must not be
loaded in memory, and is therefore specified as part of the
loaded in memory, and is therefore specified as part of the
special data.  The address is usually unimportant but might
special data.  The address is usually unimportant but might
provide information for e.g.@: the DWARF 2 debugging format.
provide information for e.g.@: the DWARF 2 debugging format.
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.