Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: base/android/linker/crazy_linker/src/crazy_linker_proc_maps.h

Issue 23717023: Android: Add chrome-specific dynamic linker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename library Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CRAZY_LINKER_PROC_MAPS_H
6 #define CRAZY_LINKER_PROC_MAPS_H
7
8 // Helper classes and functions to extract useful information out of
9 // /proc/self/maps.
10
11 #include <stdint.h>
12 #include <sys/mman.h> // for PROT_READ etc...
13
14 namespace crazy {
15
16 // Find which loaded ELF binary contains |address|.
17 // On success, returns true and sets |*load_address| to its load address,
18 // and fills |path_buffer| with the path to the corresponding file.
19 bool FindElfBinaryForAddress(void* address,
20 uintptr_t* load_address,
21 char* path_buffer,
22 size_t path_buffer_len);
23
24 // Returns the current protection bit flags for the page holding a given
25 // |address|. On success, returns true and sets |*prot_flags|.
26 bool FindProtectionFlagsForAddress(void* address, int* prot_flags);
27
28 // Return the load address of a given ELF binary.
29 // If |file_name| contains a slash, this will try to perform an
30 // exact match with the content of /proc/self/maps. Otherwise,
31 // it will be taken as a base name, and the load address of the first
32 // matching entry will be returned.
33 // On success, returns true and sets |*load_address| to the load address,
34 // and |*load_offset| to the load offset.
35 bool FindLoadAddressForFile(const char* file_name,
36 uintptr_t* load_address,
37 uintptr_t* load_offset);
38
39 } // namespace crazy
40
41 #endif // CRAZY_LINKER_PROC_MAPS_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698