summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C/GenFw/Elf64Convert.c
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2011-05-11 10:26:49 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2011-05-11 10:26:49 +0000
commitda92f27632d2c89fa8726948ac9b02461ca8b61e (patch)
tree5d81f058c42e5be0d57287a7ddd8e3e4325eda7a /BaseTools/Source/C/GenFw/Elf64Convert.c
parente472e8d3cca67f5e058f26fb6edc214b01114a3c (diff)
downloadedk2-platforms-da92f27632d2c89fa8726948ac9b02461ca8b61e.tar.xz
Sync BaseTools Branch (version r2149) to EDKII main trunk.
BaseTool Branch: https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/branches/Releases/BaseTools_r2100 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11640 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/C/GenFw/Elf64Convert.c')
-rw-r--r--BaseTools/Source/C/GenFw/Elf64Convert.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c
index 7c2e87e68b..fbe6ff8232 100644
--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -256,6 +256,7 @@ ScanSections64 (
EFI_IMAGE_DOS_HEADER *DosHdr;
EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
UINT32 CoffEntry;
+ UINT32 SectionCount;
CoffEntry = 0;
mCoffOffset = 0;
@@ -284,6 +285,7 @@ ScanSections64 (
//
mCoffOffset = CoffAlign(mCoffOffset);
mTextOffset = mCoffOffset;
+ SectionCount = 0;
for (i = 0; i < mEhdr->e_shnum; i++) {
Elf_Shdr *shdr = GetShdrByIndex(i);
if (IsTextShdr(shdr)) {
@@ -308,6 +310,7 @@ ScanSections64 (
}
mCoffSectionsOffset[i] = mCoffOffset;
mCoffOffset += (UINT32) shdr->sh_size;
+ SectionCount ++;
}
}
@@ -315,10 +318,15 @@ ScanSections64 (
mCoffOffset = CoffAlign(mCoffOffset);
}
+ if (SectionCount > 1 && mOutImageType == FW_EFI_IMAGE) {
+ Warning (NULL, 0, 0, NULL, "Mulitple sections in %s are merged into 1 text section. Source level debug might not work correctly.", mInImageName);
+ }
+
//
// Then data sections.
//
mDataOffset = mCoffOffset;
+ SectionCount = 0;
for (i = 0; i < mEhdr->e_shnum; i++) {
Elf_Shdr *shdr = GetShdrByIndex(i);
if (IsDataShdr(shdr)) {
@@ -337,10 +345,15 @@ ScanSections64 (
}
mCoffSectionsOffset[i] = mCoffOffset;
mCoffOffset += (UINT32) shdr->sh_size;
+ SectionCount ++;
}
}
mCoffOffset = CoffAlign(mCoffOffset);
+ if (SectionCount > 1 && mOutImageType == FW_EFI_IMAGE) {
+ Warning (NULL, 0, 0, NULL, "Mulitple sections in %s are merged into 1 data section. Source level debug might not work correctly.", mInImageName);
+ }
+
//
// The HII resource sections.
//