summaryrefslogtreecommitdiffstats
path: root/runtime/oat_file.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2015-02-25 12:02:49 +0000
committerVladimir Marko <vmarko@google.com>2015-03-02 18:07:03 +0000
commit5c42c29b89286e5efa4a4613132b09051ce5945b (patch)
tree5db25a4f62c5583f2f6fc42b9a2ff47362eeed5c /runtime/oat_file.h
parent242026e246a8b9efe098a0cce008fd525e011e5b (diff)
downloadart-5c42c29b89286e5efa4a4613132b09051ce5945b.zip
art-5c42c29b89286e5efa4a4613132b09051ce5945b.tar.gz
art-5c42c29b89286e5efa4a4613132b09051ce5945b.tar.bz2
Add support for .bss section in oat files.
Change-Id: I779b80b8139d9afdc28373f8c68edff5df7726ce
Diffstat (limited to 'runtime/oat_file.h')
-rw-r--r--runtime/oat_file.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/runtime/oat_file.h b/runtime/oat_file.h
index 5e68439..564185c 100644
--- a/runtime/oat_file.h
+++ b/runtime/oat_file.h
@@ -62,11 +62,6 @@ class OatFile {
// Opens an oat file from an already opened File. Maps it PROT_READ, MAP_PRIVATE.
static OatFile* OpenReadable(File* file, const std::string& location, std::string* error_msg);
- // Open an oat file backed by a std::vector with the given location.
- static OatFile* OpenMemory(std::vector<uint8_t>& oat_contents,
- const std::string& location,
- std::string* error_msg);
-
~OatFile();
bool IsExecutable() const {
@@ -274,17 +269,19 @@ class OatFile {
return End() - Begin();
}
+ size_t BssSize() const {
+ return BssEnd() - BssBegin();
+ }
+
const uint8_t* Begin() const;
const uint8_t* End() const;
+ const uint8_t* BssBegin() const;
+ const uint8_t* BssEnd() const;
+
private:
static void CheckLocation(const std::string& location);
- static OatFile* OpenDlopen(const std::string& elf_filename,
- const std::string& location,
- uint8_t* requested_base,
- std::string* error_msg);
-
static OatFile* OpenElfFile(File* file,
const std::string& location,
uint8_t* requested_base,
@@ -294,7 +291,6 @@ class OatFile {
std::string* error_msg);
explicit OatFile(const std::string& filename, bool executable);
- bool Dlopen(const std::string& elf_filename, uint8_t* requested_base, std::string* error_msg);
bool ElfFileOpen(File* file, uint8_t* requested_base,
uint8_t* oat_file_begin, // Override where the file is loaded to if not null
bool writable, bool executable,
@@ -312,6 +308,12 @@ class OatFile {
// Pointer to end of oat region for bounds checking.
const uint8_t* end_;
+ // Pointer to the .bss section, if present, otherwise nullptr.
+ const uint8_t* bss_begin_;
+
+ // Pointer to the end of the .bss section, if present, otherwise nullptr.
+ const uint8_t* bss_end_;
+
// Was this oat_file loaded executable?
const bool is_executable_;