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