diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/cprintf.hh | 5 | ||||
-rw-r--r-- | base/cprintf_formats.hh | 7 | ||||
-rw-r--r-- | base/crc.cc | 1 | ||||
-rw-r--r-- | base/hostinfo.cc | 1 | ||||
-rw-r--r-- | base/inet.cc | 1 | ||||
-rw-r--r-- | base/loader/elf_object.cc | 11 | ||||
-rw-r--r-- | base/remote_gdb.cc | 1 | ||||
-rw-r--r-- | base/statistics.cc | 1 | ||||
-rw-r--r-- | base/statistics.hh | 1 | ||||
-rw-r--r-- | base/stats/text.cc | 1 |
10 files changed, 18 insertions, 12 deletions
diff --git a/base/cprintf.hh b/base/cprintf.hh index dcb292434..c468c375f 100644 --- a/base/cprintf.hh +++ b/base/cprintf.hh @@ -31,13 +31,12 @@ #include <iostream> #include <list> -#include <sstream> #include <string> -namespace cp { - #include "base/cprintf_formats.hh" +namespace cp { + class ArgList { private: diff --git a/base/cprintf_formats.hh b/base/cprintf_formats.hh index 11b0238ed..05a8723a4 100644 --- a/base/cprintf_formats.hh +++ b/base/cprintf_formats.hh @@ -29,6 +29,11 @@ #ifndef __CPRINTF_FORMATS_HH__ #define __CPRINTF_FORMATS_HH__ +#include <sstream> +#include <ostream> + +namespace cp { + struct Format { bool alternate_form; @@ -343,4 +348,6 @@ inline void format_string(std::ostream &out, const std::stringstream &data, Format &fmt) { _format_string(out, data.str(), fmt); } +} // namespace cp + #endif // __CPRINTF_FORMATS_HH__ diff --git a/base/crc.cc b/base/crc.cc index 87963ef14..08f039577 100644 --- a/base/crc.cc +++ b/base/crc.cc @@ -31,7 +31,6 @@ * SUCH DAMAGE. */ -#include <sstream> #include <string> #include "sim/host.hh" diff --git a/base/hostinfo.cc b/base/hostinfo.cc index d15e3ddc1..d42c96732 100644 --- a/base/hostinfo.cc +++ b/base/hostinfo.cc @@ -31,7 +31,6 @@ #include <math.h> #include <unistd.h> -#include <cstdio> #include <cstdlib> #include <cstring> #include <string> diff --git a/base/inet.cc b/base/inet.cc index 2e1c4c84b..f2665bd2b 100644 --- a/base/inet.cc +++ b/base/inet.cc @@ -26,7 +26,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <cstdio> #include <sstream> #include <string> diff --git a/base/loader/elf_object.cc b/base/loader/elf_object.cc index a104719af..165501e1c 100644 --- a/base/loader/elf_object.cc +++ b/base/loader/elf_object.cc @@ -90,6 +90,7 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data) } else if (ehdr.e_ident[EI_CLASS] == ELFCLASS64) { arch = ObjectFile::Alpha; } else { + warn("Unknown architecture: %d\n", ehdr.e_machine); arch = ObjectFile::UnknownArch; } @@ -112,8 +113,7 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data) //take a look at the .note.ABI section //It can let us know what's what. - if (opSys == ObjectFile::UnknownOpSys) - { + if (opSys == ObjectFile::UnknownOpSys) { Elf_Scn *section; GElf_Shdr shdr; Elf_Data *data; @@ -124,7 +124,7 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data) section = elf_getscn(elf, secIdx); // While there are no more sections - while (section != NULL) { + while (section != NULL && opSys == ObjectFile::UnknownOpSys) { gelf_getshdr(section, &shdr); if (shdr.sh_type == SHT_NOTE && !strcmp(".note.ABI-tag", elf_strptr(elf, ehdr.e_shstrndx, shdr.sh_name))) { @@ -147,6 +147,11 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data) break; } } // if section found + if (!strcmp(".SUNW_version", elf_strptr(elf, ehdr.e_shstrndx, shdr.sh_name))) + opSys = ObjectFile::Solaris; + if (!strcmp(".stab.index", elf_strptr(elf, ehdr.e_shstrndx, shdr.sh_name))) + opSys = ObjectFile::Solaris; + section = elf_getscn(elf, ++secIdx); } // while sections } diff --git a/base/remote_gdb.cc b/base/remote_gdb.cc index 6b85bc680..41d0c1471 100644 --- a/base/remote_gdb.cc +++ b/base/remote_gdb.cc @@ -116,7 +116,6 @@ #include <sys/signal.h> -#include <cstdio> #include <string> #include <unistd.h> diff --git a/base/statistics.cc b/base/statistics.cc index c97564641..20de46347 100644 --- a/base/statistics.cc +++ b/base/statistics.cc @@ -31,7 +31,6 @@ #include <list> #include <map> #include <string> -#include <sstream> #include "base/callback.hh" #include "base/cprintf.hh" diff --git a/base/statistics.hh b/base/statistics.hh index c46744cac..dd507c091 100644 --- a/base/statistics.hh +++ b/base/statistics.hh @@ -50,7 +50,6 @@ #include <cmath> #include <functional> #include <iosfwd> -#include <sstream> #include <string> #include <vector> diff --git a/base/stats/text.cc b/base/stats/text.cc index 3d77ff87d..300737c60 100644 --- a/base/stats/text.cc +++ b/base/stats/text.cc @@ -31,6 +31,7 @@ #endif #include <iostream> +#include <sstream> #include <fstream> #include <string> |