elf_object.cc (5335:69d45f5f21a2) elf_object.cc (5383:51dc65015ca9)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 65 unchanged lines hidden (view full) ---

74 ehdr.e_machine == EM_SPARCV9) {
75 arch = ObjectFile::SPARC64;
76 } else if (ehdr.e_machine == EM_SPARC32PLUS ||
77 (ehdr.e_machine == EM_SPARC &&
78 ehdr.e_ident[EI_CLASS] == ELFCLASS32)) {
79 arch = ObjectFile::SPARC32;
80 } else if (ehdr.e_machine == EM_MIPS
81 && ehdr.e_ident[EI_CLASS] == ELFCLASS32) {
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 65 unchanged lines hidden (view full) ---

74 ehdr.e_machine == EM_SPARCV9) {
75 arch = ObjectFile::SPARC64;
76 } else if (ehdr.e_machine == EM_SPARC32PLUS ||
77 (ehdr.e_machine == EM_SPARC &&
78 ehdr.e_ident[EI_CLASS] == ELFCLASS32)) {
79 arch = ObjectFile::SPARC32;
80 } else if (ehdr.e_machine == EM_MIPS
81 && ehdr.e_ident[EI_CLASS] == ELFCLASS32) {
82 arch = ObjectFile::Mips;
82 if (ehdr.e_ident[EI_DATA] == ELFDATA2LSB) {
83 arch = ObjectFile::Mips;
84 } else {
85 fatal("The binary you're trying to load is compiled for big "
86 "endian MIPS. M5\nonly supports little endian MIPS. "
87 "Please recompile your binary.\n");
88 }
83 } else if (ehdr.e_machine == EM_X86_64 &&
84 ehdr.e_ident[EI_CLASS] == ELFCLASS64) {
85 //In the future, we might want to differentiate between 32 bit
86 //and 64 bit x86 processes in case there are differences in their
87 //initial stack frame.
88 arch = ObjectFile::X86;
89 } else if (ehdr.e_ident[EI_CLASS] == ELFCLASS64) {
90 arch = ObjectFile::Alpha;

--- 345 unchanged lines hidden ---
89 } else if (ehdr.e_machine == EM_X86_64 &&
90 ehdr.e_ident[EI_CLASS] == ELFCLASS64) {
91 //In the future, we might want to differentiate between 32 bit
92 //and 64 bit x86 processes in case there are differences in their
93 //initial stack frame.
94 arch = ObjectFile::X86;
95 } else if (ehdr.e_ident[EI_CLASS] == ELFCLASS64) {
96 arch = ObjectFile::Alpha;

--- 345 unchanged lines hidden ---