Added ELF sections check so a potential unknown section will stop, or not stop, the...
[clinton/Virtual-Jaguar-Rx.git] / src / file.cpp
index 7e9fb34..a296bd0 100644 (file)
 // Who  When        What\r
 // ---  ----------  ------------------------------------------------------------\r
 // JLH  01/16/2010  Created this log ;-)\r
-// JLH  02/28/2010  Added functions to look inside .ZIP files and handle\r
-//                  contents\r
+// JLH  02/28/2010  Added functions to look inside .ZIP files and handle contents\r
 // JLH  06/01/2012  Added function to check ZIP file CRCs against file DB\r
-// JPM  06/06/2016  Visual Studio support\r
-// JPM  06/15/2016  ELF format support\r
-// JPM  06/19/2016  Soft debugger support\r
+// JPM   June/2016  Visual Studio support, ELF format support and Soft debugger support\r
 // JPM  07/15/2016  DWARF format support\r
+// JPM  04/06/2019  Added ELF sections check\r
 //\r
 \r
 #include "file.h"\r
 #include "libelf/libelf.h"\r
 #include "libelf/gelf.h"\r
 #include "libdwarf.h"\r
-<<<<<<< HEAD\r
 #include "debugger/ELFManager.h"\r
 #include "debugger/DBGManager.h"\r
-=======\r
-#include "debugger\ELFManager.h"\r
-#include "debugger\DBGManager.h"\r
->>>>>>> origin/master\r
+#include "settings.h"\r
 \r
 \r
 // Private function prototypes\r
@@ -227,11 +221,11 @@ WriteLog("FILE: Cartridge run address is reported as $%X...\n", jaguarRunAddress
                                                        else\r
                                                        {\r
                                                                NameSection = elf_strptr(ElfMem, PtrGElfEhdr->e_shstrndx, (size_t)PtrGElfShdr->sh_name);\r
-                                                               WriteLog("FILE: ELF Section name: %s\n", NameSection);\r
+                                                               WriteLog("FILE: ELF Section %s found\n", NameSection);\r
 \r
-                                                               if ((ElfSectionNameType = ELFManager_GetSectionType(NameSection)) == ELF_NO_TYPE)\r
+                                                               if (((ElfSectionNameType = ELFManager_GetSectionType(NameSection)) == ELF_NO_TYPE) && vjs.ELFSectionsCheck)\r
                                                                {\r
-                                                                       WriteLog("FILE: ELF Section not listed\n");\r
+                                                                       WriteLog("FILE: ELF Section %s not recognized\n", NameSection);\r
                                                                        error = true;\r
                                                                }\r
                                                                else\r
@@ -268,6 +262,9 @@ WriteLog("FILE: Cartridge run address is reported as $%X...\n", jaguarRunAddress
                                                                                        case ELF_debug_loc_TYPE:\r
                                                                                                break;\r
 \r
+                                                                                       case ELF_heap_TYPE:\r
+                                                                                               break;\r
+\r
                                                                                        case ELF_comment_TYPE:\r
                                                                                                break;\r
 \r