From d8d3f3705db08b2ddebf530f94d1d9ff8461f903 Mon Sep 17 00:00:00 2001 From: Jason Hiser <jdhiser@gmail.com> Date: Tue, 26 Jun 2018 07:20:29 -0700 Subject: [PATCH] changes to compile on ubuntu18, minor code cleanups Former-commit-id: 17c7940dad7e7f4be5e362d16b243a7aa6e9710e --- .../Includes/instr_set/opcodes_Grp12.c | 2 +- .../beaengineSources/Includes/instr_set/opcodes_MMX.c | 2 +- libEXEIO/include/exeio_pe.h | 3 +++ libEXEIO/src/exeio_src.cpp | 1 + libIRDB/test/fill_in_indtargs.cpp | 4 ++-- pebliss/trunk/pe_lib/SConscript | 3 +-- tools/spasm/spasm.cpp | 10 +++++----- tools/spasm/spasm.h | 4 ++-- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp12.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp12.c index d762c3dcb..c850c0871 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp12.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_Grp12.c @@ -52,7 +52,7 @@ void __bea_callspec__ G12_(PDISASM pMyDisasm) #ifndef BEA_LIGHT_DISASSEMBLY if(GV.VEX.has_vex) (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); - (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psrlw "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "psrlw "); #endif } else { diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_MMX.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_MMX.c index ca90d90f2..26f5df5bc 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_MMX.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_MMX.c @@ -735,7 +735,7 @@ void __bea_callspec__ pand_(PDISASM pMyDisasm) #ifndef BEA_LIGHT_DISASSEMBLY if(GV.VEX.has_vex) (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "v"); - (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "pand "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "pand "); #endif GV.AVX_ = GV.VEX.length; GV.SSE_ = !GV.VEX.length; diff --git a/libEXEIO/include/exeio_pe.h b/libEXEIO/include/exeio_pe.h index 5b43cdea0..614f2df01 100644 --- a/libEXEIO/include/exeio_pe.h +++ b/libEXEIO/include/exeio_pe.h @@ -6,7 +6,10 @@ #include <vector> #include <assert.h> #include <fstream> + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include <pe_bliss.h> +#pragma GCC diagnostic pop class exeio_backend; diff --git a/libEXEIO/src/exeio_src.cpp b/libEXEIO/src/exeio_src.cpp index 605c59edf..94f6cb5db 100644 --- a/libEXEIO/src/exeio_src.cpp +++ b/libEXEIO/src/exeio_src.cpp @@ -7,6 +7,7 @@ #include <exeio_pe.h> + using namespace EXEIO; using namespace std; #ifndef SOLARIS diff --git a/libIRDB/test/fill_in_indtargs.cpp b/libIRDB/test/fill_in_indtargs.cpp index fc7d2762d..6628eb46d 100644 --- a/libIRDB/test/fill_in_indtargs.cpp +++ b/libIRDB/test/fill_in_indtargs.cpp @@ -1714,9 +1714,9 @@ void calc_preds(FileIR_t* firp) ) { Instruction_t* insn=*it; - if(insn->GetTarget()); + if(insn->GetTarget()) preds[insn->GetTarget()].insert(insn); - if(insn->GetFallthrough()); + if(insn->GetFallthrough()) preds[insn->GetFallthrough()].insert(insn); } } diff --git a/pebliss/trunk/pe_lib/SConscript b/pebliss/trunk/pe_lib/SConscript index 32f9fa6f7..3a8a79d46 100644 --- a/pebliss/trunk/pe_lib/SConscript +++ b/pebliss/trunk/pe_lib/SConscript @@ -50,9 +50,8 @@ cpppath=''' . ''' -#myenv.Append(CCFLAGS=" -Wall -W -Wextra -Wconversion ") - myenv=myenv.Clone(CPPPATH=Split(cpppath)) +myenv.Append(CCFLAGS=" -w ") lib=myenv.Library(libname, Split(files)) install=myenv.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib) diff --git a/tools/spasm/spasm.cpp b/tools/spasm/spasm.cpp index acb9f8b47..61db94e26 100755 --- a/tools/spasm/spasm.cpp +++ b/tools/spasm/spasm.cpp @@ -122,12 +122,12 @@ static void resolveSymbols(const string &mapFile); //static vector<bin_instruction_t> parseBin(const string &binFile); //static vector<string> getSPRI(const vector<bin_instruction_t> &bin, const vector<spasmline_t> &spasmlines, const string &symbolFilename); //static void printVector(const string &outputFile, const vector<string> &lines); -static uintptr_t getSymbolAddress(const string &symbolFilename, const string &symbol) throw(exception); +static uintptr_t getSymbolAddress(const string &symbolFilename, const string &symbol) ; // // @todo: need to cache results // -static string getCallbackAddress(const string &symbolFilename, const string &symbol) throw(exception) +static string getCallbackAddress(const string &symbolFilename, const string &symbol) { char buf[30]; int diff=getSymbolAddress(symbolFilename, symbol) @@ -138,7 +138,7 @@ static string getCallbackAddress(const string &symbolFilename, const string &sym } -static uintptr_t getSymbolAddress(const string &symbolFilename, const string &symbol) throw(exception) +static uintptr_t getSymbolAddress(const string &symbolFilename, const string &symbol) { string symbolFullName = symbolFilename + "+" + symbol; map<string,string>::iterator callbackMapIterator; @@ -180,9 +180,9 @@ bool fexists(const string &filename) } -//void a2bspri(const string &input, const string &output, const string &symbolFilename) throw(exception) +//void a2bspri(const string &input, const string &output, const string &symbolFilename) void a2bspri(const vector<string> &input,const string &outFilename, const string &exeFilename, - const string &symbolFilename) throw(exception) + const string &symbolFilename) { assert(fexists(symbolFilename)); diff --git a/tools/spasm/spasm.h b/tools/spasm/spasm.h index 8d4adf0f6..2926635cd 100644 --- a/tools/spasm/spasm.h +++ b/tools/spasm/spasm.h @@ -26,9 +26,9 @@ #include <exception> #include <vector> -//void a2bspri(const std::string &input, const std::string &output, const std::string &elfFile) throw(std::exception); +//void a2bspri(const std::string &input, const std::string &output, const std::string &elfFile) ; void a2bspri(const std::vector<std::string> &input,const std::string &outFilename, - const std::string &exeFilename, const std::string &symbolFilename) throw(std::exception); + const std::string &exeFilename, const std::string &symbolFilename) ; class SpasmException: public std::exception { -- GitLab