mirror of https://github.com/acidanthera/audk.git
BaseTools: Check elf sections alignment with MAX_COFF_ALIGNMENT
Add the logic to check whether mCoffAlignment is larger than MAX_COFF_ALIGNMENT, and report error for it. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
d69e8a7b79
commit
3f02180031
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Elf32 Convert solution
|
Elf32 Convert solution
|
||||||
|
|
||||||
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
Portions copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
|
Portions copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials are licensed and made available
|
This program and the accompanying materials are licensed and made available
|
||||||
|
@ -383,6 +383,14 @@ ScanSections32 (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check if mCoffAlignment is larger than MAX_COFF_ALIGNMENT
|
||||||
|
//
|
||||||
|
if (mCoffAlignment > MAX_COFF_ALIGNMENT) {
|
||||||
|
Error (NULL, 0, 3000, "Invalid", "Section alignment is larger than MAX_COFF_ALIGNMENT.");
|
||||||
|
assert (FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Move the PE/COFF header right before the first section. This will help us
|
// Move the PE/COFF header right before the first section. This will help us
|
||||||
// save space when converting to TE.
|
// save space when converting to TE.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Elf64 convert solution
|
Elf64 convert solution
|
||||||
|
|
||||||
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
Portions copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>
|
Portions copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials are licensed and made available
|
This program and the accompanying materials are licensed and made available
|
||||||
|
@ -376,6 +376,15 @@ ScanSections64 (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check if mCoffAlignment is larger than MAX_COFF_ALIGNMENT
|
||||||
|
//
|
||||||
|
if (mCoffAlignment > MAX_COFF_ALIGNMENT) {
|
||||||
|
Error (NULL, 0, 3000, "Invalid", "Section alignment is larger than MAX_COFF_ALIGNMENT.");
|
||||||
|
assert (FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Move the PE/COFF header right before the first section. This will help us
|
// Move the PE/COFF header right before the first section. This will help us
|
||||||
// save space when converting to TE.
|
// save space when converting to TE.
|
||||||
|
|
Loading…
Reference in New Issue