@@ -114,6 +114,7 @@ bool ObjectFileXCOFF::CreateBinary() {
114114 LLDB_LOG (log, " this = {0}, module = {1} ({2}), file = {3}, binary = {4}" ,
115115 this , GetModule ().get (), GetModule ()->GetSpecificationDescription (),
116116 m_file.GetPath (), m_binary.get ());
117+
117118 return true ;
118119}
119120
@@ -174,17 +175,8 @@ bool ObjectFileXCOFF::ParseHeader() {
174175 bool retVal = false ;
175176 ModuleSP module_sp (GetModule ());
176177 if (module_sp) {
177- std::lock_guard<std::recursive_mutex> guard (module_sp->GetMutex ());
178-
179- const auto *fileHeaderPtr = m_binary->fileHeader64 ();
180- m_xcoff_header = *fileHeaderPtr;
181- if (m_xcoff_header.Magic != 0 ) {
182- if (m_xcoff_header.AuxHeaderSize > 0 ) {
183- const auto *fileAuxHeader = m_binary->auxiliaryHeader64 ();
184- m_xcoff_aux_header = *fileAuxHeader;
185- }
178+ if (m_binary->fileHeader64 ()->Magic == XCOFF::XCOFF64)
186179 retVal = true ;
187- }
188180 }
189181
190182 return retVal;
@@ -195,11 +187,10 @@ ByteOrder ObjectFileXCOFF::GetByteOrder() const { return eByteOrderBig; }
195187bool ObjectFileXCOFF::IsExecutable () const { return true ; }
196188
197189uint32_t ObjectFileXCOFF::GetAddressByteSize () const {
198- if (m_xcoff_header.Magic == XCOFF::XCOFF64)
199- return 8 ;
200- else if (m_xcoff_header.Magic == XCOFF::XCOFF32)
201- return 4 ;
202- return 4 ;
190+
191+ /* TODO: Need to handle 32-bit support, until then
192+ * return 8 for 64-bit XCOFF::XCOFF64 */
193+ return 8 ;
203194}
204195
205196AddressClass ObjectFileXCOFF::GetAddressClass (addr_t file_addr) {
@@ -225,9 +216,9 @@ UUID ObjectFileXCOFF::GetUUID() { return UUID(); }
225216uint32_t ObjectFileXCOFF::GetDependentModules (FileSpecList &files) { return 0 ; }
226217
227218ObjectFile::Type ObjectFileXCOFF::CalculateType () {
228- if (m_xcoff_header. Flags & XCOFF::F_EXEC)
219+ if (m_binary-> fileHeader64 ()-> Flags & XCOFF::F_EXEC)
229220 return eTypeExecutable;
230- else if (m_xcoff_header. Flags & XCOFF::F_SHROBJ)
221+ else if (m_binary-> fileHeader64 ()-> Flags & XCOFF::F_SHROBJ)
231222 return eTypeSharedLibrary;
232223 return eTypeUnknown;
233224}
0 commit comments