Home
last modified time | relevance | path

Searched refs:ElfW (Results 1 – 25 of 28) sorted by relevance

12

/bionic/linker/
Dlinker_phdr.h50 ElfW(Addr) load_start() const { return reinterpret_cast<ElfW(Addr)>(load_start_); } in load_start()
52 ElfW(Addr) gap_start() const { return reinterpret_cast<ElfW(Addr)>(gap_start_); } in gap_start()
54 ElfW(Addr) load_bias() const { return load_bias_; } in load_bias()
55 const ElfW(Phdr)* loaded_phdr() const { return loaded_phdr_; } in ElfW() function
56 const ElfW(Dyn)* dynamic() const { return dynamic_; } in ElfW() function
57 const char* get_string(ElfW(Word) index) const;
59 ElfW(Addr) entry_point() const { return header_.e_entry + load_bias_; } in entry_point()
70 bool CheckPhdr(ElfW(Addr));
71 bool CheckFileRange(ElfW(Addr) offset, size_t size, size_t alignment);
80 ElfW(Ehdr) header_;
[all …]
Dlinker_phdr.cpp179 const char* ElfReader::get_string(ElfW(Word) index) const { in get_string()
262 if (header_.e_shentsize != sizeof(ElfW(Shdr))) { in VerifyElfHeader()
266 name_.c_str(), header_.e_shentsize, sizeof(ElfW(Shdr))); in VerifyElfHeader()
272 name_.c_str(), header_.e_shentsize, sizeof(ElfW(Shdr))); in VerifyElfHeader()
292 bool ElfReader::CheckFileRange(ElfW(Addr) offset, size_t size, size_t alignment) { in CheckFileRange()
315 if (phdr_num_ < 1 || phdr_num_ > 65536/sizeof(ElfW(Phdr))) { in ReadProgramHeaders()
321 size_t size = phdr_num_ * sizeof(ElfW(Phdr)); in ReadProgramHeaders()
322 if (!CheckFileRange(header_.e_phoff, size, alignof(ElfW(Phdr)))) { in ReadProgramHeaders()
335 phdr_table_ = static_cast<ElfW(Phdr)*>(phdr_fragment_.data()); in ReadProgramHeaders()
347 size_t size = shdr_num_ * sizeof(ElfW(Shdr)); in ReadSectionHeaders()
[all …]
Dlinker_soinfo.h71 ElfW(Addr) call_ifunc_resolver(ElfW(Addr) resolver_addr);
80 ElfW(Addr)* gnu_bloom_filter_ = nullptr;
84 const ElfW(Sym)* symtab_;
85 const ElfW(Versym)* versym_;
163 const ElfW(Phdr)* phdr;
166 ElfW(Addr) unused0; // DO NOT USE, maintained for compatibility.
168 ElfW(Addr) base;
175 ElfW(Dyn)* dynamic;
187 ElfW(Sym)* symtab_;
195 ElfW(Addr)** unused4; // DO NOT USE, maintained for compatibility
[all …]
Dlinker_main.cpp62 static ElfW(Addr) get_elf_exec_load_bias(const ElfW(Ehdr)* elf);
64 static void get_elf_base_from_phdr(const ElfW(Phdr)* phdr_table, size_t phdr_count,
65 ElfW(Addr)* base, ElfW(Addr)* load_bias);
158 ElfW(Ehdr)* ehdr_vdso = reinterpret_cast<ElfW(Ehdr)*>(getauxval(AT_SYSINFO_EHDR)); in add_vdso()
165 si->phdr = reinterpret_cast<ElfW(Phdr)*>(reinterpret_cast<char*>(ehdr_vdso) + ehdr_vdso->e_phoff); in add_vdso()
167 si->base = reinterpret_cast<ElfW(Addr)>(ehdr_vdso); in add_vdso()
196 const ElfW(Phdr)* phdr;
198 ElfW(Addr) entry_point;
232 result.phdr = reinterpret_cast<const ElfW(Phdr)*>(getauxval(AT_PHDR)); in get_executable_info()
300 static ElfW(Addr) linker_main(KernelArgumentBlock& args, const char* exe_to_load) { in linker_main()
[all …]
Dlinker_wrapper.cpp42 static void get_elf_base_from_phdr(const ElfW(Phdr)* phdr_table, size_t phdr_count, in get_elf_base_from_phdr()
43 ElfW(Addr)* base, ElfW(Addr)* load_bias) { in get_elf_base_from_phdr()
46 *load_bias = reinterpret_cast<ElfW(Addr)>(phdr_table) - phdr_table[i].p_vaddr; in get_elf_base_from_phdr()
47 *base = reinterpret_cast<ElfW(Addr)>(phdr_table) - phdr_table[i].p_offset; in get_elf_base_from_phdr()
57 extern "C" ElfW(Addr) __linker_init(void* raw_args) { in __linker_init()
60 ElfW(Addr) base_addr = 0; in __linker_init()
61 ElfW(Addr) load_bias = 0; in __linker_init()
63 reinterpret_cast<ElfW(Phdr)*>(args.getauxval(AT_PHDR)), args.getauxval(AT_PHNUM), in __linker_init()
66 ElfW(Addr) linker_addr = base_addr + reinterpret_cast<uintptr_t>(&linker_offset); in __linker_init()
67 ElfW(Addr) linker_entry_offset = reinterpret_cast<ElfW(Ehdr)*>(linker_addr)->e_entry; in __linker_init()
[all …]
Dlinker_relocate.cpp47 static bool is_tls_reloc(ElfW(Word) type) { in is_tls_reloc()
68 ElfW(Sym)* si_symtab = nullptr;
74 ElfW(Word) cache_sym_val = 0;
76 const ElfW(Sym)* cache_sym = nullptr;
84 const char* get_string(ElfW(Word) index) { in get_string()
96 soinfo** found_in, const ElfW(Sym)** sym) { in lookup_symbol()
108 …const ElfW(Sym)* local_sym = soinfo_do_lookup(sym_name, vi, &local_found_in, relocator.lookup_list… in lookup_symbol() local
168 const ElfW(Sym)* sym = nullptr; in process_relocation_impl() local
170 ElfW(Addr) sym_addr = 0; in process_relocation_impl()
225 auto get_addend_rel = [&]() -> ElfW(Addr) { return reloc.r_addend; }; in process_relocation_impl()
[all …]
Dlinker_soinfo.cpp108 static inline bool check_symbol_version(const ElfW(Versym)* ver_table, uint32_t sym_idx, in check_symbol_version()
109 const ElfW(Versym) verneed) { in check_symbol_version()
118 __attribute__((noinline)) static const ElfW(Sym)* in ElfW() function
122 constexpr uint32_t kBloomMaskBits = sizeof(ElfW(Addr)) * 8; in ElfW()
139 if (const ElfW(Sym)* sym = lib->si_->find_symbol_by_name(elf_symbol_name, vi)) { in ElfW() local
152 const ElfW(Addr) bloom_word = lib->gnu_bloom_filter_[word_num]; in ElfW() local
170 ElfW(Versym) verneed = kVersymNotNeeded; in ElfW()
174 const ElfW(Sym)* sym = nullptr; in ElfW() local
207 const ElfW(Sym)* soinfo_do_lookup(const char* name, const version_info* vi, in ElfW() function
262 const ElfW(Versym)* soinfo::get_versym(size_t n) const { in ElfW() function
[all …]
Dlinker.cpp699 static const ElfW(Sym)* dlsym_handle_lookup_impl(android_namespace_t* ns, in ElfW() function
705 const ElfW(Sym)* result = nullptr; in ElfW() local
735 static const ElfW(Sym)* dlsym_linear_lookup(android_namespace_t* ns, in ElfW() function
756 const ElfW(Sym)* s = nullptr; in ElfW() local
795 static const ElfW(Sym)* dlsym_handle_lookup(soinfo* si, in ElfW() function
821 ElfW(Addr) address = reinterpret_cast<ElfW(Addr)>(untag_address(p)); in find_containing_library()
826 ElfW(Addr) vaddr = address - si->load_bias; in find_containing_library()
828 const ElfW(Phdr)* phdr = &si->phdr[i]; in find_containing_library() local
1067 for (const ElfW(Dyn)* d = elf_reader.dynamic(); d->d_tag != DT_NULL; ++d) { in for_each_dt_needed() local
1250 for (const ElfW(Dyn)* d = elf_reader.dynamic(); d->d_tag != DT_NULL; ++d) { in load_library() local
[all …]
Dlinker.h62 const version_info* get_version_info(ElfW(Versym) source_symver) const;
66 void add_version_info(size_t source_index, ElfW(Word) elf_hash,
182 ElfW(Versym) find_verdef_version_index(const soinfo* si, const version_info* vi);
Dlinker_relocate.h42 static constexpr ElfW(Versym) kVersymHiddenBit = 0x8000;
60 inline bool is_symbol_global_and_defined(const soinfo* si, const ElfW(Sym)* s) { in is_symbol_global_and_defined()
Dlinker_globals.h72 constexpr ElfW(Versym) kVersymNotNeeded = 0;
73 constexpr ElfW(Versym) kVersymGlobal = 1;
Dlinker_reloc_iterators.h42 typedef ElfW(Rela) rel_t;
44 typedef ElfW(Rel) rel_t;
/bionic/libc/bionic/
Dlibc_init_static.cpp71 extern __LIBC_HIDDEN__ __attribute__((weak)) ElfW(Rela) __rela_iplt_start[], __rela_iplt_end[];
85 for (ElfW(Rela) *r = __rela_iplt_start; r != __rela_iplt_end; ++r) { in call_ifunc_resolvers()
86 ElfW(Addr)* offset = reinterpret_cast<ElfW(Addr)*>(r->r_offset); in call_ifunc_resolvers()
87 ElfW(Addr) resolver = r->r_addend; in call_ifunc_resolvers()
92 extern __LIBC_HIDDEN__ __attribute__((weak)) ElfW(Rel) __rel_iplt_start[], __rel_iplt_end[];
106 for (ElfW(Rel) *r = __rel_iplt_start; r != __rel_iplt_end; ++r) { in call_ifunc_resolvers()
107 ElfW(Addr)* offset = reinterpret_cast<ElfW(Addr)*>(r->r_offset); in call_ifunc_resolvers()
108 ElfW(Addr) resolver = *offset; in call_ifunc_resolvers()
115 ElfW(Phdr)* phdr_start = reinterpret_cast<ElfW(Phdr)*>(getauxval(AT_PHDR)); in apply_gnu_relro()
118 for (ElfW(Phdr)* phdr = phdr_start; phdr < (phdr_start + phdr_ct); phdr++) { in apply_gnu_relro()
[all …]
Dvdso.cpp85 ElfW(Ehdr)* vdso_ehdr = reinterpret_cast<ElfW(Ehdr)*>(vdso_ehdr_addr); in __libc_init_vdso()
92 ElfW(Shdr)* vdso_shdr = reinterpret_cast<ElfW(Shdr)*>(vdso_ehdr_addr + vdso_ehdr->e_shoff); in __libc_init_vdso()
95 symbol_count = vdso_shdr[i].sh_size / sizeof(ElfW(Sym)); in __libc_init_vdso()
103 ElfW(Addr) vdso_addr = 0; in __libc_init_vdso()
104 ElfW(Dyn)* vdso_dyn = nullptr; in __libc_init_vdso()
105 ElfW(Phdr)* vdso_phdr = reinterpret_cast<ElfW(Phdr)*>(vdso_ehdr_addr + vdso_ehdr->e_phoff); in __libc_init_vdso()
108 vdso_dyn = reinterpret_cast<ElfW(Dyn)*>(vdso_ehdr_addr + vdso_phdr[i].p_offset); in __libc_init_vdso()
119 ElfW(Sym)* symtab = nullptr; in __libc_init_vdso()
120 for (ElfW(Dyn)* d = vdso_dyn; d->d_tag != DT_NULL; ++d) { in __libc_init_vdso()
124 symtab = reinterpret_cast<ElfW(Sym)*>(vdso_addr + d->d_un.d_ptr); in __libc_init_vdso()
Ddl_iterate_phdr_static.cpp43 ElfW(Ehdr)* ehdr = reinterpret_cast<ElfW(Ehdr)*>(&__executable_start); in dl_iterate_phdr()
57 …exe_info.dlpi_phdr = reinterpret_cast<ElfW(Phdr)*>(reinterpret_cast<uintptr_t>(ehdr) + ehdr->e_pho… in dl_iterate_phdr()
82 ElfW(Ehdr)* ehdr_vdso = reinterpret_cast<ElfW(Ehdr)*>(getauxval(AT_SYSINFO_EHDR)); in dl_iterate_phdr()
91 …vdso_info.dlpi_phdr = reinterpret_cast<ElfW(Phdr)*>(reinterpret_cast<char*>(ehdr_vdso) + ehdr_vdso… in dl_iterate_phdr()
99 vdso_info.dlpi_addr = (ElfW(Addr)) ehdr_vdso - vdso_info.dlpi_phdr[i].p_vaddr; in dl_iterate_phdr()
Dlibc_init_dynamic.cpp67 extern "C" __attribute__((weak)) void __hwasan_library_loaded(ElfW(Addr) base,
68 const ElfW(Phdr)* phdr,
69 ElfW(Half) phnum);
70 extern "C" __attribute__((weak)) void __hwasan_library_unloaded(ElfW(Addr) base,
71 const ElfW(Phdr)* phdr,
72 ElfW(Half) phnum);
Dbionic_call_ifunc_resolver.cpp39 ElfW(Addr) __bionic_call_ifunc_resolver(ElfW(Addr) resolver_addr) { in __bionic_call_ifunc_resolver()
41 typedef ElfW(Addr) (*ifunc_resolver_t)(uint64_t, __ifunc_arg_t*); in __bionic_call_ifunc_resolver()
52 typedef ElfW(Addr) (*ifunc_resolver_t)(unsigned long); in __bionic_call_ifunc_resolver()
61 typedef ElfW(Addr) (*ifunc_resolver_t)(void); in __bionic_call_ifunc_resolver()
Dbionic_elf_tls.cpp56 bool __bionic_get_tls_segment(const ElfW(Phdr)* phdr_table, size_t phdr_count, in __bionic_get_tls_segment()
57 ElfW(Addr) load_bias, TlsSegment* out) { in __bionic_get_tls_segment()
59 const ElfW(Phdr)& phdr = phdr_table[i]; in __bionic_get_tls_segment() local
/bionic/libc/include/
Dlink.h40 #define ElfW(type) Elf64_ ## type macro
42 #define ElfW(type) Elf32_ ## type
46 ElfW(Addr) dlpi_addr;
48 const ElfW(Phdr)* dlpi_phdr;
49 ElfW(Half) dlpi_phnum;
71 ElfW(Addr) l_addr;
73 ElfW(Dyn)* l_ld;
82 ElfW(Addr) r_brk;
88 ElfW(Addr) r_ldbase;
/bionic/tests/
Dlink_test.cpp64 for (ElfW(Half) i = 0; i < info->dlpi_phnum; ++i) { in TEST()
65 const ElfW(Phdr)* phdr = reinterpret_cast<const ElfW(Phdr)*>(&info->dlpi_phdr[i]); in TEST() local
67 const ElfW(Ehdr)* ehdr = reinterpret_cast<const ElfW(Ehdr)*>(info->dlpi_addr + in TEST() local
131 const ElfW(Phdr)* table;
136 static ElfW(Addr) find_exe_load_bias(const ProgHdr& phdr) { in find_exe_load_bias()
139 return reinterpret_cast<ElfW(Addr)>(phdr.table) - phdr.table[i].p_vaddr; in find_exe_load_bias()
146 static ElfW(Dyn)* find_dynamic(const ProgHdr& phdr, ElfW(Addr) load_bias) { in ElfW() function
149 return reinterpret_cast<ElfW(Dyn)*>(phdr.table[i].p_vaddr + load_bias); in ElfW()
156 static r_debug* find_exe_r_debug(ElfW(Dyn)* dynamic) { in find_exe_r_debug()
157 for (ElfW(Dyn)* d = dynamic; d->d_tag != DT_NULL; ++d) { in find_exe_r_debug()
[all …]
/bionic/libc/malloc_debug/
DMapData.cpp106 ElfW(Ehdr) ehdr; in read_loadbias()
107 if (!get_val<ElfW(Half)>(entry, addr + offsetof(ElfW(Ehdr), e_phnum), &ehdr.e_phnum)) { in read_loadbias()
110 if (!get_val<ElfW(Off)>(entry, addr + offsetof(ElfW(Ehdr), e_phoff), &ehdr.e_phoff)) { in read_loadbias()
115 ElfW(Phdr) phdr; in read_loadbias()
116 if (!get_val<ElfW(Word)>(entry, addr + offsetof(ElfW(Phdr), p_type), &phdr.p_type)) { in read_loadbias()
119 if (!get_val<ElfW(Off)>(entry, addr + offsetof(ElfW(Phdr), p_offset), &phdr.p_offset)) { in read_loadbias()
123 if (!get_val<ElfW(Addr)>(entry, addr + offsetof(ElfW(Phdr), p_vaddr), &phdr.p_vaddr)) { in read_loadbias()
/bionic/libc/private/
Dbionic_globals.h87 ElfW(auxv_t)* auxv = nullptr;
97 void (*load_hook)(ElfW(Addr) base, const ElfW(Phdr)* phdr, ElfW(Half) phnum) = nullptr;
98 void (*unload_hook)(ElfW(Addr) base, const ElfW(Phdr)* phdr, ElfW(Half) phnum) = nullptr;
DKernelArgumentBlock.h46 auxv = reinterpret_cast<ElfW(auxv_t)*>(p); in KernelArgumentBlock()
52 for (ElfW(auxv_t)* v = auxv; v->a_type != AT_NULL; ++v) { in getauxval()
63 ElfW(auxv_t)* auxv;
Dbionic_call_ifunc_resolver.h34 __LIBC_HIDDEN__ ElfW(Addr) __bionic_call_ifunc_resolver(ElfW(Addr) resolver_addr);
Dbionic_elf_tls.h46 __LIBC_HIDDEN__ bool __bionic_get_tls_segment(const ElfW(Phdr)* phdr_table, size_t phdr_count,
47 ElfW(Addr) load_bias, TlsSegment* out);

12