MSC100ABIRM Motorola / Freescale Semiconductor, MSC100ABIRM Datasheet - Page 37

no-image

MSC100ABIRM

Manufacturer Part Number
MSC100ABIRM
Description
SC100 Application Binary Interface Reference Manual
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
4.3.4 Relocation
Each section which contains relocatable data has a corresponding relocation section of SHT_REL. The
sh_info field of the relocation section defines a section header index of the section to which the relocation
applies. The sh_link field of the rel section defines the associated symbol table. The relocation entry
definition is modified for the SC140. The r_offset field defines an address to which the relocation applies.
The r_info field specifies an offset into the string table of an expression, which, when evaluated, yields the
proper relocation data at the address given by r_offset.
A relocation entry is defined by Elf32_Rel in Example 4-4.
Example 4-4. Relocation Entry Defined with Elf32_Rel
4.3.4.1 Relocation Expression Format
Link file data expressions are generated when external or relocatable operands are encountered during
assembly or incremental link processing. For example, consider the assembly source in Example 4-5:
Example 4-5. Relocation Expression
The SC100 Assembler produces the following relocation expression for this line in the object file:
Since the value of symbol LA is not known to the assembler, it generates a two-word instruction and places
a relocation reference to the strings in (1) and (2) in the relocation entry section data. The strings in (1) and
(2) are called relocation expressions or relocations. A relocation is composed of legal C operators,
keyword identifiers defined by this document, and constant values. Note that the quotes are shown here to
represent a sequence of printable characters in the object file’s string table. The quotes are not required in
this context. The sequence of characters are not terminated by any special characters.
Relocations are case-sensitive. Symbols are referenced by the function “sym,” whose sole argument is the
symbol table index of the symbol from its respective compilation unit. Hence, “sym(7)” indicates that
“LA” is symbol number 7 in the symbol table for this example. “F1” and “F2” are architecture-dependent
encoding forms, whose definitions are specific to the SC140 DSP core.
The general form of a relocation is described by Example 4-6.
Example 4-6. Relocation Form
“field,field,...,field”
SC100 Application Binary Interface
typedef struct {
} Elf32_Rel;
move.w (sp+LA),d0
“check(sym(7),u,16), op | F1(sym(7))”
“check(sym(7),u,16), op | F2(sym(7))”
Elf32_Addr r_offset;
Elf32_Word r_info;
Preliminary (April 2000)
(1)
(2)
Interface Descriptions
4-5

Related parts for MSC100ABIRM