Commit eaa8aa10 authored by Cédric VALENSI's avatar Cédric VALENSI

Sync

parent 54c7f8b1
Pipeline #2 failed with stages
##
# Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
# Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
#
# This file is part of MAQAO.
#
......@@ -318,8 +318,8 @@ find_path(RPMBUILD_PATH NAMES rpmbuild) # look for rpmbuild
find_path(DPKG_DEB_PATH NAMES dpkg-deb) # look for dpkg-deb
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "6")
SET(CPACK_PACKAGE_VERSION_PATCH "4")
SET(CPACK_PACKAGE_VERSION_MINOR "7")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
# ---- Check if at least one package generator has been found
IF ((NOT (${RPMBUILD_PATH} STREQUAL "RPMBUILD_PATH-NOTFOUND"))
......
===============================================================================
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
MAQAO is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
......
......@@ -5,7 +5,7 @@ MAQAO (Modular Assembly Quality Analyzer and Optimizer)
The following packages and softwares have to be installed before launching the installation:
- gcc
- g++
- cmake (>= 2.8.8, available at http://www.cmake.org/cmake/resources/software.html)
- cmake (>= 2.8.12, available at http://www.cmake.org/cmake/resources/software.html)
- glibc-static
- libstdc++-static
If you choose the original lua package (and not luajit) then you will also need:
......@@ -13,6 +13,8 @@ If you choose the original lua package (and not luajit) then you will also need:
- libncurses-dev
To produce XLSX files using MAQAO, you need:
- zip
To enable call stack collection in LProf:
- libunwind-dev
##### Installation #####
MAQAO is a cmake based project.
......
##
# Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
# Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
#
# This file is part of MAQAO.
#
......
.\" File generated using by MAQAO.
.TH MAQAO-ANALYZE "1" "2018/10/12" "MAQAO-ANALYZE 2.6.0" "User Commands"
.TH MAQAO-ANALYZE "1" "2019/01/23" "MAQAO-ANALYZE 2.7.0" "User Commands"
.SH NAME
maqao-analyze \- manual page for maqao analyze module.
.SH SYNOPSIS
......@@ -139,7 +139,7 @@ Written by The MAQAO team.
.SH "REPORTING BUGS"
Report bugs to <contact@maqao.org>.
.SH COPYRIGHT
MAQAO (C), 2004-2018 Universite de Versailles Saint-Quentin-en-Yvelines (UVSQ),
MAQAO (C), 2004-2019 Universite de Versailles Saint-Quentin-en-Yvelines (UVSQ),
is distributed under the GNU Lesser General Public License (GNU LGPL). MAQAO is
free software; you can use it under the terms of the GNU Lesser General
Public License as published by the Free Software Foundation; either version 2.1
......
.\" File generated using by MAQAO.
.TH MAQAO-MADRAS "1" "2018/10/12" "MAQAO-MADRAS 2.6.0" "User Commands"
.TH MAQAO-MADRAS "1" "2019/01/23" "MAQAO-MADRAS 2.7.0" "User Commands"
.SH NAME
maqao-madras \- manual page for maqao madras module.
.SH SYNOPSIS
......@@ -165,7 +165,7 @@ Written by The MAQAO team.
.SH "REPORTING BUGS"
Report bugs to <contact@maqao.org>.
.SH COPYRIGHT
MAQAO (C), 2004-2018 Universite de Versailles Saint-Quentin-en-Yvelines (UVSQ),
MAQAO (C), 2004-2019 Universite de Versailles Saint-Quentin-en-Yvelines (UVSQ),
is distributed under the GNU Lesser General Public License (GNU LGPL). MAQAO is
free software; you can use it under the terms of the GNU Lesser General
Public License as published by the Free Software Foundation; either version 2.1
......
.\" File generated using by MAQAO.
.TH MAQAO "1" "2018/10/12" "MAQAO 2.6.0" "User Commands"
.TH MAQAO "1" "2019/01/23" "MAQAO 2.7.0" "User Commands"
.SH NAME
maqao \- manual page for maqao module.
.SH SYNOPSIS
......@@ -122,7 +122,7 @@ Written by The MAQAO team.
.SH "REPORTING BUGS"
Report bugs to <contact@maqao.org>.
.SH COPYRIGHT
MAQAO (C), 2004-2018 Universite de Versailles Saint-Quentin-en-Yvelines (UVSQ),
MAQAO (C), 2004-2019 Universite de Versailles Saint-Quentin-en-Yvelines (UVSQ),
is distributed under the GNU Lesser General Public License (GNU LGPL). MAQAO is
free software; you can use it under the terms of the GNU Lesser General
Public License as published by the Free Software Foundation; either version 2.1
......
##
# Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
# Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
#
# This file is part of MAQAO.
#
......
##
# Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
# Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
#
# This file is part of MAQAO.
#
......
##
# Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
# Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
#
# This file is part of MAQAO.
#
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......@@ -58,8 +58,11 @@ static inline insn_t *find_branch_target(insn_t *insn)
i < insn_get_nb_oprnds(insn)
&& oprnd_is_ptr(insn_get_oprnd(insn, i)) == FALSE; i++) {
}
if (i < insn_get_nb_oprnds(insn))
return pointer_get_insn_target(oprnd_get_ptr(insn_get_oprnd(insn, i)));
if (i < insn_get_nb_oprnds(insn)) {
pointer_t* ptr = oprnd_get_ptr(insn_get_oprnd(insn, i));
if (pointer_get_offset_in_target(ptr) == 0)
return pointer_get_insn_target(ptr);
}
return NULL;
}
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......@@ -221,12 +221,11 @@ block_t *loop_constructor(block_t *root, int* NextDfn, global_t* global)
if (linsn != NULL
&& insn_check_annotate(linsn,
A_CALL) && oprnd_is_ptr (insn_get_oprnd (linsn, 0)) == TRUE
&& pointer_get_insn_target (oprnd_get_ptr(insn_get_oprnd (linsn, 0))) != NULL) {
&& oprnd_get_ptr_insn_target(insn_get_oprnd (linsn, 0)) != NULL) {
// check the target function is in the handler function list
fct_t* target = block_get_fct(
insn_get_block(
pointer_get_insn_target(
oprnd_get_ptr(insn_get_oprnd(linsn, 0)))));
oprnd_get_ptr_insn_target(insn_get_oprnd(linsn, 0))));
int i = 0;
while (a->project->exit_functions[i] != NULL) {
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......@@ -182,12 +182,11 @@ void print_SSA_insn(ssa_insn_t* in, arch_t* arch, FILE* outfile)
fprintf(outfile, "0x%"PRIx64"", oprnd_get_imm(oprnd));
break;
case OT_POINTER:
if (pointer_get_insn_target(oprnd_get_ptr(oprnd)) != NULL)
if (oprnd_get_ptr_insn_target(oprnd) != NULL)
fprintf(outfile, "(%d)",
block_get_id(
insn_get_block(
pointer_get_insn_target(
oprnd_get_ptr(oprnd)))));
oprnd_get_ptr_insn_target(oprnd))));
else
fprintf(outfile, "()");
break;
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
##
# Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
# Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
#
# This file is part of MAQAO.
#
......
##
# Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
# Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
#
# This file is part of MAQAO.
#
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2019 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......@@ -48,7 +48,7 @@ asmfile_t* asmfile_new(char* asmfile_name)
new->name = lc_strdup(asmfile_name);
new->label_list = queue_new();
new->analyze_flag = NO_ANALYZE;
new->branches = hashtable_new(direct_hash, direct_equal); /**\todo Avoid this direct_hash, passing addresses as pointers*/
new->branches_by_target_insn = hashtable_new(direct_hash, direct_equal); /**\todo Avoid this direct_hash, passing addresses as pointers*/
return new;
}
......@@ -290,7 +290,7 @@ void asmfile_free(void* p)
queue_free(asmf->insns, arch_get_insn_free(asmf->arch));
queue_free(asmf->insns_gaps, NULL);
list_free(asmf->plt_fct, &fct_free_except_cg_node);
hashtable_free(asmf->branches, NULL, NULL);
hashtable_free(asmf->branches_by_target_insn, NULL, NULL);
lc_free(asmf->insns_table);
lc_free(asmf);
......@@ -401,6 +401,24 @@ void asmfile_add_analyzis(asmfile_t* asmf, int analyzis_flag)
asmf->analyze_flag |= analyzis_flag;
}
/*
* Indexes a branch instruction with its destination in an asmfile_t
* \param asmf The asmfile
* \param branch The branch instruction. It will be added to the table of branches indexed by \c dest.
* \param dest The instruction targeted by the branch. It will be the index of the branch in the table.
* \warning For performance reasons, no test is performed on whether \c branch actually points to \c dest.
* */
void asmfile_add_branch(asmfile_t* asmf, insn_t* branch, insn_t* dest)
{
/**\todo (2014-12-05) No tests are done on branch actually referencing dest as this is intended to
* be done during disassembly precisely after linking an instruction to a branch. If the case occurs
* where this could be legitimately happen, add a test, but I'd better not
* */
if (!asmf || !branch)
return;
hashtable_insert(asmf->branches_by_target_insn, dest, branch);
}
/*
* Gets an asmfile project
* \param asmf an asmfile
......@@ -616,7 +634,7 @@ char asmfile_get_arch_code(asmfile_t* asmf)
* */
hashtable_t* asmfile_get_branches(asmfile_t* asmf)
{
return (asmf != NULL) ? asmf->branches : PTR_ERROR;
return (asmf != NULL) ? asmf->branches_by_target_insn : PTR_ERROR;
}
/*
......@@ -1286,6 +1304,81 @@ void insnlist_linkbranches(queue_t* insn_list, hashtable_t* branches)
}
}
/*
* Updates the instructions in an asmfile with regard to branches. This involves identifying the targets of branches and flagging unreachable instructions.
* \param af The asmfile
* \param branches A queue of the branch instructions present in the file. It will be emptied upon completion (but not freed)
* */
void asmfile_upd_insns_with_branches(asmfile_t* af, queue_t* branches)
{
if (!af || !branches || !queue_length(af->insns))
return;