BaseTools: Fixed sh_addralign field in ELF files, removed useless checks in ImageTool.

This commit is contained in:
Mikhail Krichanov 2023-02-01 15:31:34 +03:00 committed by Vitaly Cheptsov
parent 8e6e4d1be4
commit 8e421ef0e3
2 changed files with 1 additions and 13 deletions

View File

@ -620,18 +620,6 @@ CreateIntermediate (
for (Index = 0; Index < mEhdr->e_shnum; ++Index) {
Shdr = GetShdrByIndex (Index);
if ((IsTextShdr (Shdr)) || (IsDataShdr (Shdr)) || (IsHiiRsrcShdr (Shdr))) {
if ((Shdr->sh_addralign == 0) || (Shdr->sh_addralign == 1)) {
fprintf (stderr, "ImageTool: Alignment field is invalid\n");
return RETURN_VOLUME_CORRUPTED;
}
if (!IS_ALIGNED(Shdr->sh_addr, Shdr->sh_addralign)) {
fprintf (stderr, "ImageTool: Section address not aligned to its own alignment\n");
return RETURN_VOLUME_CORRUPTED;
}
}
if ((IsTextShdr (Shdr)) || (IsDataShdr (Shdr))) {
++mImageInfo.SegmentInfo.NumSegments;
}

View File

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