Ancillary Section
In addition to the primary output object, the Solaris link-editor can produce one or more
ancillary objects. Ancillary objects contain non-allocable sections that are normally written
to the primary object. When ancillary objects are produced, the primary object and all of the
associated ancillary objects contain a SHT_SUNW_ancillary
section,
containing information that identifies these related objects. The ancillary section from any
of these objects provides the information needed to identify and interpret the other members
of the group.
This section contains an array of the following structures. See
sys/elf.h
.
typedef struct { Elf32_Word a_tag; union { Elf32_Word a_val; Elf32_Addr a_ptr; } a_un; } Elf32_Ancillary; typedef struct { Elf64_Xword a_tag; union { Elf64_Xword a_val; Elf64_Addr a_ptr; } a_un; } Elf64_Ancillary;
For each object with this type, a_tag
controls the interpretation of
a_un
.
-
a_val
-
These objects represent integer values with various interpretations.
-
a_ptr
-
These objects represent program virtual addresses.
The following ancillary tags exist.
Table 14-13 ELF Ancillary Array Tags
Name | Value | c_un |
---|---|---|
|
|
Ignored |
|
|
|
|
|
|
-
ANC_SUNW_NULL
-
Marks the end of the ancillary array.
-
ANC_SUNW_CHECKSUM
-
Provides the checksum for a file in the
c_val
element. WhenANC_SUNW_CHECKSUM
precedes the first instance ofANC_SUNW_MEMBER
, it provides the checksum for the object from which the ancillary section is being read. When it follows anANC_SUNW_MEMBER
tag, it provides the checksum for that member. -
ANC_SUNW_MEMBER
-
Specifies an object name. The
a_ptr
element contains the string table offset of a null-terminated string, that provides the file name.
An ancillary section must always contain an ANC_SUNW_CHECKSUM
before
the first instance of ANC_SUNW_MEMBER
, identifying the current object.
Following that, there should be an ANC_SUNW_MEMBER
for each object that
makes up the complete set of objects. Each ANC_SUNW_MEMBER
should be
followed by an ANC_SUNW_CHECKSUM
for that object. A typical ancillary
section is therefore be structured as follows.
Tag | Meaning |
---|---|
|
Checksum of this object |
|
Name of object #1 |
|
Checksum for object #1 |
… |
|
|
Name of object N |
|
Checksum for object N |
|
An object can therefore identify itself by comparing the initial
ANC_SUNW_CHECKSUM
to each of the ones that follow, until it finds a
match.