BaseTools: Reduced minimal alignment to 32 bytes.

This commit is contained in:
Mikhail Krichanov 2023-02-28 09:57:25 +03:00 committed by MikhailKrichanov
parent 6117177c2e
commit 2bb2e22db8
6 changed files with 60 additions and 41 deletions

View File

@ -1858,7 +1858,7 @@ DEFINE GCC_ARM_CC_XIPFLAGS = -mno-unaligned-access
DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18 DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18
DEFINE GCC_AARCH64_CC_XIPFLAGS = -mstrict-align -mgeneral-regs-only DEFINE GCC_AARCH64_CC_XIPFLAGS = -mstrict-align -mgeneral-regs-only
DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie
DEFINE GCC_DLINK2_FLAGS_COMMON = -Wl,--default-script=$(EDK_TOOLS_PATH)/Scripts/Base.lds DEFINE GCC_DLINK2_FLAGS_COMMON = -Wl,--defsym=ALIGNED_PE_HEADER_SIZE=0x400,--default-script=$(EDK_TOOLS_PATH)/Scripts/Base.lds
DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
DEFINE GCC_LOONGARCH64_DLINK_COMMON= -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map DEFINE GCC_LOONGARCH64_DLINK_COMMON= -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
@ -1961,7 +1961,7 @@ DEFINE GCC5_ASLCC_FLAGS = DEF(GCC49_ASLCC_FLAGS) -fno-lto
DEFINE GCC5_RISCV_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -msmall-data-limit=0 DEFINE GCC5_RISCV_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -msmall-data-limit=0
DEFINE GCC5_RISCV_ALL_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z max-page-size=0x1000 DEFINE GCC5_RISCV_ALL_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z max-page-size=0x1000
DEFINE GCC5_RISCV_ALL_DLINK_FLAGS = DEF(GCC5_RISCV_ALL_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map DEFINE GCC5_RISCV_ALL_DLINK_FLAGS = DEF(GCC5_RISCV_ALL_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
DEFINE GCC5_RISCV_ALL_DLINK2_FLAGS =,--default-script=$(EDK_TOOLS_PATH)/Scripts/Base.lds DEFINE GCC5_RISCV_ALL_DLINK2_FLAGS = -Wl,--defsym=ALIGNED_PE_HEADER_SIZE=0x400,--default-script=$(EDK_TOOLS_PATH)/Scripts/Base.lds
DEFINE GCC5_RISCV_ALL_ASM_FLAGS = -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h DEFINE GCC5_RISCV_ALL_ASM_FLAGS = -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
DEFINE GCC5_RISCV_ALL_CC_FLAGS_WARNING_DISABLE = -Wno-tautological-compare -Wno-pointer-compare DEFINE GCC5_RISCV_ALL_CC_FLAGS_WARNING_DISABLE = -Wno-tautological-compare -Wno-pointer-compare
@ -2875,7 +2875,7 @@ DEFINE CLANGDWARF_IA32_PREFIX = ENV(CLANG_BIN)
DEFINE CLANGDWARF_X64_PREFIX = ENV(CLANG_BIN) DEFINE CLANGDWARF_X64_PREFIX = ENV(CLANG_BIN)
# LLVM/CLANG doesn't support -n link option. So, it can't share the same IA32_X64_DLINK_COMMON flag. # LLVM/CLANG doesn't support -n link option. So, it can't share the same IA32_X64_DLINK_COMMON flag.
DEFINE CLANGDWARF_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-q,--gc-sections -z max-page-size=0x1000 -Wl,-z,notext DEFINE CLANGDWARF_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-q,--gc-sections -z max-page-size=0x1000 -Wl,-z,notext,--defsym=ALIGNED_PE_HEADER_SIZE=0x400
DEFINE CLANGDWARF_IA32_X64_ASLDLINK_FLAGS = DEF(CLANGDWARF_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable DEFINE CLANGDWARF_IA32_X64_ASLDLINK_FLAGS = DEF(CLANGDWARF_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
DEFINE CLANGDWARF_IA32_X64_DLINK_FLAGS = DEF(CLANGDWARF_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive DEFINE CLANGDWARF_IA32_X64_DLINK_FLAGS = DEF(CLANGDWARF_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive
DEFINE CLANGDWARF_IA32_DLINK2_FLAGS = -no-pie DEFINE CLANGDWARF_IA32_DLINK2_FLAGS = -no-pie

View File

@ -459,6 +459,7 @@ CreateIntermediate (
SIndex = 0; SIndex = 0;
Relocs = NULL; Relocs = NULL;
NumRelocs = 0; NumRelocs = 0;
Pointer = 0;
for (Index = 0; Index < mEhdr->e_shnum; ++Index) { for (Index = 0; Index < mEhdr->e_shnum; ++Index) {
Shdr = GetShdrByIndex (Index); Shdr = GetShdrByIndex (Index);
@ -514,10 +515,6 @@ CreateIntermediate (
mImageInfo.RelocInfo.Relocs = Relocs; mImageInfo.RelocInfo.Relocs = Relocs;
} }
//
// Assume 4K alignment, which must be enough for all PE headers.
//
Pointer = mPeAlignment;
for (Index = 0; Index < mEhdr->e_shnum; ++Index) { for (Index = 0; Index < mEhdr->e_shnum; ++Index) {
Shdr = GetShdrByIndex (Index); Shdr = GetShdrByIndex (Index);
@ -546,12 +543,17 @@ CreateIntermediate (
memcpy (Segments[SIndex].Data, (UINT8 *)mEhdr + Shdr->sh_offset, (size_t)Shdr->sh_size); memcpy (Segments[SIndex].Data, (UINT8 *)mEhdr + Shdr->sh_offset, (size_t)Shdr->sh_size);
Segments[SIndex].ImageAddress = Pointer; Segments[SIndex].ImageAddress = Shdr->sh_addr;
Segments[SIndex].ImageSize = Segments[SIndex].DataSize; Segments[SIndex].ImageSize = Segments[SIndex].DataSize;
Segments[SIndex].Read = true; Segments[SIndex].Read = true;
Segments[SIndex].Write = false; Segments[SIndex].Write = false;
Segments[SIndex].Execute = true; Segments[SIndex].Execute = true;
Segments[SIndex].Type = ToolImageSectionTypeCode; Segments[SIndex].Type = ToolImageSectionTypeCode;
if (Pointer == 0) {
Pointer = Shdr->sh_addr;
}
Pointer += Segments[SIndex].DataSize; Pointer += Segments[SIndex].DataSize;
++SIndex; ++SIndex;
continue; continue;
@ -583,12 +585,17 @@ CreateIntermediate (
memcpy (Segments[SIndex].Data, (UINT8 *)mEhdr + Shdr->sh_offset, (size_t)Shdr->sh_size); memcpy (Segments[SIndex].Data, (UINT8 *)mEhdr + Shdr->sh_offset, (size_t)Shdr->sh_size);
} }
Segments[SIndex].ImageAddress = Pointer; Segments[SIndex].ImageAddress = Shdr->sh_addr;
Segments[SIndex].ImageSize = Segments[SIndex].DataSize; Segments[SIndex].ImageSize = Segments[SIndex].DataSize;
Segments[SIndex].Read = true; Segments[SIndex].Read = true;
Segments[SIndex].Write = true; Segments[SIndex].Write = true;
Segments[SIndex].Execute = false; Segments[SIndex].Execute = false;
Segments[SIndex].Type = ToolImageSectionTypeInitialisedData; Segments[SIndex].Type = ToolImageSectionTypeInitialisedData;
if (Pointer == 0) {
Pointer = Shdr->sh_addr;
}
Pointer += Segments[SIndex].DataSize; Pointer += Segments[SIndex].DataSize;
++SIndex; ++SIndex;
continue; continue;
@ -605,6 +612,11 @@ CreateIntermediate (
if (Shdr->sh_type == SHT_PROGBITS) { if (Shdr->sh_type == SHT_PROGBITS) {
memcpy (mImageInfo.HiiInfo.Data, (UINT8 *)mEhdr + Shdr->sh_offset, (size_t)Shdr->sh_size); memcpy (mImageInfo.HiiInfo.Data, (UINT8 *)mEhdr + Shdr->sh_offset, (size_t)Shdr->sh_size);
if (Pointer == 0) {
Pointer = Shdr->sh_addr;
}
SetHiiResourceHeader (mImageInfo.HiiInfo.Data, (UINT32)Pointer); SetHiiResourceHeader (mImageInfo.HiiInfo.Data, (UINT32)Pointer);
Pointer += mImageInfo.HiiInfo.DataSize; Pointer += mImageInfo.HiiInfo.DataSize;
} }

View File

@ -284,7 +284,8 @@ bool
ToolImageEmitPeSectionHeaders ( ToolImageEmitPeSectionHeaders (
const image_tool_pe_emit_context_t *Context, const image_tool_pe_emit_context_t *Context,
uint8_t **Buffer, uint8_t **Buffer,
uint32_t *BufferSize uint32_t *BufferSize,
uint32_t AlignedHeaderSize
) )
{ {
const image_tool_image_info_t *Image; const image_tool_image_info_t *Image;
@ -299,7 +300,7 @@ ToolImageEmitPeSectionHeaders (
Image = Context->Image; Image = Context->Image;
SectionHeadersSize = (uint16_t) (Image->SegmentInfo.NumSegments * sizeof (EFI_IMAGE_SECTION_HEADER)); SectionHeadersSize = (uint16_t) (Image->SegmentInfo.NumSegments * sizeof (EFI_IMAGE_SECTION_HEADER));
SectionOffset = ALIGN_VALUE (Context->HdrInfo.SizeOfHeaders, Context->FileAlignment); SectionOffset = AlignedHeaderSize;
Sections = (void *) *Buffer; Sections = (void *) *Buffer;
assert (SectionHeadersSize <= *BufferSize); assert (SectionHeadersSize <= *BufferSize);
@ -359,7 +360,8 @@ bool
ToolImageEmitPeExtraSectionHeaders ( ToolImageEmitPeExtraSectionHeaders (
image_tool_pe_emit_context_t *Context, image_tool_pe_emit_context_t *Context,
uint8_t **Buffer, uint8_t **Buffer,
uint32_t *BufferSize uint32_t *BufferSize,
uint32_t AlignedHeaderSize
) )
{ {
uint32_t SectionHeadersSize; uint32_t SectionHeadersSize;
@ -382,7 +384,7 @@ ToolImageEmitPeExtraSectionHeaders (
Section->SizeOfRawData = Context->HiiTableSize; Section->SizeOfRawData = Context->HiiTableSize;
Section->VirtualSize = Context->HiiTableSize; Section->VirtualSize = Context->HiiTableSize;
Section->Characteristics = EFI_IMAGE_SCN_CNT_INITIALIZED_DATA | EFI_IMAGE_SCN_MEM_READ; Section->Characteristics = EFI_IMAGE_SCN_CNT_INITIALIZED_DATA | EFI_IMAGE_SCN_MEM_READ;
Section->PointerToRawData = ALIGN_VALUE (Context->HdrInfo.SizeOfHeaders, Context->FileAlignment) + Context->SectionsSize; Section->PointerToRawData = AlignedHeaderSize + Context->SectionsSize;
Section->VirtualAddress = Section->PointerToRawData; Section->VirtualAddress = Section->PointerToRawData;
Context->PeHdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].Size = Context->HiiTableSize; Context->PeHdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].Size = Context->HiiTableSize;
@ -405,8 +407,7 @@ ToolImageEmitPeExtraSectionHeaders (
Section->VirtualSize = ALIGN_VALUE (Context->RelocTableSize, Context->FileAlignment); Section->VirtualSize = ALIGN_VALUE (Context->RelocTableSize, Context->FileAlignment);
Section->Characteristics = EFI_IMAGE_SCN_CNT_INITIALIZED_DATA Section->Characteristics = EFI_IMAGE_SCN_CNT_INITIALIZED_DATA
| EFI_IMAGE_SCN_MEM_DISCARDABLE | EFI_IMAGE_SCN_MEM_READ; | EFI_IMAGE_SCN_MEM_DISCARDABLE | EFI_IMAGE_SCN_MEM_READ;
Section->PointerToRawData = ALIGN_VALUE (Context->HdrInfo.SizeOfHeaders, Context->FileAlignment) Section->PointerToRawData = AlignedHeaderSize + Context->SectionsSize + Context->HiiTableSize;
+ Context->SectionsSize + Context->HiiTableSize;
Section->VirtualAddress = Section->PointerToRawData; Section->VirtualAddress = Section->PointerToRawData;
Context->PeHdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size = Context->RelocTableSize; Context->PeHdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size = Context->RelocTableSize;
@ -449,7 +450,8 @@ bool
ToolImageEmitPeHeaders ( ToolImageEmitPeHeaders (
image_tool_pe_emit_context_t *Context, image_tool_pe_emit_context_t *Context,
uint8_t **Buffer, uint8_t **Buffer,
uint32_t *BufferSize uint32_t *BufferSize,
uint32_t AlignedHeaderSize
) )
{ {
const image_tool_image_info_t *Image; const image_tool_image_info_t *Image;
@ -493,7 +495,7 @@ ToolImageEmitPeHeaders (
PePlusHdr->AddressOfEntryPoint = Image->HeaderInfo.EntryPointAddress; PePlusHdr->AddressOfEntryPoint = Image->HeaderInfo.EntryPointAddress;
PePlusHdr->SectionAlignment = Image->SegmentInfo.SegmentAlignment; PePlusHdr->SectionAlignment = Image->SegmentInfo.SegmentAlignment;
PePlusHdr->FileAlignment = Context->FileAlignment; PePlusHdr->FileAlignment = Context->FileAlignment;
PePlusHdr->SizeOfHeaders = Context->HdrInfo.SizeOfHeaders; PePlusHdr->SizeOfHeaders = AlignedHeaderSize;
PePlusHdr->ImageBase = (UINTN)Image->HeaderInfo.PreferredAddress; PePlusHdr->ImageBase = (UINTN)Image->HeaderInfo.PreferredAddress;
PePlusHdr->Subsystem = Image->HeaderInfo.Subsystem; PePlusHdr->Subsystem = Image->HeaderInfo.Subsystem;
PePlusHdr->NumberOfRvaAndSizes = Context->HdrInfo.NumberOfRvaAndSizes; PePlusHdr->NumberOfRvaAndSizes = Context->HdrInfo.NumberOfRvaAndSizes;
@ -508,20 +510,17 @@ ToolImageEmitPeHeaders (
*BufferSize -= sizeof (EFI_IMAGE_NT_HEADERS) + PePlusHdr->NumberOfRvaAndSizes * sizeof (EFI_IMAGE_DATA_DIRECTORY); *BufferSize -= sizeof (EFI_IMAGE_NT_HEADERS) + PePlusHdr->NumberOfRvaAndSizes * sizeof (EFI_IMAGE_DATA_DIRECTORY);
*Buffer += sizeof (EFI_IMAGE_NT_HEADERS) + PePlusHdr->NumberOfRvaAndSizes * sizeof (EFI_IMAGE_DATA_DIRECTORY); *Buffer += sizeof (EFI_IMAGE_NT_HEADERS) + PePlusHdr->NumberOfRvaAndSizes * sizeof (EFI_IMAGE_DATA_DIRECTORY);
Result = ToolImageEmitPeSectionHeaders (Context, Buffer, BufferSize); Result = ToolImageEmitPeSectionHeaders (Context, Buffer, BufferSize, AlignedHeaderSize);
if (!Result) { if (!Result) {
return false; return false;
} }
Result = ToolImageEmitPeExtraSectionHeaders (Context, Buffer, BufferSize); Result = ToolImageEmitPeExtraSectionHeaders (Context, Buffer, BufferSize, AlignedHeaderSize);
if (!Result) { if (!Result) {
return false; return false;
} }
HeaderPadding = ALIGN_VALUE_ADDEND( HeaderPadding = AlignedHeaderSize - Context->HdrInfo.SizeOfHeaders;
Context->HdrInfo.SizeOfHeaders,
Context->FileAlignment
);
assert (HeaderPadding <= *BufferSize); assert (HeaderPadding <= *BufferSize);
@ -897,6 +896,13 @@ ToolImageEmitPe (
return NULL; return NULL;
} }
if (AlignedHeaderSize > Image->SegmentInfo.Segments[0].ImageAddress) {
raise ();
return NULL;
}
AlignedHeaderSize = (uint32_t)Image->SegmentInfo.Segments[0].ImageAddress;
Result = EmitPeGetSectionsSize (&Context, &Context.SectionsSize); Result = EmitPeGetSectionsSize (&Context, &Context.SectionsSize);
if (!Result) { if (!Result) {
raise (); raise ();
@ -939,7 +945,7 @@ ToolImageEmitPe (
RemainingSize = Context.UnsignedFileSize; RemainingSize = Context.UnsignedFileSize;
ExpectedSize = Context.UnsignedFileSize; ExpectedSize = Context.UnsignedFileSize;
Result = ToolImageEmitPeHeaders (&Context, &Buffer, &RemainingSize); Result = ToolImageEmitPeHeaders (&Context, &Buffer, &RemainingSize, AlignedHeaderSize);
if (!Result) { if (!Result) {
raise (); raise ();
free (FileBuffer); free (FileBuffer);
@ -971,12 +977,9 @@ ToolImageEmitPe (
ExpectedSize -= Context.ExtraSectionsSize; ExpectedSize -= Context.ExtraSectionsSize;
assert (RemainingSize == ExpectedSize); assert (RemainingSize == ExpectedSize);
assert (RemainingSize == 0); assert (RemainingSize == 0);
Context.PeHdr->SizeOfHeaders = AlignedHeaderSize;
Context.PeHdr->SizeOfImage = Context.UnsignedFileSize; Context.PeHdr->SizeOfImage = Context.UnsignedFileSize;
Context.PeHdr->SizeOfInitializedData += Context.ExtraSectionsSize; Context.PeHdr->SizeOfInitializedData += Context.ExtraSectionsSize;
*FileSize = Context.UnsignedFileSize; *FileSize = Context.UnsignedFileSize;

View File

@ -13,7 +13,9 @@
SECTIONS { SECTIONS {
.text CONSTANT(MAXPAGESIZE) : ALIGN(CONSTANT(MAXPAGESIZE)) { . = ALIGNED_PE_HEADER_SIZE;
.text : ALIGN(CONSTANT(MAXPAGESIZE)) {
*(.text .text.* .stub .gnu.linkonce.t.*) *(.text .text.* .stub .gnu.linkonce.t.*)
} }

View File

@ -13,7 +13,9 @@
SECTIONS { SECTIONS {
.text CONSTANT(MAXPAGESIZE) : ALIGN(CONSTANT(MAXPAGESIZE)) { . = ALIGNED_PE_HEADER_SIZE;
.text : ALIGN(CONSTANT(MAXPAGESIZE)) {
*(.text .text.* .stub .gnu.linkonce.t.*) *(.text .text.* .stub .gnu.linkonce.t.*)
*(.rodata .rodata.* .data.rel.ro .data.rel.ro.* .gnu.linkonce.r.*) *(.rodata .rodata.* .data.rel.ro .data.rel.ro.* .gnu.linkonce.r.*)
*(.got .got.*) *(.got .got.*)

View File

@ -13,19 +13,19 @@
# #
# MDEPKG_REDUCE_FW_SIZE: # MDEPKG_REDUCE_FW_SIZE:
# Align boot-time images at a 1024 bytes boundary to reduce firmware size. # Align boot-time images at a 32 bytes boundary to reduce firmware size.
# #
!if $(MDEPKG_REDUCE_FW_SIZE) == TRUE !if $(MDEPKG_REDUCE_FW_SIZE) == TRUE
[BuildOptions] [BuildOptions]
MSFT:*_*_*_DLINK_FLAGS = /ALIGN:1024 MSFT:*_*_*_DLINK_FLAGS = /ALIGN:32
INTEL:*_*_*_DLINK_FLAGS = /ALIGN:1024 INTEL:*_*_*_DLINK_FLAGS = /ALIGN:32
CLANGPDB:*_*_*_DLINK_FLAGS = /ALIGN:1024 /FILEALIGN:1024 CLANGPDB:*_*_*_DLINK_FLAGS = /ALIGN:32 /FILEALIGN:32
GCC:*_*_*_DLINK_FLAGS = -z max-page-size=0x400 GCC:*_*_*_DLINK_FLAGS = -z max-page-size=0x20
CLANGGCC:*_*_*_DLINK_FLAGS = -z max-page-size=0x400 CLANGGCC:*_*_*_DLINK_FLAGS = -z max-page-size=0x20
XCODE:*_*_*_DLINK_FLAGS = -segalign 0x400 -seg1addr 0x400 XCODE:*_*_*_DLINK_FLAGS = -segalign 0x20 -seg1addr 0x400
XCODE:*_*_*_ASLDLINK_FLAGS = -segalign 0x400 -seg1addr 0x400 XCODE:*_*_*_ASLDLINK_FLAGS = -segalign 0x20 -seg1addr 0x400
XCODE:*_*_*_MTOC_FLAGS = -align 0x400 XCODE:*_*_*_MTOC_FLAGS = -align 0x20
!endif !endif
!if $(MDEPKG_MERGE_RODATA_INTO_TEXT) == TRUE !if $(MDEPKG_MERGE_RODATA_INTO_TEXT) == TRUE