| Index: third_party/android_crazy_linker/src/src/crazy_linker_memory_mapping.h
|
| diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_memory_mapping.h b/third_party/android_crazy_linker/src/src/crazy_linker_memory_mapping.h
|
| index f981d5d8097c577ae7265ef81b4af3cff4eb21d5..7e4dd3f25aa7ae7de4d698927b26b945dff710ef 100644
|
| --- a/third_party/android_crazy_linker/src/src/crazy_linker_memory_mapping.h
|
| +++ b/third_party/android_crazy_linker/src/src/crazy_linker_memory_mapping.h
|
| @@ -33,8 +33,10 @@ class MemoryMapping {
|
| // |size| is the page-aligned size, must be > 0.
|
| // |prot| are the desired protection bit flags.
|
| // |fd| is -1 (for anonymous mappings), or a valid file descriptor.
|
| + // |offset| offset into the file
|
| // on failure, return false and sets errno.
|
| - bool Allocate(void* address, size_t size, Protection prot, int fd) {
|
| + bool AllocateWithOffset(void* address, size_t size, Protection prot, int fd,
|
| + size_t offset) {
|
| int flags = (fd >= 0) ? MAP_SHARED : MAP_ANONYMOUS;
|
| if (address)
|
| flags |= MAP_FIXED;
|
| @@ -49,6 +51,16 @@ class MemoryMapping {
|
| return true;
|
| }
|
|
|
| + // Allocate a new mapping.
|
| + // |address| is either NULL or a fixed memory address.
|
| + // |size| is the page-aligned size, must be > 0.
|
| + // |prot| are the desired protection bit flags.
|
| + // |fd| is -1 (for anonymous mappings), or a valid file descriptor.
|
| + // on failure, return false and sets errno.
|
| + bool Allocate(void* address, size_t size, Protection prot, int fd) {
|
| + return AllocateWithOffset(address, size, prot, fd, 0);
|
| + }
|
| +
|
| // Change the protection flags of the mapping.
|
| // On failure, return false and sets errno.
|
| bool SetProtection(Protection prot) {
|
|
|