pyelftools.git
9 years agoUpdate CHANGES to reflect recent changes after the last release.
Eli Bendersky [Fri, 5 Jun 2015 13:14:49 +0000 (06:14 -0700)]
Update CHANGES to reflect recent changes after the last release.

9 years agoCosmetic cleanup
Eli Bendersky [Fri, 5 Jun 2015 13:11:46 +0000 (06:11 -0700)]
Cosmetic cleanup

9 years agoMerge pull request #76 from JaySon-Huang/strings
Eli Bendersky [Fri, 5 Jun 2015 13:09:54 +0000 (06:09 -0700)]
Merge pull request #76 from JaySon-Huang/strings

get_string of StringTableSection return ascii-decoded strings now

9 years agoget_string of StringTableSection return ascii-decoded strings now
JaySon-Huang [Sun, 10 May 2015 17:30:49 +0000 (01:30 +0800)]
get_string of StringTableSection return ascii-decoded strings now

fix bugs

9 years agoMerge pull request #69 from Smattr/5f62439e-b6a7-456c-b1d1-b8313d9b6abe
Eli Bendersky [Sat, 11 Apr 2015 12:40:00 +0000 (05:40 -0700)]
Merge pull request #69 from Smattr/5f62439e-b6a7-456c-b1d1-b8313d9b6abe

ELF: Find all symbols of a given name in `get_symbol_by_name`.

9 years agoELF: Find all symbols of a given name in `get_symbol_by_name`.
Matthew Fernandez [Tue, 7 Apr 2015 00:00:55 +0000 (10:00 +1000)]
ELF: Find all symbols of a given name in `get_symbol_by_name`.

It is possible for an ELF file's symbol table to contain multiple entries under
the same symbol name. Prior to this commit, it was only possible to retrieve
the first of these via `get_symbol_by_name`. This commit alters this function
to return a list of all symbols under the given name, rather than just the
first entry. Functionality when a symbol name does not exist remains
unaffected.

9 years agoMerge pull request #58 from Smattr/symbol-by-name
Eli Bendersky [Sun, 28 Dec 2014 14:52:46 +0000 (06:52 -0800)]
Merge pull request #58 from Smattr/symbol-by-name

Functionality for retrieving a symbol by name

9 years agoELF: Add `get_symbol_by_name` functionality.
Matthew Fernandez [Mon, 24 Nov 2014 03:26:41 +0000 (14:26 +1100)]
ELF: Add `get_symbol_by_name` functionality.

This commit implements the equivalent of `get_section_by_name` for symbols for
ELF files.

10 years agoChanges for release 0.23 v0.23
Eli Bendersky [Sat, 8 Nov 2014 13:41:54 +0000 (05:41 -0800)]
Changes for release 0.23

10 years agoRemove outdated TODO instruction
Eli Bendersky [Sat, 8 Nov 2014 13:34:28 +0000 (05:34 -0800)]
Remove outdated TODO instruction

10 years agoBump minimal Python 2.x version to 2.7
Eli Bendersky [Sat, 1 Nov 2014 13:11:59 +0000 (06:11 -0700)]
Bump minimal Python 2.x version to 2.7

This lets me banish a local version of OrderedDict, which has issues submitted
against it (e.g. pull request #53).

Python 2.7 has been out for a while now, it's time to move on. I haven't been
testing pyelftools on 2.6 for some time anyway.

10 years agoMerge pull request #56 from KarlVogel/mips-support
Eli Bendersky [Sat, 1 Nov 2014 13:01:09 +0000 (06:01 -0700)]
Merge pull request #56 from KarlVogel/mips-support

Mips support

10 years agoBasic MIPS support
Karl Vogel [Sun, 26 Oct 2014 11:09:15 +0000 (12:09 +0100)]
Basic MIPS support

10 years agoMerge pull request #48 from deymo/elf_note
Eli Bendersky [Fri, 22 Aug 2014 12:35:38 +0000 (05:35 -0700)]
Merge pull request #48 from deymo/elf_note

Parse PT_NOTE segment.

10 years agoParse PT_NOTE segment and expose it with the new '-n' option to readelf.
Alex Deymo [Sun, 17 Aug 2014 20:15:46 +0000 (13:15 -0700)]
Parse PT_NOTE segment and expose it with the new '-n' option to readelf.

The PT_NOTE segment includes a list of notes with a header, name and
description. GNU ld includes in this segment the GNU build-id and GNU
ABI version information.

The '-n' or '--notes' option to readelf displays the notes contained
in the ELF file.

10 years agoMerge pull request #45 from postmasters/parse-symtab-from-dt_symtab
Eli Bendersky [Thu, 7 Aug 2014 12:58:45 +0000 (05:58 -0700)]
Merge pull request #45 from postmasters/parse-symtab-from-dt_symtab

Support parsing symbol table in dynamic segment.

10 years agoSupport parsing symbol table in dynamic segment.
Nam T. Nguyen [Fri, 25 Jul 2014 18:41:53 +0000 (11:41 -0700)]
Support parsing symbol table in dynamic segment.

Unlike SymbolTableSection, this patch reads from DT_SYMTAB, and
DT_STRTAB in PT_DYNAMIC segment. It heuristically determines the end of
DT_SYMTAB by finding the next higher pointer in the same segment. GNU
libc (dl-addr.c) assumes that DT_STRTAB comes after DT_SYMTAB.

10 years agoMerge pull request #43 from frewsxcv/patch-1
Eli Bendersky [Thu, 3 Jul 2014 12:18:41 +0000 (05:18 -0700)]
Merge pull request #43 from frewsxcv/patch-1

Run tests on Python 3.4

10 years agoRun tests on Python 3.4
Corey Farwell [Tue, 1 Jul 2014 23:22:38 +0000 (16:22 -0700)]
Run tests on Python 3.4

10 years agoMerge pull request #40 from vapier/master
Eli Bendersky [Sat, 14 Jun 2014 13:06:20 +0000 (06:06 -0700)]
Merge pull request #40 from vapier/master

fix parsing of dynamic ELFs w/out section headers

10 years agoMerge pull request #42 from vapier/misc
Eli Bendersky [Thu, 5 Jun 2014 13:40:43 +0000 (06:40 -0700)]
Merge pull request #42 from vapier/misc

add Blackfin description

10 years agoadd Blackfin description
Mike Frysinger [Wed, 4 Jun 2014 21:55:24 +0000 (17:55 -0400)]
add Blackfin description

10 years agoSome cleanup after the last merges.
Eli Bendersky [Tue, 3 Jun 2014 17:32:33 +0000 (10:32 -0700)]
Some cleanup after the last merges.

10 years agoMerge pull request #31 from vadmium/message
Eli Bendersky [Tue, 3 Jun 2014 17:26:13 +0000 (10:26 -0700)]
Merge pull request #31 from vadmium/message

BaseException.message is deprecated in Python 2.6 and gone in 3

10 years agoMerge pull request #37 from vadmium/map
Eli Bendersky [Tue, 3 Jun 2014 17:14:27 +0000 (10:14 -0700)]
Merge pull request #37 from vadmium/map

Add ELFFile.map() method to get file offset from memory address

10 years agoAdd ELFFile.address_offsets() to get file offsets from a memory address
Martin Panter [Wed, 12 Feb 2014 03:02:04 +0000 (03:02 +0000)]
Add ELFFile.address_offsets() to get file offsets from a memory address

10 years agoBaseException.message is deprecated in Python 2.6 and gone in 3
Martin Panter [Thu, 6 Dec 2012 00:00:00 +0000 (00:00 +0000)]
BaseException.message is deprecated in Python 2.6 and gone in 3

10 years agoMerge pull request #34 from vadmium/hash
Eli Bendersky [Sat, 3 May 2014 03:39:24 +0000 (20:39 -0700)]
Merge pull request #34 from vadmium/hash

Implement Section.__hash__() to avoid Python 2’s DeprecationWarning

10 years agoMerge pull request #35 from vadmium/warning
Eli Bendersky [Sat, 3 May 2014 03:37:27 +0000 (20:37 -0700)]
Merge pull request #35 from vadmium/warning

Avoid BytesWarning in debugging messages in Python 3

10 years agoMerge pull request #36 from vadmium/unused
Eli Bendersky [Sat, 3 May 2014 03:04:21 +0000 (20:04 -0700)]
Merge pull request #36 from vadmium/unused

Drop unused imports

10 years agoMerge pull request #33 from vadmium/div
Eli Bendersky [Sat, 3 May 2014 03:03:49 +0000 (20:03 -0700)]
Merge pull request #33 from vadmium/div

Use integer division in Python 3

10 years agoMerge pull request #32 from vadmium/tuples
Eli Bendersky [Sat, 3 May 2014 02:57:50 +0000 (19:57 -0700)]
Merge pull request #32 from vadmium/tuples

Use tuples with str.endswith(), supported since Python 2.5

10 years agoDrop unused imports
Martin Panter [Wed, 12 Feb 2014 14:08:11 +0000 (14:08 +0000)]
Drop unused imports

10 years agoAvoid BytesWarning in debugging messages in Python 3
Martin Panter [Wed, 12 Feb 2014 02:43:19 +0000 (02:43 +0000)]
Avoid BytesWarning in debugging messages in Python 3

10 years agoImplement Section.__hash__() to avoid Python 2’s DeprecationWarning
Martin Panter [Thu, 13 Feb 2014 11:18:36 +0000 (11:18 +0000)]
Implement Section.__hash__() to avoid Python 2’s DeprecationWarning

10 years agoUse integer division in Python 3
Martin Panter [Thu, 13 Feb 2014 10:53:56 +0000 (10:53 +0000)]
Use integer division in Python 3

This means DwarfConfig.default_address_size is now an integer in Python 3, as
in Python 2.

10 years agoIssue #29: Fail more gracefully when no string table is found for dynamic.
Eli Bendersky [Wed, 23 Apr 2014 23:44:11 +0000 (16:44 -0700)]
Issue #29: Fail more gracefully when no string table is found for dynamic.

10 years agoCosmetic changes in TODO v0.22
Eli Bendersky [Sun, 30 Mar 2014 13:49:14 +0000 (06:49 -0700)]
Cosmetic changes in TODO

10 years agoBump version to 0.22 and update TODO a bit
Eli Bendersky [Sun, 30 Mar 2014 13:42:37 +0000 (06:42 -0700)]
Bump version to 0.22 and update TODO a bit

10 years agoUse tuples with str.endswith(), supported since Python 2.5
Martin Panter [Wed, 12 Feb 2014 00:09:01 +0000 (00:09 +0000)]
Use tuples with str.endswith(), supported since Python 2.5

10 years agoClean up the code after the previous pull request
Eli Bendersky [Sat, 25 Jan 2014 14:45:37 +0000 (06:45 -0800)]
Clean up the code after the previous pull request

10 years agoMerge pull request #24 from smani/range_lists
Eli Bendersky [Sat, 25 Jan 2014 14:41:31 +0000 (06:41 -0800)]
Merge pull request #24 from smani/range_lists

Handle absence of .debug_ranges gracefully

10 years agoHandle absence of .debug_ranges gracefully
Santhosh Kumar Mani [Thu, 23 Jan 2014 15:55:24 +0000 (21:25 +0530)]
Handle absence of .debug_ranges gracefully

10 years agoAdding unit test for an ARM file with DW_FORM_indirect
Eli Bendersky [Sat, 18 Jan 2014 14:34:37 +0000 (06:34 -0800)]
Adding unit test for an ARM file with DW_FORM_indirect

10 years agoFix for issue #22: handle DW_FORM_indirect correctly
Eli Bendersky [Sat, 18 Jan 2014 14:24:23 +0000 (06:24 -0800)]
Fix for issue #22: handle DW_FORM_indirect correctly

10 years agoRemove unused import
Eli Bendersky [Sat, 18 Jan 2014 14:17:14 +0000 (06:17 -0800)]
Remove unused import

10 years agoTrim trailing whitespace
Eli Bendersky [Sat, 18 Jan 2014 14:15:05 +0000 (06:15 -0800)]
Trim trailing whitespace

10 years agoAttempting fix for issue #22: bad structs reference
Eli Bendersky [Wed, 15 Jan 2014 13:53:07 +0000 (05:53 -0800)]
Attempting fix for issue #22: bad structs reference

10 years agoMinor cleanups after last pull request
Eli Bendersky [Wed, 8 Jan 2014 13:57:43 +0000 (05:57 -0800)]
Minor cleanups after last pull request

10 years agoMerge pull request #10 from yannrouillard/multiple-stringtables-fix
Eli Bendersky [Wed, 8 Jan 2014 13:53:26 +0000 (05:53 -0800)]
Merge pull request #10 from yannrouillard/multiple-stringtables-fix

Correctly handle the "multiple string tables" case for string resolution...

10 years agoCorrectly handle the "multiple string tables" case for string resolution in the dynam...
Yann Rouillard [Tue, 9 Jul 2013 18:22:27 +0000 (20:22 +0200)]
Correctly handle the "multiple string tables" case for string resolution in the dynamic section

The index of the string table section used to resolve various strings in the
dynamic section is given by the sh_link field in the dynamic section header.
As several string tables with the same name can co-exist in an elf file
we must explicitely look for this specific string table instead of
looking for the first string table in the file.

10 years agoIssue #20: don't fail on relocations creating out-of-bounds values.
Eli Bendersky [Sun, 5 Jan 2014 23:53:46 +0000 (15:53 -0800)]
Issue #20: don't fail on relocations creating out-of-bounds values.

This came up with some very large object files. The solution (wrap around at
value size) doesn't feel good, but it appears to be the way binutils does it
too. Are there legitimate cases for this?

10 years agoAdditional git-foo for #21
Eli Bendersky [Sun, 5 Jan 2014 23:04:02 +0000 (15:04 -0800)]
Additional git-foo for #21

10 years agoFix for issue #21 - rename test files to keep unittests working from install
Eli Bendersky [Sun, 5 Jan 2014 23:00:01 +0000 (15:00 -0800)]
Fix for issue #21 - rename test files to keep unittests working from install

10 years agoMerge pull request #18 from ShaheedHaque/fix_iterator3
Eli Bendersky [Sat, 28 Dec 2013 16:38:53 +0000 (08:38 -0800)]
Merge pull request #18 from ShaheedHaque/fix_iterator3

Use correct Python2/3 compatibility iterator.

10 years agoUse correct Python2/3 compatibility iterator.
Shaheed Haque [Sat, 28 Dec 2013 11:16:53 +0000 (11:16 +0000)]
Use correct Python2/3 compatibility iterator.

10 years agoUpdate README to point to Travis
Eli Bendersky [Fri, 27 Dec 2013 15:12:50 +0000 (07:12 -0800)]
Update README to point to Travis

10 years agoUpdate CHANGES
Eli Bendersky [Fri, 27 Dec 2013 15:07:06 +0000 (07:07 -0800)]
Update CHANGES

10 years agoAdding test/all_tests.py and a Travis configuration file
Eli Bendersky [Fri, 27 Dec 2013 15:03:54 +0000 (07:03 -0800)]
Adding test/all_tests.py and a Travis configuration file

10 years agoUpdate CHANGES
Eli Bendersky [Fri, 27 Dec 2013 14:46:03 +0000 (06:46 -0800)]
Update CHANGES

10 years agoMerge pull request #5 from yannrouillard/solaris
Eli Bendersky [Fri, 27 Dec 2013 14:43:29 +0000 (06:43 -0800)]
Merge pull request #5 from yannrouillard/solaris

add support for solaris additional visibility specifications

10 years agoMerge pull request #7 from yannrouillard/ldynsym
Eli Bendersky [Fri, 27 Dec 2013 14:42:50 +0000 (06:42 -0800)]
Merge pull request #7 from yannrouillard/ldynsym

add support for solaris .SUNW_ldynsym section

10 years agoFix recent pull by refactoring the code a bit and fixing failing tests.
Eli Bendersky [Fri, 27 Dec 2013 14:30:27 +0000 (06:30 -0800)]
Fix recent pull by refactoring the code a bit and fixing failing tests.

10 years agoMerge pull request #16 from ShaheedHaque/filenames2
Eli Bendersky [Fri, 27 Dec 2013 14:18:06 +0000 (06:18 -0800)]
Merge pull request #16 from ShaheedHaque/filenames2

Centralise the logic for getting the filename for a DIE.

10 years agoFix failing tests on Python 3.3 by removing duplicats in dwarf/enums
Eli Bendersky [Fri, 27 Dec 2013 14:12:52 +0000 (06:12 -0800)]
Fix failing tests on Python 3.3 by removing duplicats in dwarf/enums

Retain only the _param versions of the names because these are used by readelf.
The DWARF standard calls them _parameter.

10 years ago1. Centralise the logic for getting the filename for a DIE.
Shaheed Haque [Fri, 27 Dec 2013 12:36:34 +0000 (12:36 +0000)]
1. Centralise the logic for getting the filename for a DIE.
2. Use the form of logic suggested by Philippe Ombredanne (thanks!).

10 years agoBeef up construct's readme a bit
Eli Bendersky [Thu, 28 Nov 2013 19:23:15 +0000 (11:23 -0800)]
Beef up construct's readme a bit

10 years agoAll readelf tests are passing with python 2. some fails with 3 yet in readelf comparisons
Eli Bendersky [Thu, 28 Nov 2013 17:54:41 +0000 (09:54 -0800)]
All readelf tests are passing with python 2. some fails with 3 yet in readelf comparisons

10 years agoexe_simple64 now passes again
Eli Bendersky [Thu, 28 Nov 2013 17:10:22 +0000 (09:10 -0800)]
exe_simple64 now passes again

10 years agoFrom now on, carry a built version of readelf with us
Eli Bendersky [Thu, 28 Nov 2013 17:02:13 +0000 (09:02 -0800)]
From now on, carry a built version of readelf with us

10 years agoSwitch tox's testing Python py32->py33
Eli Bendersky [Wed, 27 Nov 2013 14:54:03 +0000 (06:54 -0800)]
Switch tox's testing Python py32->py33

11 years agoadd support for solaris .SUNW_ldynsym section
Yann Rouillard [Wed, 19 Jun 2013 23:48:38 +0000 (01:48 +0200)]
add support for solaris .SUNW_ldynsym section

11 years agoMerge pull request #6 from kholia/README-update
Eli Bendersky [Wed, 19 Jun 2013 12:46:55 +0000 (05:46 -0700)]
Merge pull request #6 from kholia/README-update

Update instructions for getting the current code

11 years agoUpdate instructions for getting the current code
Dhiru Kholia [Wed, 19 Jun 2013 08:48:18 +0000 (14:18 +0530)]
Update instructions for getting the current code

11 years agoadd support for solaris additional visibility specifications
Yann Rouillard [Sun, 16 Jun 2013 19:05:50 +0000 (21:05 +0200)]
add support for solaris additional visibility specifications
(see http://docs.oracle.com/cd/E19963-01/html/819-0690/chapter6-93046.html#chapter7-27)

11 years agoMerge pull request #4 from yannrouillard/solaris
Eli Bendersky [Sun, 16 Jun 2013 23:21:11 +0000 (16:21 -0700)]
Merge pull request #4 from yannrouillard/solaris

Fix a mistake in symbol visibility description string table

11 years agofix a mistake in symbol visibility description string table
Yann Rouillard [Sun, 16 Jun 2013 18:43:14 +0000 (20:43 +0200)]
fix a mistake in symbol visibility description string table

11 years agosupport parsing of dynamic ELFs w/out section headers
Mike Frysinger [Sun, 9 Jun 2013 22:42:40 +0000 (18:42 -0400)]
support parsing of dynamic ELFs w/out section headers

At runtime, ELFs do not use the section headers at all. Instead, only
the program segments and dynamic tags get used. This means you can
strip the section table completely from an ELF and have it still work.

In practice, people rarely do this, but it's not unheard of. Make the
Dynamic tags work even in these cases by loading the strings table the
same way the runtime loader does:
 * parse the symtab address from DT_STRTAB
 * locate the file offset via the program segments

In order to avoid circular deps (parsing a dyntag requires walking parsed
dyntags), add a set of internal funcs for returning the raw values.

You can see this in action:
$ eu-strip -g --strip-sections a.out
$ readelf -S a.out
<nothing>
$ lddtree.py ./a.out
a.out (interpreter => /lib64/ld-linux-x86-64.so.2)
    libïäöëß.so => None
    libc.so.6 => /lib64/libc.so.6

11 years agosmall fix in todo
Eli Bendersky [Sun, 9 Jun 2013 22:08:45 +0000 (15:08 -0700)]
small fix in todo

11 years agoupdate changes
Eli Bendersky [Sun, 9 Jun 2013 13:47:11 +0000 (06:47 -0700)]
update changes

11 years agoupdate readme
Eli Bendersky [Sun, 9 Jun 2013 13:46:48 +0000 (06:46 -0700)]
update readme

11 years agochanged .hgignore to .gitignore
Eli Bendersky [Sat, 8 Jun 2013 22:56:26 +0000 (15:56 -0700)]
changed .hgignore to .gitignore

11 years agochanged permission of elf file to -x
Eli Bendersky [Sat, 8 Jun 2013 22:49:19 +0000 (15:49 -0700)]
changed permission of elf file to -x

11 years agoupdated changelog
Eli Bendersky [Sat, 8 Jun 2013 22:45:58 +0000 (15:45 -0700)]
updated changelog

11 years agoMerge pull request #16
Eli Bendersky [Sat, 8 Jun 2013 22:39:18 +0000 (15:39 -0700)]
Merge pull request #16

11 years agoBetter ARM support (with AArch64). Contributed by Dobromir Stefanov
Eli Bendersky [Sat, 8 Jun 2013 16:40:41 +0000 (09:40 -0700)]
Better ARM support (with AArch64). Contributed by Dobromir Stefanov

11 years agoAdd some additional GNU forms
Eli Bendersky [Sat, 8 Jun 2013 15:47:56 +0000 (08:47 -0700)]
Add some additional GNU forms

11 years agorename some methods to be more consistent
Yann Rouillard [Fri, 31 May 2013 20:37:05 +0000 (22:37 +0200)]
rename some methods to be more consistent

11 years agomore succint code for describer_ver_flags and describe_syminfo_flags
Yann Rouillard [Fri, 31 May 2013 20:32:51 +0000 (22:32 +0200)]
more succint code for describer_ver_flags and describe_syminfo_flags

11 years agoCreate a common parent class for Version (Definition|Dependency) section to share...
Yann Rouillard [Fri, 31 May 2013 20:15:09 +0000 (22:15 +0200)]
Create a common parent class for Version (Definition|Dependency) section to share common code

11 years agoRemove Table from GNU version sections class name
Yann Rouillard [Fri, 31 May 2013 19:01:25 +0000 (21:01 +0200)]
Remove Table from GNU version sections class name

11 years agoadd missing unit test
Yann Rouillard [Wed, 29 May 2013 21:53:11 +0000 (23:53 +0200)]
add missing unit test

11 years agofix versions classes import in readelf
Yann Rouillard [Wed, 29 May 2013 21:52:39 +0000 (23:52 +0200)]
fix versions classes import in readelf

11 years agoput -V readelf option before dwarf stuff
Yann Rouillard [Wed, 29 May 2013 21:51:00 +0000 (23:51 +0200)]
put -V readelf option before dwarf stuff

11 years agopep8 fixes
Yann Rouillard [Wed, 29 May 2013 21:47:50 +0000 (23:47 +0200)]
pep8 fixes

11 years agosplit gnu|sunw versions code in a separate file
Yann Rouillard [Wed, 29 May 2013 21:34:51 +0000 (23:34 +0200)]
split gnu|sunw versions code in a separate file

11 years agorename Ver(def|need|sym)TableSection to GNUVer(Def|Need|Sym)TableSection
Yann Rouillard [Wed, 29 May 2013 21:23:27 +0000 (23:23 +0200)]
rename Ver(def|need|sym)TableSection to GNUVer(Def|Need|Sym)TableSection

11 years agoadded support for version definition, version dependency and version symbol sections...
Yann Rouillard [Mon, 27 May 2013 20:44:28 +0000 (22:44 +0200)]
added support for version definition, version dependency and version symbol sections in pyelftools and readelf.py

11 years agoMore DWARFv4 parsing goodness. Also added some hookups for parsing .eh_frame
Eli Bendersky [Sat, 25 May 2013 22:47:55 +0000 (15:47 -0700)]
More DWARFv4 parsing goodness. Also added some hookups for parsing .eh_frame
but this isn't enabled yet, because pyelftools can't yet successfully parse
it (have to look at it deeper).

I tweaked the build of the gcc48-simple sample to generate .dwarf_frame
as well.

11 years agoMore tweaks to succesfully parse an object file generated by gcc 4.8 with
Eli Bendersky [Sat, 25 May 2013 16:28:12 +0000 (09:28 -0700)]
More tweaks to succesfully parse an object file generated by gcc 4.8 with
DWARFv4