mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-10 09:40:53 +01:00
optimize build messages
Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
parent
bcf0664267
commit
44164420e9
@ -528,12 +528,12 @@ ScanSections64 (
|
||||
//
|
||||
// List all sections.
|
||||
//
|
||||
for (i = 0; i < mEhdr->e_shnum; i++) {
|
||||
Elf_Shdr *shdr = GetShdrByIndex(i);
|
||||
Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
|
||||
CHAR8* sectName = ((CHAR8*)mEhdr) + Namedr->sh_offset + shdr->sh_name;
|
||||
NormalMsg("section %d %s sh_addr_in_memory_image=%llu(0x%llx) sh_offset_in_file=%llu(0x%llx) sh_size=%llu(0x%llx) sh_addralign=%llu sh_flags=0x%llx", i, sectName, shdr->sh_addr, shdr->sh_addr, shdr->sh_offset, shdr->sh_offset, shdr->sh_size, shdr->sh_size, shdr->sh_addralign, shdr->sh_flags);
|
||||
}
|
||||
// for (i = 0; i < mEhdr->e_shnum; i++) {
|
||||
// Elf_Shdr *shdr = GetShdrByIndex(i);
|
||||
// Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
|
||||
// CHAR8* sectName = ((CHAR8*)mEhdr) + Namedr->sh_offset + shdr->sh_name;
|
||||
// NormalMsg("section %d %s sh_addr_in_memory_image=%llu(0x%llx) sh_offset_in_file=%llu(0x%llx) sh_size=%llu(0x%llx) sh_addralign=%llu sh_flags=0x%llx", i, sectName, shdr->sh_addr, shdr->sh_addr, shdr->sh_offset, shdr->sh_offset, shdr->sh_size, shdr->sh_size, shdr->sh_addralign, shdr->sh_flags);
|
||||
// }
|
||||
|
||||
|
||||
//
|
||||
@ -546,17 +546,17 @@ ScanSections64 (
|
||||
SectionCount = 0;
|
||||
for (i = 0; i < mEhdr->e_shnum; i++) {
|
||||
Elf_Shdr *shdr = GetShdrByIndex(i);
|
||||
/*debug*/Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
|
||||
/*debug*/CHAR8* sectName = ((CHAR8*)mEhdr) + Namedr->sh_offset + shdr->sh_name;
|
||||
// /*debug*/Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
|
||||
// /*debug*/CHAR8* sectName = ((CHAR8*)mEhdr) + Namedr->sh_offset + shdr->sh_name;
|
||||
if (IsTextShdr(shdr)) {
|
||||
if ((shdr->sh_addralign != 0) && (shdr->sh_addralign != 1)) {
|
||||
// the alignment field is valid
|
||||
if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
|
||||
// if the section address is aligned we must align PE/COFF
|
||||
UINT32 mCoffOffsetNew = (UINT32) ((shdr->sh_addr + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
|
||||
mCoffOffset = (UINT32) ((mCoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
|
||||
printf("Section %d %s mCoffOffset=%d(0x%x) mCoffOffsetNew=%d(0x%x) diff=%d(0x%x), size=%llu\n", i, sectName, mCoffOffset, mCoffOffset, mCoffOffsetNew, mCoffOffsetNew, mCoffOffsetNew-mCoffOffset, mCoffOffsetNew-mCoffOffset, shdr->sh_size);
|
||||
mCoffOffset=mCoffOffsetNew;
|
||||
// mCoffOffset = (UINT32) ((mCoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
|
||||
//printf("Section %d %s mCoffOffset=%d(0x%x) mCoffOffsetNew=%d(0x%x) diff=%d(0x%x), size=%llu\n", i, sectName, mCoffOffset, mCoffOffset, mCoffOffsetNew, mCoffOffsetNew, mCoffOffsetNew-mCoffOffset, mCoffOffsetNew-mCoffOffset, shdr->sh_size);
|
||||
mCoffOffset=mCoffOffsetNew;
|
||||
} else {
|
||||
Error (NULL, 0, 3000, "Invalid", "Section address not aligned to its own alignment.");
|
||||
}
|
||||
@ -603,17 +603,17 @@ mCoffOffset=mCoffOffsetNew;
|
||||
SectionCount = 0;
|
||||
for (i = 0; i < mEhdr->e_shnum; i++) {
|
||||
Elf_Shdr *shdr = GetShdrByIndex(i);
|
||||
/*debug*/Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
|
||||
/*debug*/CHAR8* sectName = ((CHAR8*)mEhdr) + Namedr->sh_offset + shdr->sh_name;
|
||||
// /*debug*/Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
|
||||
// /*debug*/CHAR8* sectName = ((CHAR8*)mEhdr) + Namedr->sh_offset + shdr->sh_name;
|
||||
if (IsDataShdr(shdr)) {
|
||||
if ((shdr->sh_addralign != 0) && (shdr->sh_addralign != 1)) {
|
||||
// the alignment field is valid
|
||||
if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
|
||||
// if the section address is aligned we must align PE/COFF
|
||||
UINT32 mCoffOffsetNew = (UINT32) ((shdr->sh_addr + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
|
||||
mCoffOffset = (UINT32) ((mCoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
|
||||
printf("Section %d %s mCoffOffset=%d(0x%x) mCoffOffsetNew=%d(0x%x) diff=%d(0x%x), size=%llu\n", i, sectName, mCoffOffset, mCoffOffset, mCoffOffsetNew, mCoffOffsetNew, mCoffOffsetNew-mCoffOffset, mCoffOffsetNew-mCoffOffset, shdr->sh_size);
|
||||
mCoffOffset=mCoffOffsetNew;
|
||||
// mCoffOffset = (UINT32) ((mCoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
|
||||
//printf("Section %d %s mCoffOffset=%d(0x%x) mCoffOffsetNew=%d(0x%x) diff=%d(0x%x), size=%llu\n", i, sectName, mCoffOffset, mCoffOffset, mCoffOffsetNew, mCoffOffsetNew, mCoffOffsetNew-mCoffOffset, mCoffOffsetNew-mCoffOffset, shdr->sh_size);
|
||||
mCoffOffset=mCoffOffsetNew;
|
||||
} else {
|
||||
Error (NULL, 0, 3000, "Invalid", "Section address not aligned to its own alignment.");
|
||||
}
|
||||
|
@ -33,6 +33,13 @@
|
||||
9AD17D122559286800D22C6A /* Elf64Convert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Elf64Convert.c; sourceTree = "<group>"; };
|
||||
9AD17D142559286F00D22C6A /* ElfConvert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ElfConvert.c; sourceTree = "<group>"; };
|
||||
9AD17D162559287800D22C6A /* GenFw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GenFw.c; sourceTree = "<group>"; };
|
||||
A587244A27AFAD3A000532A2 /* elf_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = elf_common.h; sourceTree = "<group>"; };
|
||||
A587244B27AFAD3A000532A2 /* elf32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = elf32.h; sourceTree = "<group>"; };
|
||||
A587244E27AFAD45000532A2 /* Elf32Convert.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Elf32Convert.h; sourceTree = "<group>"; };
|
||||
A587244F27AFAD50000532A2 /* elf64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = elf64.h; sourceTree = "<group>"; };
|
||||
A587245027AFAD5E000532A2 /* Elf64Convert.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Elf64Convert.h; sourceTree = "<group>"; };
|
||||
A587245127AFAD77000532A2 /* ElfConvert.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ElfConvert.h; sourceTree = "<group>"; };
|
||||
A587245227AFAD82000532A2 /* GenFw.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GenFw.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -66,10 +73,17 @@
|
||||
9A9A3A892559281200B97949 /* GenFw */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A587244F27AFAD50000532A2 /* elf64.h */,
|
||||
9AD17D102559286100D22C6A /* Elf32Convert.c */,
|
||||
A587244E27AFAD45000532A2 /* Elf32Convert.h */,
|
||||
A587244A27AFAD3A000532A2 /* elf_common.h */,
|
||||
A587244B27AFAD3A000532A2 /* elf32.h */,
|
||||
9AD17D122559286800D22C6A /* Elf64Convert.c */,
|
||||
A587245027AFAD5E000532A2 /* Elf64Convert.h */,
|
||||
9AD17D142559286F00D22C6A /* ElfConvert.c */,
|
||||
A587245127AFAD77000532A2 /* ElfConvert.h */,
|
||||
9AD17D162559287800D22C6A /* GenFw.c */,
|
||||
A587245227AFAD82000532A2 /* GenFw.h */,
|
||||
9AC31D3625592B0400ABC5D3 /* libCommon.a */,
|
||||
);
|
||||
name = GenFw;
|
||||
|
@ -148,17 +148,17 @@ class BuildFile(object):
|
||||
## cp if exist
|
||||
_CP_TEMPLATE_ = {
|
||||
WIN32_PLATFORM : 'if exist %(Src)s $(CP) %(Src)s %(Dst)s',
|
||||
POSIX_PLATFORM : "test -f %(Src)s && $(CP) %(Src)s %(Dst)s"
|
||||
POSIX_PLATFORM : "@test -f %(Src)s && $(CP) %(Src)s %(Dst)s"
|
||||
}
|
||||
|
||||
_CD_TEMPLATE_ = {
|
||||
WIN32_PLATFORM : 'if exist %(dir)s cd %(dir)s',
|
||||
POSIX_PLATFORM : "test -e %(dir)s && cd %(dir)s"
|
||||
POSIX_PLATFORM : "@test -e %(dir)s && cd %(dir)s"
|
||||
}
|
||||
|
||||
_MAKE_TEMPLATE_ = {
|
||||
WIN32_PLATFORM : 'if exist %(file)s "$(MAKE)" $(MAKE_FLAGS) -f %(file)s',
|
||||
POSIX_PLATFORM : 'test -e %(file)s && "$(MAKE)" $(MAKE_FLAGS) -f %(file)s'
|
||||
POSIX_PLATFORM : '@test -e %(file)s && @"$(MAKE)" $(MAKE_FLAGS) -f %(file)s'
|
||||
}
|
||||
|
||||
_INCLUDE_CMD_ = {
|
||||
@ -776,12 +776,12 @@ AT = $(AT_$(V))
|
||||
self.BuildTargetList.append('%s : %s' % (OutputFile, DepsFileString))
|
||||
CmdString = ' '.join(FfsCmdList).strip()
|
||||
CmdString = self.ReplaceMacro(CmdString)
|
||||
self.BuildTargetList.append('\t%s' % CmdString)
|
||||
self.BuildTargetList.append('\t@%s' % CmdString)
|
||||
|
||||
self.ParseSecCmd(DepsFileList, Cmd[1])
|
||||
for SecOutputFile, SecDepsFile, SecCmd in self.FfsOutputFileList :
|
||||
self.BuildTargetList.append('%s : %s' % (self.ReplaceMacro(SecOutputFile), self.ReplaceMacro(SecDepsFile)))
|
||||
self.BuildTargetList.append('\t%s' % self.ReplaceMacro(SecCmd))
|
||||
self.BuildTargetList.append('\t@%s' % self.ReplaceMacro(SecCmd))
|
||||
self.FfsOutputFileList = []
|
||||
|
||||
def ParseSecCmd(self, OutputFileList, CmdTuple):
|
||||
|
Loading…
Reference in New Issue
Block a user