diff options
author | David 'Digit' Turner <digit@android.com> | 2011-02-07 14:32:56 +0100 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2011-02-09 15:36:45 +0100 |
commit | c6375cb970388a3d4f691350fecdfd528eb334df (patch) | |
tree | a8ead1c26e797ad555fe195aaac6b7a221c4d669 /elff | |
parent | 67db9125a065ea01c3d8d77719e5983f908c5ffc (diff) | |
download | external_qemu-c6375cb970388a3d4f691350fecdfd528eb334df.zip external_qemu-c6375cb970388a3d4f691350fecdfd528eb334df.tar.gz external_qemu-c6375cb970388a3d4f691350fecdfd528eb334df.tar.bz2 |
elff: Remove un-needed qemu-common.h include.
The elff library doesn't really depend on anything QEMU-specific.
This will allow us to use it in other projects later.
Change-Id: I662b6e864b320cd9cf2fe246d04fbba95be66c56
Diffstat (limited to 'elff')
-rw-r--r-- | elff/elf_alloc.h | 7 | ||||
-rw-r--r-- | elff/elf_defs.h | 2 | ||||
-rw-r--r-- | elff/elf_file.cc | 5 | ||||
-rw-r--r-- | elff/elff-common.h | 23 | ||||
-rw-r--r-- | elff/elff_api.h | 2 | ||||
-rw-r--r-- | elff/elff_elf.h (renamed from elff/elf.h) | 4 |
6 files changed, 13 insertions, 30 deletions
diff --git a/elff/elf_alloc.h b/elff/elf_alloc.h index 648a1e9..bf3103b 100644 --- a/elff/elf_alloc.h +++ b/elff/elf_alloc.h @@ -18,9 +18,7 @@ #ifndef ELFF_ELF_ALLOC_H_
#define ELFF_ELF_ALLOC_H_
-extern "C" {
-#include "qemu-common.h"
-}
+#include <stdint.h>
#include "elff-common.h"
class ElfFile;
@@ -157,4 +155,7 @@ class DwarfAllocBase { }
};
+extern "C" void* elff_alloc(size_t size);
+extern "C" void elff_free(void* ptr);
+
#endif // ELFF_ELF_ALLOC_H_
diff --git a/elff/elf_defs.h b/elff/elf_defs.h index 1eca81b..8687f0f 100644 --- a/elff/elf_defs.h +++ b/elff/elf_defs.h @@ -17,7 +17,7 @@ #ifndef ELFF_ELF_DEFS_H_
#define ELFF_ELF_DEFS_H_
-#include "elf.h"
+#include "elff_elf.h"
//=============================================================================
// Macros.
diff --git a/elff/elf_file.cc b/elff/elf_file.cc index 5a6392c..3f1825e 100644 --- a/elff/elf_file.cc +++ b/elff/elf_file.cc @@ -20,6 +20,11 @@ #include "dwarf_cu.h"
#include "dwarf_utils.h"
+#include <fcntl.h>
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
/* Tags to parse when collecting info about routines. */
static const Dwarf_Tag parse_rt_tags[] = {
DW_TAG_compile_unit,
diff --git a/elff/elff-common.h b/elff/elff-common.h index 8729736..a8ae7fb 100644 --- a/elff/elff-common.h +++ b/elff/elff-common.h @@ -22,6 +22,7 @@ #include "assert.h"
#include "memory.h"
#include "errno.h"
+#include "stdlib.h"
#ifdef WIN32
#include "windows.h"
#else // WIN32
@@ -34,26 +35,4 @@ static inline void _set_errno(uint32_t err) { errno = err;
}
-/* Main operator new. We overwrite it to redirect memory
- * allocations to qemu_malloc, instead of malloc. */
-inline void* operator new(size_t size) {
- return qemu_malloc(size);
-}
-
-/* Main operator delete. We overwrite it to redirect memory
- * deallocation to qemu_free, instead of free. */
-inline void operator delete(void* p) {
- if (p != NULL) {
- qemu_free(p);
- }
-}
-
-/* Main operator delete for arrays. We overwrite it to redirect
- * memory deallocation to qemu_free, instead of free. */
-inline void operator delete[](void* p) {
- if (p != NULL) {
- qemu_free(p);
- }
-}
-
#endif // ELFF_ELFF_COMMON_H_
diff --git a/elff/elff_api.h b/elff/elff_api.h index 7b02746..d18798b 100644 --- a/elff/elff_api.h +++ b/elff/elff_api.h @@ -23,7 +23,7 @@ extern "C" {
#endif
-#include "qemu-common.h"
+#include <stdint.h>
/* Defines type for a handle used in ELFF API. */
typedef void* ELFF_HANDLE;
diff --git a/elff/elf.h b/elff/elff_elf.h index f3f5abc..ea19233 100644 --- a/elff/elf.h +++ b/elff/elff_elf.h @@ -18,9 +18,7 @@ #ifndef ELFF_ELH_H_ #define ELFF_ELH_H_ -extern "C" { -#include "qemu-common.h" -} +#include <stdint.h> #include "elff-common.h" //============================================================================= |