diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-04-05 08:18:50 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-04-05 08:18:50 +0000 |
commit | d91b2da7fea2cc9e47232a2e49aac1c5ff832ef2 (patch) | |
tree | a114ea6fa8b9fc0d0015a12b937e0aaaf93ef77b | |
parent | 20798fc5762b54f27173370ebcc976cd45e506bf (diff) | |
download | edk2-d91b2da7fea2cc9e47232a2e49aac1c5ff832ef2.zip edk2-d91b2da7fea2cc9e47232a2e49aac1c5ff832ef2.tar.gz edk2-d91b2da7fea2cc9e47232a2e49aac1c5ff832ef2.tar.bz2 |
Add more judgement.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2539 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | Tools/CCode/Source/FwImage/fwimage.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Tools/CCode/Source/FwImage/fwimage.c b/Tools/CCode/Source/FwImage/fwimage.c index 1109095..97229ce 100644 --- a/Tools/CCode/Source/FwImage/fwimage.c +++ b/Tools/CCode/Source/FwImage/fwimage.c @@ -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; } |