summaryrefslogtreecommitdiffstats
path: root/runtime/elf_file_impl.h
Commit message (Collapse)AuthorAgeFilesLines
* ART stack unwinding fixes for libunwind/gdb/lldb.David Srbecky2015-06-191-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dex2oat can already generate unwinding and symbol information which allows tools to create backtrace of mixed native and Java code. This is a cherry pick from aosp/master which fixes several issues. Most notably: * It enables generation of ELF-64 on 64-bit systems (in dex2oat, C compilers already produce ELF-64). Libunwind requires ELF-64 on 64-bit systems for backtraces to work. * It enables loading of ELF files with dlopen. This is required for libunwind to be able to generate backtrace of current process (i.e. the process requesting backtrace of itself). * It adds unit test to test the above (32 vs 64 bit, in-proces vs out-of-process, application code vs framework code). * Some other fixes or clean-ups which should not be of much significance but which are easier to include to make the important CLs cherry-pick cleanly. This is squash of the following commits from aosp/master: 7381010 ART: CFI Test e1bbed2 ART: Blacklist CFI test for non-compiled run-tests aab9f73 ART: Blacklist CFI test for JIT 4437219 ART: Blacklist CFI test for Heap Poisoning a3a49fe Switch to using ELF-64 for 64-bit architectures. 297ed22 Write 64-bit address in DWARF if we are on 64-bit architecture. 24981a1 Set correct size of PT_PHDR ELF segment. 1a146bf Link .dynamic to .dynstr 67a0653 Make some parts of ELF more (pointer) aligned. f50fa82 Enable 64-bit CFI tests. 49e1fab Use dlopen to load oat files. 5dedb80 Add more logging output for dlopen. aa03870 Find the dlopened file using address rather than file path. 82e73dc Release dummy MemMaps corresponding to dlopen. 5c40961 Test that we can unwind framework code. 020c543 Add more log output to the CFI test. 88da3b0 ART: Fix CFI test wrt/ PIC a70e5b9 CFI test: kill the other process in native code. ad5fa8c Support generation of CFI in .debug_frame format. 90688ae Fix build - large frame size of ElfWriterQuick<ElfTypes>::Write. 97dabb7 Fix build breakage in dwarf_test. 388d286 Generate just single ARM mapping symbol. f898087 Split .oat_patches to multiple sections. 491a7fe Fix build - large frame size of ElfWriterQuick<ElfTypes>::Write (again). 8363c77 Add --generate-debug-info flag and remove the other two flags. 461d72a Generate debug info for core.oat files. Bug: 21924613 Change-Id: I3f944a08dd2ed1df4d8a807da4fee423fdd35eb7
* ART: Do not relocate app program headers in patchoat.Vladimir Marko2015-05-141-2/+2
| | | | | | | | | | | | | | | | Change the check whether to relocate program headers in patchoat to simply look whether there is a PT_LOAD section with p_vaddr == 0. If there is, don't relocate the headers, it should be an app. Otherwise, it's a boot image and needs to be relocated. Add overflow checking to ElfFileImpl<>::GetLoadedSize(). Bug: 21047854 (cherry picked from commit 3fc9903407c6e89ffbbc92ded9e272d9de58e9b6) Change-Id: Ib3e1295fc06993bcfbaadd8f253ee4f5498f52e9
* Replace NULL with nullptrMathieu Chartier2015-04-221-4/+3
| | | | | | | Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
* Simplify template parameters of Elf classes.David Srbecky2015-04-221-6/+15
| | | | | | | | | | | The ELF specification defines several types which differ between 32-bit ELF and 64-bit ELF. We used to template all ELF-related methods on all of those types which was very verbose. This CL wraps all the types as typedefs in ElfTypes32 and ElfTypes64. One of those wrappers is then used as the template parameter. Change-Id: I65247c2c79d92a7c4799e988cf3e4a1b10eb4788
* Relocate DWARF using .oat_patches.David Srbecky2015-04-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | The current solution is to hard-code knowledge of DWARF in the linker. This works for simple use of DWARF, but breaks as soon as I try to do anything more complex. Making the linker fully support DWARF would be non-trivial task and would be essentially rewrite. Using .oat_patches is much easier solution. Relocating .debug_* sections required extending .oat_patches to support more sections than just .text. I have encoded each section as null-terminated section name followed by ULEB128 deltas. The ULEB128 encoding shrinks .oat_patches for .text by factor of about 6 with 64-bit compiler, and factor of 3 with 32-bit compiler. On the other hand, it grows by the extra .oat_patches for DWARF which were not present before (if debug symbols are included). Overall, it is still a clear improvement even with the DWARF patches. Change-Id: I78ffeda0f8a3da03341995a3b5ef15c954e16e9f
* ART: Fix 64-bit ELF file supportAndreas Gampe2015-04-071-7/+8
| | | | | | | | | | | The API wasn't cross-compile-safe, 32-bit patchoat would fail for negative delta applied to a 64-bit ELF file. Add 64-bit ELF file output to the compilers, behind a flag, currently off by default (preserving current behavior). Bug: 20095017 Change-Id: I2cde7b4c7cc83413c76692d7b745868d644a604c
* ART: Add support for patching and loading OAT files compiled with PICIgor Murashkin2014-10-271-2/+6
| | | | | | | | | | | | * Images (.art) compiled with pic now have a new field added. * isDexOptNeeded will now skip patch-ing for apps compiled PIC * First-boot patching now only copies boot.art, boot.oat is linked As a result, all system preopted dex files (with --compile-pic) no longer take up any space in /data/dalvik-cache/<isa>. Bug: 18035729 Change-Id: Ie1acad81a0fd8b2f24e1f3f07a06e6fdb548be62
* Some code clean-up.Ian Rogers2014-10-161-10/+4
| | | | Change-Id: I4b745fd5298cd61c793e3b57514b48347bd66c0e
* stdint types all the way!Ian Rogers2014-10-091-12/+12
| | | | Change-Id: I4e4ef3a2002fc59ebd9097087f150eaf3f2a7e08
* ART: Prepare for ELF64.Tong Shen2014-10-031-0/+220
Only expose necessary interface in ElfFile, and move all details into template class ElfFileImpl. Change-Id: I9df2bbc55f32ba0ba91f4f3d5d0009e84a2ddf74