Slight and cleanup and fix potential section leak.
This commit is contained in:
@@ -351,14 +351,13 @@ DwarfFile::Load(const char* fileName)
|
|||||||
fDebugLineSection = fElfFile->GetSection(".debug_line");
|
fDebugLineSection = fElfFile->GetSection(".debug_line");
|
||||||
fDebugFrameSection = fElfFile->GetSection(".debug_frame");
|
fDebugFrameSection = fElfFile->GetSection(".debug_frame");
|
||||||
ElfSection* ehFrameSection = fElfFile->GetSection(".eh_frame");
|
ElfSection* ehFrameSection = fElfFile->GetSection(".eh_frame");
|
||||||
if (fDebugFrameSection != NULL) {
|
if (fDebugFrameSection != NULL && ehFrameSection != NULL) {
|
||||||
if (ehFrameSection != NULL && ehFrameSection->Size()
|
if (ehFrameSection->Size() > fDebugFrameSection->Size()) {
|
||||||
> fDebugFrameSection->Size()) {
|
|
||||||
fElfFile->PutSection(fDebugFrameSection);
|
fElfFile->PutSection(fDebugFrameSection);
|
||||||
fDebugFrameSection = ehFrameSection;
|
fDebugFrameSection = ehFrameSection;
|
||||||
fUsingEHFrameSection = true;
|
fUsingEHFrameSection = true;
|
||||||
}
|
} else
|
||||||
|
fElfFile->PutSection(ehFrameSection);
|
||||||
} else if (ehFrameSection != NULL) {
|
} else if (ehFrameSection != NULL) {
|
||||||
fDebugFrameSection = ehFrameSection;
|
fDebugFrameSection = ehFrameSection;
|
||||||
fUsingEHFrameSection = true;
|
fUsingEHFrameSection = true;
|
||||||
@@ -370,6 +369,7 @@ DwarfFile::Load(const char* fileName)
|
|||||||
// .eh_frame sections. The ones generated by GCC 2 are writable,
|
// .eh_frame sections. The ones generated by GCC 2 are writable,
|
||||||
// the ones generated by GCC 4 aren't.
|
// the ones generated by GCC 4 aren't.
|
||||||
}
|
}
|
||||||
|
|
||||||
fDebugLocationSection = fElfFile->GetSection(".debug_loc");
|
fDebugLocationSection = fElfFile->GetSection(".debug_loc");
|
||||||
fDebugPublicTypesSection = fElfFile->GetSection(".debug_pubtypes");
|
fDebugPublicTypesSection = fElfFile->GetSection(".debug_pubtypes");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user