History log of /external/libunwind/src/elfxx.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
857d28136af8eb7760c4cfd0a381bbfc5099d8ee 27-Oct-2017 Eugene Zemtsov <ezemtsov@google.com> Fix compilation error

Fix error when compiled without LZMA support.
Test: N/A

Change-Id: I0db4630c398e9e91de93b51378485bdcdcc66b4e
/external/libunwind/src/elfxx.c
c3290dfdd3ef01a52a544b0ee7e37663befb6a3b 12-May-2016 Christopher Ferris <cferris@google.com> Use zero offset when getting bias from memory.

The code to get the bias was incorrectly using the passed in map offset
when reading it from memory. This doesn't work since the offset is the
offset into the apk. Change to always check for a zero in this case.

Bug: 28685297
Change-Id: I9ab2a89401429c4bcf4faa510b1b619be70318ab
/external/libunwind/src/elfxx.c
164059ed9cd0efbea262cf3b74b2aed41689ae91 19-Feb-2016 Christopher Ferris <cferris@google.com> Fix the caching of the compressed section.

A previous change fixed a race condtion, but caused a big memory
leak of the compressed section data. In order to fix this, move
the caching of the compressed section at the point that we cache
the elf image data itself.

Bug: 27152097

(cherry picked from commit c5017fdb02aa2a9c87c059c9263e5dfc390da289)

Change-Id: Ib9e4342acf591fdaaf05fd7fabb6bc0b02b8f3f1
/external/libunwind/src/elfxx.c
c45b025fc0d6505f703998d1fabe04c3aa266767 19-Feb-2016 Christopher Ferris <cferris@google.com> Revert "Temporarily disable compressed section support."

This reverts commit 537c0e953a5e1960a36bb1214a855ebfe2d9fb51.

Change-Id: If1c2d7674843e9b114d0e5c0ca20861e823c6940
/external/libunwind/src/elfxx.c
537c0e953a5e1960a36bb1214a855ebfe2d9fb51 15-Feb-2016 Christopher Ferris <cferris@google.com> Temporarily disable compressed section support.

Bug: 27172087
Change-Id: I933f0a312dc28b2dc9698404215ac09b8d5e323f
/external/libunwind/src/elfxx.c
1aaf3b45edb306600589f5a3969d7a7004798823 10-Feb-2016 Christopher Ferris <cferris@google.com> Make sure that elf_image structure is copied.

A previous change modified the code so that a pointer to the elf_image
structure from the map data was returned instead of copied. This can
cause a race condition when doing local unwinds if the map needs to be
rebuilt. One thread might have a pointer to a freed data structure.

To fix this, make sure that the elf_image is always copied when the
contents are going to be used.

In addition, remove the map pointer in the mapped data because it could
also be stale when a local unwind causes a map rebuild. Add a big comment
in front of the elf_image structure to explain this so it won't happen
again.

Bug: 27123610

(cherry picked from commit 2c0f916cac65c1a14e9a917452a430c490ff9620)

Change-Id: I162b396c24923fe9e3d774488b221244d822096c
/external/libunwind/src/elfxx.c
06e604a3cc470460af1ff7a179ccc7e51bd98072 02-Feb-2016 David Srbecky <dsrbecky@google.com> Cache decompressed .gnu_debugdata sections.

Change-Id: Ia7260642e7567acb72b1cce38016ce063acbf521
/external/libunwind/src/elfxx.c
ed721f5758c9a3e9db9047feb790b3a514989c6c 28-Jan-2016 David Srbecky <dsrbecky@google.com> Detect relocation of gnu_debugdata based on the .text section.

This should be more robust as it relies only on the .text section
to be mirrored as NOBITS in the compressed ELF file.

Change-Id: I9e3e077cb9952f6a40e0b6d4d5f907e1d57fc064
/external/libunwind/src/elfxx.c
344ee5841222c15cbc8a91e1f75e6f6f02d7d234 11-May-2015 David Srbecky <dsrbecky@google.com> Decompress debug symbols.

Debug symbols may be stored in LZMA compressed section .gnu_debugdata.

libunwind already contained some support for it however it was
disabled at compile time. This CL re-enables it and extends it.

The decompression code is based on LZMA SDK.

Change-Id: Ie199ce1fc31770940db288b5e57b50942f12be7b
/external/libunwind/src/elfxx.c
4a9fd609328bb843b31d96bd8b3041eff4538ca6 19-Aug-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Update all mapoff checks to check against 0."

Makes ART's cfi-test fail.

This reverts commit 4a4ba40ed815be9307ac64023565d5b22c7fdf39.

Change-Id: I0698a2e37f9fe0a54695a7a8f99c4e23b2478f47
/external/libunwind/src/elfxx.c
4a4ba40ed815be9307ac64023565d5b22c7fdf39 14-Aug-2015 Christopher Ferris <cferris@google.com> Update all mapoff checks to check against 0.

The dlopen of a shared library from an apk results in huge non-zero
map offsets. This can cause failures due to the checks in the code
of the map offset against the elf data.

We don't really support a non-zero offset for an executable map,
so it's easier to assume this is always zero.

Bug: 23192251
Change-Id: Ie4c34ed5c181135ecd3fe7c968b4a424f8eb34b9
/external/libunwind/src/elfxx.c
478d002e4c60c4369af35bf77da2ec64bae78649 09-Jun-2015 David Srbecky <dsrbecky@google.com> Change return type of get_load_offset to bool.

Return boolean value to indicate success and return the offset via pointer.
Offset of 0 zero is valid if the elf file was not relocated.

Change-Id: Ia9c73673a4ecbdc1f21324b6e0f414d4daf8359d
/external/libunwind/src/elfxx.c
14de40d95372863fff4f460fb7e128404d87f8f4 15-May-2015 Christopher Ferris <cferris@google.com> Check for overflow when getting symbol name.

If there is a malformed elf with a particularly large st_name value,
then an overflow can occur. Check for this condition and ignore the
symbols that would cause an overflow.

Bug: 21162746
Change-Id: I9207853769f0ffb040dce29fa2e61cf824ed0cc9
/external/libunwind/src/elfxx.c
ae38b20031a02d3f6f56a8315c1f097ae5293c56 04-May-2015 Christopher Ferris <cferris@google.com> Implement method to read elf data from memory.

I rewrote the entirety of elfxx.h/elfxx.c to support this.

For the rewrite, I modified the way that the symbol tables are searched.
The searched every single entry in the symbol table, and all symbol tables.
The new method finds the first entry that actually has a name and stops.

I also added some quick checks to make sure that a malformed elf would
not cause a crash when reading the symbol names from the symbol tables.

I had to implement the functionality of dwarf_find_unwind_table to handle
reading from memory, instead of from a file. I didn't implement debug frame
support since that likelihood of that appearing in memory seems low.

I also modified the dwarf_find_unwind_table to remove an abort and just
fail if that particular path is encountered. In addition, I added a quick
check to make sure that a malformed dynamic section doesn't cause a crash.

Bug: 19517541

Change-Id: I6075d87035dca41fa5e5dfcbe287a680a7671836
/external/libunwind/src/elfxx.c
d1c383c5bb03420decf5cf789cf14ab144b0720d 10-Apr-2014 Christopher Ferris <cferris@google.com> Fix all warnings, and make warnings errors.

Change-Id: Ia2039922b55891551b1de0f0c281c266db6ee219
/external/libunwind/src/elfxx.c
f4a8df5f4f338f1a12c25213227e98b34b42447f 08-Mar-2014 Christopher Ferris <cferris@google.com> Fix maps caching for local processes.

It is possible for the map to change while running libunwind. For example,
if lots of threads are doing local unwinds at the same time. Allow the
cached map to regenerate when it detects this case.

Included in this change is a refactor of all of the os code so that it can
also be used to do caching. This is a prelude to being able to attempt to
push the code upstream.

Also, this moves the code back closer to the original upstream code.
Hopefully, this will allow me to upstream all of these changes.

Change-Id: Ia219fa61e16e36416133bc95b1dd2161bd5b8ff7
/external/libunwind/src/elfxx.c
d24fdf6c51c7ab875662b9ca13372d57cd9f36e1 13-Mar-2014 Christopher Ferris <cferris@google.com> Fix symbol name association.

Do not associate a name with an ip unless the ip is actually within
the symbol's size.

Change-Id: I7ec424abdd9a21ca94b37fa30302b355b64b6312
/external/libunwind/src/elfxx.c
16b95a68caaa7e021209e2cd6a877ae1e558f740 23-Jan-2014 Christopher Ferris <cferris@google.com> Add speed-ups to libunwind.

Add caching of /proc/self/maps data structures.

Add caching of elf image maps attached to the maps data structure.

Add a set of new map api functions to handle creation/destruction of the
maps by external code.

Remove the creation of the maps data structure in the local address space
init.

Change-Id: I0adae397d433fc3902f83a6f377f6889161937e5
/external/libunwind/src/elfxx.c
96c1bca2b08f147011814b1b7be6863151ef0be9 05-Oct-2012 Tommi Rantala <tt.rantala@gmail.com> Fix header inclusion order in `src/elfxx.c'

Make sure that we have included `config.h' before checking HAVE_LZMA.
This makes a difference at least on MIPS, where we include `elfxx.c'
directly. For other platforms this does not make much difference, as we
are already indirectly including `config.h' from other headers.
/external/libunwind/src/elfxx.c
3d5e6c1dddc67288a4aeaf8bbcdc76dd220f5898 10-Aug-2012 Martin Milata <mmilata@redhat.com> Search MiniDebugInfo for procedure names

After searching the normal symbol table, look if the binary contains
.gnu_debugdata section. If it does, run LZMA decompression on it, load
the resulting ELF image into memory and call lookup_symbol() on it
again.

lookup_symbol() is modified so that it takes min_dist as a parameter and
only returns a symbol when it finds one that is closer than indicated by
the parameter.

Signed-off-by: Martin Milata <mmilata@redhat.com>
/external/libunwind/src/elfxx.c
71c1fffc357276dbcf7327a2829d8ec1eedf7e6f 10-Aug-2012 Martin Milata <mmilata@redhat.com> Refactor parts of elfxx.c to allow reusing code

Signed-off-by: Martin Milata <mmilata@redhat.com>
/external/libunwind/src/elfxx.c
e11a6a4fdf1891802987519974f3a01d665126e9 06-Aug-2012 Martin Milata <mmilata@redhat.com> Fix incorrect return code of unw_get_proc_name

The code for symbol lookup (elfxx.c:lookup_symbol) works by iterating
over symbol tables while maintaing the symbol closest to the supplied
instruction pointer. Whenever this search encountered symbol that was
longer than result buffer, the function returned -UNW_ENOMEM even though
the final symbol wasn't too long.

Signed-off-by: Martin Milata <mmilata@redhat.com>
/external/libunwind/src/elfxx.c
d276b7a9614987495a7dfb056e6558f452ebe802 13-Mar-2012 Arun Sharma <asharma@fb.com> Introduce get_proc_name_in_image()

This is similar to get_proc_name() but takes an already mapped
image.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/libunwind/src/elfxx.c
3d08506936d16401aade168de0c95646b3f54a94 13-Feb-2012 Arun Sharma <asharma@fb.com> Fix undefined symbol: _Uelf64_valid_object

Without this change, we end up building libunwind-${arch}.a with
missing symbols.

Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
/external/libunwind/src/elfxx.c
5007f8c7942fb50b9263f3d151e4a11530021e90 30-Nov-2010 Zachary T Welch <zwelch@codesourcery.com> Improve ELF valid_object() helper

Ensures the ELF header version is valid.

Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
/external/libunwind/src/elfxx.c
1787a2fd284a786b409af74047a12de02c644cd1 15-May-2010 Arun Sharma <arun@sharma-home.net> Add path and pathlen arguments to tdep_get_elf_image()

Signed-off-by: Andris Zeila <andris.zeila@accenture.com>
/external/libunwind/src/elfxx.c
e6b9f350f78ecd9ef3b8a3e721f9435c94fc2562 22-Aug-2007 David Mosberger-Tang <davidm@panda.mostang.com> Introduce a tdep_get_func_addr_hook() in the ELF lookup_symbol()
routine and add address-space argument. This is needed because on
PPC64, a the function-name symbol refers to a function descriptor
(unlike, for example, on ia64, where the @fptr() operator is needed to
refer to a function descriptor). Thus, in order to look up the name
of a function, we need to dereference the function descriptor. To
make matters more "interesting", the function descriptors are normally
resolved by the dynamic linker, so we can't get their values from the
ELF file. Instead, we have to read them from the running image, hence
the need for the address-space argument.
/external/libunwind/src/elfxx.c
379fb069d2d8291be25b2e54c1251371522179c8 20-May-2005 hp.com!davidm <hp.com!davidm> Don't include <string.h>, <unistd.h>, <sys/types.h>.
Include "libunwind_i.h" instead of "tdep.h".

(Logical change 1.294)
/external/libunwind/src/elfxx.c
5d8b2e341554b1a1e96b66eb337251525017e006 03-May-2005 hp.com!davidm <hp.com!davidm> (valid_object): Declare as HIDDEN instead of PROTECTED.
(get_proc_name): Likewise.

(Logical change 1.290)
/external/libunwind/src/elfxx.c
c67d345c33f1d0b6e4adce3e03f8a1f332722669 30-Jan-2004 hp.com!davidm <hp.com!davidm> Convert from debug() to Debug().

(Logical change 1.162)
/external/libunwind/src/elfxx.c
c4f5974dd1774714282ea49a333c967c2d2a2e19 03-Jan-2004 hp.com!davidm <hp.com!davidm> Declare libunwind-entry-points as PROTECTED to ensure local uses get
resolved within the library itself.

(Logical change 1.151)
/external/libunwind/src/elfxx.c
4fafd8cbf7464f50b30e2983e332ddebef8b5acc 20-Dec-2003 hp.com!davidm <hp.com!davidm> Use Elf_W() instead of ElfW() etc. to avoid clash with <linker.h>.

(Logical change 1.141)
/external/libunwind/src/elfxx.c
dee53d780094be559381f8584a0a95222ecf5bb5 27-Nov-2003 hp.com!davidm <hp.com!davidm> (lookup_symbol): Delete unused variable "str_size".

(Logical change 1.130)
/external/libunwind/src/elfxx.c
71650257d7c7e805e25482b431651a4dc9b18727 25-Sep-2003 hp.com!davidm <hp.com!davidm> (lookup_symbol): Cast arguments to debug printf() so they compile
without warning on both 32- and 64-bit platforms.

(Logical change 1.104)
/external/libunwind/src/elfxx.c
4409fc61d874df46a483e348405be1183cfd8c4b 27-Mar-2003 mostang.com!davidm <mostang.com!davidm> Patch by Matthieu Delahaye:

(lookup_symbol): Fix typo: Elf64_Shdr -> ElfW (Shdr).
(get_proc_name): Ditto.

(Logical change 1.67)
/external/libunwind/src/elfxx.c
7bfbbb6126987bf6eedffd03fab4aa4cc537f1e9 19-Mar-2003 mostang.com!davidm <mostang.com!davidm> (lookup_symbol): Return -UNW_ENOINFO if symbol cannot be looked up for some reason.
Return -UNW_ENOMEM if string buffer is too small. This makes the routine
compatible with the definition of the unw_get_proc_name(3).

(Logical change 1.63)
/external/libunwind/src/elfxx.c
d098282ff550cb1a26e419ad4ab8709d8b52646e 06-Mar-2003 mostang.com!davidm <mostang.com!davidm> Include "tdep.h".

(Logical change 1.59)
/external/libunwind/src/elfxx.c
03950aaf0144dad92414a57aebe57e7931b23c1e 27-Feb-2003 mostang.com!davidm <mostang.com!davidm> (lookup_symbol): Print debug output only at very high debug-level.
(get_proc_name): Take "pid" argument.

(Logical change 1.56)
/external/libunwind/src/elfxx.c
824d6619b500a86ff2fc680268357f0215d59b0c 08-Feb-2003 mostang.com!davidm <mostang.com!davidm> (Logical change 1.45)
/external/libunwind/src/elfxx.c
5f94e2d488701fccd474245df3ad6f51aff2a05e 08-Feb-2003 mostang.com!davidm <mostang.com!davidm> Initial revision
/external/libunwind/src/elfxx.c