Linker and Libraries Guide

Data Encoding

A file's data encoding specifies how to interpret the integer types in a file. Class ELFCLASS32 files and class ELFCLASS64 files use integers that occupy 1, 2, 4, and 8 bytes to represent offsets, addresses and other information. Under the defined encodings, objects are represented as described by the figures that follow. Byte numbers appear in the upper left corners.

ELFDATA2LSB encoding specifies 2's complement values, with the least significant byte occupying the lowest address. This encoding if often referred to informally as little endian.

Figure 7–2 Data Encoding ELFDATA2LSB

ELFDATA2LSB data encoding.

ELFDATA2MSB encoding specifies 2's complement values, with the most significant byte occupying the lowest address. This encoding if often referred to informally as big endian.

Figure 7–3 Data Encoding ELFDATA2MSB

ELFDATA2MSB data encoding.