Home
last modified time | relevance | path

Searched refs:ELF (Results 1 – 22 of 22) sorted by relevance

/ndk/sources/android/crazy_linker/src/
Dlinker_phdr.h44 size_t phdr_table_get_load_size(const ELF::Phdr* phdr_table,
46 ELF::Addr* min_vaddr = NULL,
47 ELF::Addr* max_vaddr = NULL);
49 int phdr_table_protect_segments(const ELF::Phdr* phdr_table,
51 ELF::Addr load_bias);
53 int phdr_table_unprotect_segments(const ELF::Phdr* phdr_table,
55 ELF::Addr load_bias);
57 int phdr_table_get_relro_info(const ELF::Phdr* phdr_table,
59 ELF::Addr load_bias,
60 ELF::Addr* relro_start,
[all …]
Dlinker_phdr.cpp141 size_t phdr_table_get_load_size(const ELF::Phdr* phdr_table, in phdr_table_get_load_size()
143 ELF::Addr* out_min_vaddr, in phdr_table_get_load_size()
144 ELF::Addr* out_max_vaddr) { in phdr_table_get_load_size()
145 ELF::Addr min_vaddr = ~static_cast<ELF::Addr>(0); in phdr_table_get_load_size()
146 ELF::Addr max_vaddr = 0x00000000U; in phdr_table_get_load_size()
150 const ELF::Phdr* phdr = &phdr_table[i]; in phdr_table_get_load_size()
185 static int _phdr_table_set_load_prot(const ELF::Phdr* phdr_table, in _phdr_table_set_load_prot()
187 ELF::Addr load_bias, in _phdr_table_set_load_prot()
189 const ELF::Phdr* phdr = phdr_table; in _phdr_table_set_load_prot()
190 const ELF::Phdr* phdr_limit = phdr + phdr_count; in _phdr_table_set_load_prot()
[all …]
Dcrazy_linker_elf_relocations.cpp82 RelocationType GetRelocationType(ELF::Word r_type) { in GetRelocationType()
150 ELF::Addr dyn_value = dyn.GetValue(); in Init()
153 const ELF::Addr tag = dyn.GetTag(); in Init()
205 plt_got_ = reinterpret_cast<ELF::Addr*>(dyn_addr); in Init()
275 if (!ApplyRelRelocs(reinterpret_cast<ELF::Rel*>(plt_relocations_), in ApplyAll()
276 plt_relocations_size_ / sizeof(ELF::Rel), in ApplyAll()
281 if (!ApplyRelRelocs(reinterpret_cast<ELF::Rel*>(relocations_), in ApplyAll()
282 relocations_size_ / sizeof(ELF::Rel), in ApplyAll()
290 if (!ApplyRelaRelocs(reinterpret_cast<ELF::Rela*>(plt_relocations_), in ApplyAll()
291 plt_relocations_size_ / sizeof(ELF::Rela), in ApplyAll()
[all …]
Dcrazy_linker_elf_relocations.h63 ELF::Addr reloc,
64 ELF::Addr* sym_addr,
66 bool ApplyRelaReloc(const ELF::Rela* rela,
67 ELF::Addr sym_addr,
70 bool ApplyRelReloc(const ELF::Rel* rel,
71 ELF::Addr sym_addr,
74 bool ApplyRelaRelocs(const ELF::Rela* relocs,
79 bool ApplyRelRelocs(const ELF::Rel* relocs,
84 void AdjustRelocation(ELF::Word rel_type,
85 ELF::Addr src_reloc,
[all …]
Dcrazy_linker_elf_loader.h50 ELF::Addr load_start() { return reinterpret_cast<ELF::Addr>(load_start_); } in load_start()
51 ELF::Addr load_size() { return load_size_; } in load_size()
52 ELF::Addr load_bias() { return load_bias_; } in load_bias()
53 const ELF::Phdr* loaded_phdr() { return loaded_phdr_; } in loaded_phdr()
59 ELF::Ehdr header_;
63 ELF::Phdr* phdr_table_;
64 ELF::Addr phdr_size_; // and its size.
69 ELF::Addr load_size_; // Size in bytes of reserved address space.
70 ELF::Addr load_bias_; // load_bias, add this value to all "vaddr"
74 const ELF::Phdr* loaded_phdr_; // points to the loaded program header.
[all …]
Dcrazy_linker_elf_view.h38 bool InitUnmapped(ELF::Addr load_address,
39 const ELF::Phdr* phdr,
43 const ELF::Phdr* phdr() const { return phdr_; } in phdr()
45 const ELF::Dyn* dynamic() const { return dynamic_; } in dynamic()
73 ELF::Addr GetTag() const { return dyn_->d_tag; } in GetTag()
75 ELF::Addr GetValue() const { return dyn_->d_un.d_val; } in GetValue()
77 ELF::Addr* GetValuePointer() const { in GetValuePointer()
78 return const_cast<ELF::Addr*>(&dyn_->d_un.d_ptr); in GetValuePointer()
88 const ELF::Dyn* dyn_;
89 const ELF::Dyn* dyn_limit_;
[all …]
Dcrazy_linker_elf_view.cpp11 bool ElfView::InitUnmapped(ELF::Addr load_address, in InitUnmapped()
12 const ELF::Phdr* phdr, in InitUnmapped()
16 ELF::Addr min_vaddr = 0; in InitUnmapped()
40 const ELF::Phdr* phdr0 = NULL; in InitUnmapped()
44 const ELF::Phdr* entry = &phdr[n]; in InitUnmapped()
56 const ELF::Phdr* entry = &phdr[n]; in InitUnmapped()
59 ELF::Addr elf_addr = load_bias_ + entry->p_vaddr; in InitUnmapped()
60 const ELF::Ehdr* ehdr = reinterpret_cast<const ELF::Ehdr*>(elf_addr); in InitUnmapped()
61 ELF::Addr offset = ehdr->e_phoff; in InitUnmapped()
62 phdr0 = reinterpret_cast<const ELF::Phdr*>(elf_addr + offset); in InitUnmapped()
[all …]
Dcrazy_linker_elf_loader.cpp119 if (header_.e_ident[EI_CLASS] != ELF::kElfClass) { in ReadElfHeader()
121 ELF::kElfBits, in ReadElfHeader()
155 if (phdr_num_ < 1 || phdr_num_ > 65536 / sizeof(ELF::Phdr)) { in ReadProgramHeader()
160 ELF::Addr page_min = PAGE_START(header_.e_phoff); in ReadProgramHeader()
161 ELF::Addr page_max = in ReadProgramHeader()
162 PAGE_END(header_.e_phoff + (phdr_num_ * sizeof(ELF::Phdr))); in ReadProgramHeader()
163 ELF::Addr page_offset = PAGE_OFFSET(header_.e_phoff); in ReadProgramHeader()
175 phdr_table_ = reinterpret_cast<ELF::Phdr*>( in ReadProgramHeader()
186 ELF::Addr min_vaddr; in ReserveAddressSpace()
211 load_bias_ = reinterpret_cast<ELF::Addr>(start) - min_vaddr; in ReserveAddressSpace()
[all …]
Dcrazy_linker_elf_symbols.cpp38 ELF::Word* data = reinterpret_cast<ELF::Word*>(dyn_addr); in Init()
51 symbol_table_ = reinterpret_cast<const ELF::Sym*>(dyn_addr); in Init()
63 const ELF::Sym* ElfSymbols::LookupByAddress(void* address, in LookupByAddress()
65 ELF::Addr elf_addr = in LookupByAddress()
66 reinterpret_cast<ELF::Addr>(address) - static_cast<ELF::Addr>(load_bias); in LookupByAddress()
69 const ELF::Sym* sym = &symbol_table_[n]; in LookupByAddress()
83 ELF::Addr elf_addr = in LookupNearestByAddress()
84 reinterpret_cast<ELF::Addr>(address) - static_cast<ELF::Addr>(load_bias); in LookupNearestByAddress()
86 const ELF::Sym* nearest_sym = NULL; in LookupNearestByAddress()
90 const ELF::Sym* sym = &symbol_table_[n]; in LookupNearestByAddress()
[all …]
Dcrazy_linker_elf_symbols.h25 const ELF::Sym* LookupByName(const char* symbol_name) const;
27 const ELF::Sym* LookupById(size_t symbol_id) const { in LookupById()
31 const ELF::Sym* LookupByAddress(void* address, size_t load_bias) const;
39 const ELF::Sym* sym = LookupById(symbol_id); in LookupNameById()
46 const ELF::Sym* sym = LookupByName(symbol_name); in LookupAddressByName()
63 const ELF::Sym* symbol_table() const { return symbol_table_; } in symbol_table()
67 const ELF::Sym* symbol_table_;
69 ELF::Word* hash_bucket_;
71 ELF::Word* hash_chain_;
Dcrazy_linker_rdebug.cpp51 ELF::Ehdr header[1]; in FindElfDynamicSection()
63 header->e_ident[4] != ELF::kElfClass) { in FindElfDynamicSection()
66 ELF::kElfBits, in FindElfDynamicSection()
71 if (header->e_phoff == 0 || header->e_phentsize != sizeof(ELF::Phdr)) { in FindElfDynamicSection()
82 ELF::Phdr phdr_load0 = {0, }; in FindElfDynamicSection()
83 ELF::Phdr phdr_dyn = {0, }; in FindElfDynamicSection()
88 ELF::Phdr phdr; in FindElfDynamicSection()
220 const ELF::Dyn* dyn_section = reinterpret_cast<const ELF::Dyn*>(dynamic_addr); in Init()
Dcrazy_linker_shared_library.h39 const ELF::Phdr* phdr() const { return view_.phdr(); } in phdr()
90 const ELF::Sym* LookupSymbolEntry(const char* symbol_name);
173 ELF::Addr relro_start_;
174 ELF::Addr relro_size_;
Dcrazy_linker_shared_library.cpp96 const ELF::Sym* entry = lib_->LookupSymbolEntry(symbol_name); in Lookup()
217 ELF::Addr dyn_value = dyn.GetValue(); in Load()
239 init_array_count_ = dyn_value / sizeof(ELF::Addr); in Load()
249 fini_array_count_ = dyn_value / sizeof(ELF::Addr); in Load()
259 preinit_array_count_ = dyn_value / sizeof(ELF::Addr); in Load()
275 reinterpret_cast<ELF::Addr>(Globals::GetRDebug()->GetAddress()); in Load()
306 const ELF::Sym* SharedLibrary::LookupSymbolEntry(const char* symbol_name) { in LookupSymbolEntry()
Delf_traits.h15 struct ELF { struct
39 struct ELF { argument
Dcrazy_linker_library_list.cpp30 const ELF::Sym* entry = lib->LookupSymbolEntry(symbol); in CheckSymbol()
/ndk/sources/host-tools/ndk-depends/
Dndk-depends.cc455 template <class ELF>
460 typedef typename ELF::Word Word;
461 typedef typename ELF::Sword Sword;
462 typedef typename ELF::Addr Addr;
463 typedef typename ELF::Off Off;
464 typedef typename ELF::Half Half;
465 typedef typename ELF::Header ElfHeader;
466 typedef typename ELF::Shdr Shdr;
626 template <class ELF>
629 explicit DynamicIterator(ElfParser<ELF>& parser) in DynamicIterator()
[all …]
/ndk/docs/text/
DNDK-DEPENDS.text8 the ELF dependencies of a given ELF shared library or executable.
18 - Either 32-bit or 64-bit ELF binaries.
19 - Either little-endian or big-endian ELF binaries.
DCPU-ARCH-ABIS.text52 - ELF for the ARM Architecture (a.k.a. ARMELF)
59 - ELF System V Application Binary Interface
197 - ELF for the MIPS Architecture (a.k.a. MIPSELF)
203 - ELF System V Application Binary Interface
DSTANDALONE-TOOLCHAIN.text354 `/system/lib/libstdc++.so`. This enforces a new name for the GNU ELF
DCHANGES.text389 - New tool ndk-depends to print ELF library dependencies.
1086 - Added ARM ELF support to llvm-objdump.
/ndk/sources/android/crazy_linker/
DDESIGN.TXT31 ELF shared libraries, inside an _existing_ executable process. This makes it
44 ELF file format is recommended, though not necessary.
47 I. ELF Loading Basics:
50 When it comes to loading shared libraries, an ELF file mainly consists in the
53 - A fixed-size header that identifies the file as an ELF file and gives
57 'segments' of interest in the ELF file.
60 properties of the ELF library. The most interesting ones are the list
71 The process of loading a given ELF shared library can be decomposed into 4 steps:
/ndk/build/core/
Dbuild-binary.mk623 $(call ndk_log,Building ELF binary module '$(LOCAL_MODULE)' with linker list file)