summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C/GenFw/Elf64Convert.c
diff options
context:
space:
mode:
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.
//