mirror of https://github.com/acidanthera/audk.git
Add more judgement.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2539 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
20798fc576
commit
d91b2da7fe
|
@ -340,7 +340,9 @@ ScanSections(
|
|||
// Align the coff offset to meet with the alignment requirement of section
|
||||
// itself.
|
||||
//
|
||||
CoffOffset = (CoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1);
|
||||
if ((shdr->sh_addralign != 0) && (shdr->sh_addralign != 1)) {
|
||||
CoffOffset = (CoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1);
|
||||
}
|
||||
|
||||
/* Relocate entry. */
|
||||
if ((Ehdr->e_entry >= shdr->sh_addr) &&
|
||||
|
@ -364,8 +366,10 @@ ScanSections(
|
|||
// Align the coff offset to meet with the alignment requirement of section
|
||||
// itself.
|
||||
//
|
||||
CoffOffset = (CoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1);
|
||||
|
||||
if ((shdr->sh_addralign != 0) && (shdr->sh_addralign != 1)) {
|
||||
CoffOffset = (CoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1);
|
||||
}
|
||||
|
||||
CoffSectionsOffset[i] = CoffOffset;
|
||||
CoffOffset += shdr->sh_size;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue