|
|
Sometimes a vendor or system builder needs to mark an object file with special information that other programs will check for conformance, compatibility, and so forth. Sections of type SHT_NOTE and program header elements of type PT_NOTE can be used for this purpose. The note information in sections and program header elements holds a variable amount of entries, each of which is an array of 4-byte words in the format of the target processor. Labels appear in ``Note information'' to help explain note information organization, but they are not part of the specification.
namesz |
descsz |
type |
name |
[. . .] |
desc |
[. . .] |
Note information
namesz
and name
namesz
bytes in name
contain
a null-terminated character representation of the entry's
owner or originator. There is no formal mechanism for
avoiding name conflicts. By convention, vendors use their
own name, such as XYZ Computer Company, as the identifier.
If no name is present, namesz
contains 0.
Padding is present, if necessary, to ensure 4-byte
alignment for the descriptor. Such padding is not included
in namesz
.
descsz
and desc
descsz
bytes in desc
hold the
note descriptor. If no descriptor is present,
descsz
contains 0. Padding is present, if
necessary, to ensure 4-byte alignment for the next note
entry. Such padding is not included in descsz
.
type
+0 | +1 | +2 | +3 | ||
---|---|---|---|---|---|
namesz | 7 | descsz | |||
0 | No descriptor | type | |||
1 | name | X | Y | ||
Z | |||||
C | o | \0 | pad | ||
namesz | 7 | descsz | |||
8 | type | 3 | name | ||
X | Y | Z | |||
C | o | \0 | pad | ||
desc | word 0 | ||||
word 1 |
Example note segment
namesz
==0) and with a zero-length name
(name[0]
=='\0') but currently defines no types.
All other names must have at least one non-null character.