Linker and Libraries Guide

Move Section

If an element of a huge array is initialized, data for the entire array is wriiten to the object file. The size of relocatable object files or executable files could be huge. The section SHT_SUNW_move has been introduced to help compress these files.

Objects created by the compilers or by the link-editors can contain move section for partially initialized symbols. This section is defined by the type SHT_SUNW_move. This section contains the multiple entries of the type ELF32_Move or Elf64_Move, which are defined as follows:


typedef struct {
        Elf32_Lword		 m_value;
        Elf32_Word      m_info;
        Elf32_Word      m_poffset;
        Elf32_Half      m_repeat;
        Elf32_Half      m_stride;
} Elf32_Move;

#define ELF32_M_SYM(info)       ((info)>>8)
#define ELF32_M_SIZE(info)      ((unsigned char)(info))
#define ELF32_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size))

typedef struct {
        Elf64_Lword     m_value;
        Elf64_Xword     m_info;
        Elf64_Xword     m_poffset;
        Elf64_Half      m_repeat;
        Elf64_Half      m_stride;
} Elf64_Move;
#define ELF64_M_SYM(info)       ((info)>>8)
#define ELF64_M_SIZE(info)      ((unsigned char)(info))
#define ELF64_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size))

m_poffset

This is a offset relative to the symbol.

m_info

This member gives both the symbol table index, with respect to which the move must be made, and the size of the object to be moved in bytes. The lower 8 bits of the member holds the size and the upper bytes hold the symbol index. The size can be 1, 2, 4 or 8.

m_repeat

This member gives the repetition count.

m_stride

This member gives the stride unit value. This member gives how many units should be skipped to perform the initilization. If the value is 0, it means that the initialization will be performed contiguously for m_repeat units.

m_value

This member gives the initialization value.