SVN commit r18077 ("BaseTools/GenFw: move .debug contents to .data to
save space") removed the separate .debug section after moving its
contents into .text or .data. However, this change does not take into
account that some of these contents need to appear at a 32-bit aligned
offset. So align the debug data RVA to 32 bits.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18443
6f19259b-4bc3-4df7-8a09-
765794883524
return (Offset + mCoffAlignment - 1) & ~(mCoffAlignment - 1);\r
}\r
\r
+STATIC\r
+UINT32\r
+DebugRvaAlign (\r
+ UINT32 Offset\r
+ )\r
+{\r
+ return (Offset + 3) & ~3;\r
+}\r
+\r
//\r
// filter functions\r
//\r
assert (FALSE);\r
}\r
\r
- mDebugOffset = mCoffOffset;\r
+ mDebugOffset = DebugRvaAlign(mCoffOffset);\r
\r
if (mEhdr->e_machine != EM_ARM) {\r
mCoffOffset = CoffAlign(mCoffOffset);\r
// section alignment.\r
//\r
if (SectionCount > 0) {\r
- mDebugOffset = mCoffOffset;\r
+ mDebugOffset = DebugRvaAlign(mCoffOffset);\r
}\r
mCoffOffset = mDebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY) +\r
sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY) +\r
return (Offset + mCoffAlignment - 1) & ~(mCoffAlignment - 1);\r
}\r
\r
+STATIC\r
+UINT32\r
+DebugRvaAlign (\r
+ UINT32 Offset\r
+ )\r
+{\r
+ return (Offset + 3) & ~3;\r
+}\r
+\r
//\r
// filter functions\r
//\r
assert (FALSE);\r
}\r
\r
- mDebugOffset = mCoffOffset;\r
+ mDebugOffset = DebugRvaAlign(mCoffOffset);\r
\r
if (mEhdr->e_machine != EM_ARM) {\r
mCoffOffset = CoffAlign(mCoffOffset);\r
// section alignment.\r
//\r
if (SectionCount > 0) {\r
- mDebugOffset = mCoffOffset;\r
+ mDebugOffset = DebugRvaAlign(mCoffOffset);\r
}\r
mCoffOffset = mDebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY) +\r
sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY) +\r