mirror of
https://github.com/acidanthera/audk.git
synced 2025-09-23 17:57:45 +02:00
BaseTools: Fixed sh_addralign field in ELF files, removed useless checks in ImageTool.
This commit is contained in:
parent
8e6e4d1be4
commit
8e421ef0e3
@ -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;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
SECTIONS {
|
||||
|
||||
.text CONSTANT(MAXPAGESIZE) : {
|
||||
.text CONSTANT(MAXPAGESIZE) : ALIGN(CONSTANT(MAXPAGESIZE)) {
|
||||
*(.text .text.* .stub .gnu.linkonce.t.*)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user