elf_object.cc (5152:20fc3ce35147) elf_object.cc (5335:69d45f5f21a2)
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;

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

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;
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;

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

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;
91 } else if (ehdr.e_machine == EM_ARM) {
92 arch = ObjectFile::Arm;
91 } else {
92 warn("Unknown architecture: %d\n", ehdr.e_machine);
93 arch = ObjectFile::UnknownArch;
94 }
95
96 //Detect the operating system
97 switch (ehdr.e_ident[EI_OSABI])
98 {
99
100 case ELFOSABI_LINUX:
93 } else {
94 warn("Unknown architecture: %d\n", ehdr.e_machine);
95 arch = ObjectFile::UnknownArch;
96 }
97
98 //Detect the operating system
99 switch (ehdr.e_ident[EI_OSABI])
100 {
101
102 case ELFOSABI_LINUX:
103 case ELFOSABI_ARM:
101 opSys = ObjectFile::Linux;
102 break;
103 case ELFOSABI_SOLARIS:
104 opSys = ObjectFile::Solaris;
105 break;
106 case ELFOSABI_TRU64:
107 opSys = ObjectFile::Tru64;
108 break;

--- 324 unchanged lines hidden ---
104 opSys = ObjectFile::Linux;
105 break;
106 case ELFOSABI_SOLARIS:
107 opSys = ObjectFile::Solaris;
108 break;
109 case ELFOSABI_TRU64:
110 opSys = ObjectFile::Tru64;
111 break;

--- 324 unchanged lines hidden ---