ELF object files

Note section

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.

[. . .]
[. . .]

Note information

namesz and name
The first 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
The first 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.

This word gives the interpretation of the descriptor. Each originator controls its own types; multiple interpretations of a single type value may exist. Thus, a program must recognize both the name and the type to recognize a descriptor. Types currently must be non-negative.
To illustrate, the following note segment holds two entries.

  +0 +1 +2 +3  
namesz 7 descsz
0 No descriptor type
1     name X Y
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

NOTE: The system reserves note information with no name (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.

Next topic: Program loading (processor-specific)
Previous topic: Text segment

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003