OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
MACH_SECTION Struct Reference

#include <AppleMachoImage.h>

Data Fields

CHAR8 SectionName [16]
 Name of this section.
 
CHAR8 SegmentName [16]
 segment this section goes in
 
UINT32 Address
 memory address of this section
 
UINT32 Size
 size in bytes of this section
 
UINT32 Offset
 file offset of this section
 
UINT32 Alignment
 section alignment (power of 2)
 
UINT32 RelocationsOffset
 file offset of relocation entries
 
UINT32 NumRelocations
 number of relocation entries
 
UINT32 Flags
 flags (section type and attributes)
 
UINT32 Reserved1
 reserved (for offset or index)
 
UINT32 Reserved2
 reserved (for count or sizeof)
 

Detailed Description

A segment is made up of zero or more sections. Non-MachHeaderFileTypeObject files have all of their segments with the proper sections in each, and padded to the Sectionecified segment alignment when produced by the link editor. The first segment of a MachHeaderFileTypeExecute and MachHeaderFileTypeFixedVmLib format file contains the MACH_HEADER and load commands of the object file before its first section. The zero fill sections are always last in their segment (in all formats). This allows the zeroed segment padding to be mapped into memory where zero fill sections might be. The gigabyte zero fill sections, those with the section type MachSectionTypeGigabyteZeroFill, can only be in a segment with sections of this type. These segments are then placed after all other segments.

The MachHeaderFileTypeObject format has all of its sections in one segment for compactness. There is no padding to a Sectionecified segment boundary and the MACH_HEADER and load commands are not part of the segment.

Sections with the same section Name, SectionName, going into the same segment, SegmentName, are combined by the link editor. The resulting section is aligned to the maximum alignment of the combined sections and is the new section's alignment. The combined sections are aligned to their original alignment in the combined section. Any padded bytes to get the Sectionecified alignment are zeroed.

The format of the relocation entries referenced by the reloff and nreloc fields of the section structure for mach object files is described in the header file <reloc.h>.

for 32-bit architectures

Definition at line 854 of file AppleMachoImage.h.

Field Documentation

◆ Address

UINT32 MACH_SECTION::Address

memory address of this section

Definition at line 857 of file AppleMachoImage.h.

◆ Alignment

UINT32 MACH_SECTION::Alignment

section alignment (power of 2)

Definition at line 860 of file AppleMachoImage.h.

◆ Flags

UINT32 MACH_SECTION::Flags

flags (section type and attributes)

Definition at line 863 of file AppleMachoImage.h.

◆ NumRelocations

UINT32 MACH_SECTION::NumRelocations

number of relocation entries

Definition at line 862 of file AppleMachoImage.h.

◆ Offset

UINT32 MACH_SECTION::Offset

file offset of this section

Definition at line 859 of file AppleMachoImage.h.

◆ RelocationsOffset

UINT32 MACH_SECTION::RelocationsOffset

file offset of relocation entries

Definition at line 861 of file AppleMachoImage.h.

◆ Reserved1

UINT32 MACH_SECTION::Reserved1

reserved (for offset or index)

Definition at line 864 of file AppleMachoImage.h.

◆ Reserved2

UINT32 MACH_SECTION::Reserved2

reserved (for count or sizeof)

Definition at line 865 of file AppleMachoImage.h.

◆ SectionName

CHAR8 MACH_SECTION::SectionName[16]

Name of this section.

Definition at line 855 of file AppleMachoImage.h.

◆ SegmentName

CHAR8 MACH_SECTION::SegmentName[16]

segment this section goes in

Definition at line 856 of file AppleMachoImage.h.

◆ Size

UINT32 MACH_SECTION::Size

size in bytes of this section

Definition at line 858 of file AppleMachoImage.h.


The documentation for this struct was generated from the following file: