aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux/elfutils.cc
Commit message (Collapse)AuthorAgeFilesLines
* linux: Fix segfault when there is no section header in ELF fileSim Sun2020-08-151-0/+6
| | | | | | | | | | | | | Some vendor library doesn't contain the section header. It causes segmentation fault in `FindElfClassSection`. > e_shoff: > This member holds the section header table's file offset in bytes. > If the file has no section header table this member holds zero. Change-Id: Id98d6ff3bd16af4541deb5a55a8fad2fa74eda23 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2354427 Reviewed-by: Mark Mentovai <mark@chromium.org>
* fix pointer style to match the style guideMike Frysinger2020-07-151-11/+11
| | | | | | | | | | We do this in a lot of places, but we're inconsistent. Normalize the code to the Google C++ style guide. Change-Id: Ic2aceab661ce8f6b993dda21b1cdf5d2198dcbbf Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2262932 Reviewed-by: Sterling Augustine <saugustine@google.com> Reviewed-by: Mark Mentovai <mark@chromium.org>
* linux, dump_syms: set module name from DT_SONAMEJoshua Peraza2019-10-241-0/+61
| | | | | | | | | | | | | The Breakpad and Crashpad clients will use an object's DT_SONAME as the name for a module if it exists. Previously, linux dump_syms would assume the basename of an input elf file matches that value, causing symbol lookups to fail if they were mismatched. This patch updates dump_syms to use DT_SONAME as the module name, if present. Bug: 1016924 Change-Id: I5eff0cf06c703841df3fb552cb5a8e1e50a20c64 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1876763 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Teach the ELF parser to handle multiple PT_NOTE phdrs.Peter Collingbourne2017-05-261-22/+14
| | | | | | | | | | | | | | | It is legal for an ELF to contain multiple PT_NOTEs, and that is in fact what lld's output looks like. Testing: "make check" and breakpad_unittests when patched into chromium. Bug: chromium:716484 Change-Id: I01d3f8679961e2cb7e789d4007de8914c6af357d Reviewed-on: https://chromium-review.googlesource.com/513512 Reviewed-by: Primiano Tucci <primiano@chromium.org> Reviewed-by: Ted Mielczarek <ted@mielczarek.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
* Simplify ELF parser code.Peter Collingbourne2017-05-251-12/+2
| | | | | | | | | | | | | The layout of Elf32_Nhdr and Elf64_Nhdr is the same, so remove templating and code that extracts the elfclass from the ELF file. Testing: "make check" and breakpad_unittests when patched into chromium. Bug: chromium:716484 Change-Id: I41442cfff48afc6ae1a5b604d22b67550a910376 Reviewed-on: https://chromium-review.googlesource.com/514450 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Change some ELF utils to return the length as a size_t.thestig@chromium.org2014-07-171-7/+7
| | | | | | | | R=mark@chromium.org Review URL: https://breakpad.appspot.com/7694002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1349 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Try to find a build-id through PT_NOTE program headersted.mielczarek@gmail.com2013-04-041-0/+65
| | | | | | | A=Mike Hommey <mh@glandium.org> R=ted at https://breakpad.appspot.com/544003/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1143 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Rework dump_symbols.cc using templates and traits classes to handle ↵ted.mielczarek2012-07-181-26/+33
| | | | | | | | cross-word-size symbol dumping R=mark at https://breakpad.appspot.com/393002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@987 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Move some ELF-handling bits from file_id.cc to elfutils.{h,cc}ted.mielczarek2012-07-181-0/+122
R=mark at https://breakpad.appspot.com/392002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@986 4c0a9323-5329-0410-9bdc-e9ce6186880e