Add SHF_EXECINSTR attribute flag in logic to check Elf Text and Data section type. Also fix some typo in the code comments and Debug strings.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi <steven....@intel.com> --- BaseTools/Source/C/GenFw/Elf64Convert.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) mode change 100644 => 100755 BaseTools/Source/C/GenFw/Elf64Convert.c diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c old mode 100644 new mode 100755 index 024a2a0..7c838f3 --- a/BaseTools/Source/C/GenFw/Elf64Convert.c +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c @@ -75,7 +75,7 @@ CleanUp64 ( ); // -// Rename ELF32 strucutres to common names to help when porting to ELF64. +// Rename ELF32 structures to common names to help when porting to ELF64. // typedef Elf64_Shdr Elf_Shdr; typedef Elf64_Ehdr Elf_Ehdr; @@ -233,7 +233,7 @@ IsTextShdr ( Elf_Shdr *Shdr ) { - return (BOOLEAN) ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == SHF_ALLOC); + return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_WRITE | SHF_ALLOC)) == (SHF_EXECINSTR | SHF_ALLOC)); } STATIC @@ -256,7 +256,7 @@ IsDataShdr ( if (IsHiiRsrcShdr(Shdr)) { return FALSE; } - return (BOOLEAN) (Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == (SHF_ALLOC | SHF_WRITE); + return (BOOLEAN) (Shdr->sh_flags & (SHF_EXECINSTR | SHF_WRITE | SHF_ALLOC)) == (SHF_ALLOC | SHF_WRITE); } STATIC @@ -661,9 +661,9 @@ WriteSections64 ( default: // - // Ignore for unkown section type. + // Ignore for unknown section type. // - VerboseMsg ("%s unknown section type %x. We directly copy this section into Coff file", mInImageName, (unsigned)Shdr->sh_type); + VerboseMsg ("%s unknown section type %x. We directly ignore this section and NOT copy into Coff file", mInImageName, (unsigned)Shdr->sh_type); break; } } -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel