-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rebase pyelftools and reapply S2E-specific commits as needed #3
base: master
Are you sure you want to change the base?
Commits on Jul 16, 2018
-
Handle ARM relocations (eliben#121)
* relocation: handle ARM binaries * relocation: handle R_ARM_ABS32 for ARM machines * testfiles: add reloc_arm_gcc.o.elf Generated on Ubuntu 14.04 using: arm-linux-gnueabi-gcc-4.7 -c -g -o reloc_armhf_gcc.o.elf hello.c * testfiles: add reloc_armhf_gcc.o.elf Generated on Ubuntu 14.04 using: arm-linux-gnueabihf-gcc-4.7 -c -g -o reloc_armhf_gcc.o.elf hello.c * readelf: print soft-float abi for ARM if EF_ARM_ABI_FLOAT_SOFT in flags * readelf: print hard-float abi for ARM if EF_ARM_ABI_FLOAT_HARD in flags * readelf: print BE8 info for armeb binaries * testfiles: add simple_armhf_gcc.o.elf Generated on Ubuntu 14.04 using: arm-linux-gnueabihf-gcc-4.7 -g -o simple_armhf_gcc.o.elf hello.c * elf: remove unwind from dicts and set ARM_EXIDX description * testfiles: add reloc_armsf_gcc.o.elf as soft float testcase taken from binutils 2.30 * testfiles: add reloc_armeb_gcc.o.elf as arm big endian testcase taken from binutils 2.30 testcase arm-be8 * readelf: print endian info LE8 if flag was set in header flags
Configuration menu - View commit details
-
Copy full SHA for ab76d5c - Browse repository at this point
Copy the full SHA ab76d5cView commit details
Commits on Sep 1, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 07cac37 - Browse repository at this point
Copy the full SHA 07cac37View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba743b2 - Browse repository at this point
Copy the full SHA ba743b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 572d5e8 - Browse repository at this point
Copy the full SHA 572d5e8View commit details
Commits on Sep 5, 2018
-
Call relocation for ARM V3 (eliben#194)
* Add support for 'R_ARM_CALL' relocation type * Add test script and test files to verify support for 'R_ARM_CALL' Signed-off-by: Koltunov Dmitry <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f52f666 - Browse repository at this point
Copy the full SHA f52f666View commit details -
Configuration menu - View commit details
-
Copy full SHA for 117bb68 - Browse repository at this point
Copy the full SHA 117bb68View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e8e8b8 - Browse repository at this point
Copy the full SHA 8e8e8b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for e762568 - Browse repository at this point
Copy the full SHA e762568View commit details -
Configuration menu - View commit details
-
Copy full SHA for 494ce81 - Browse repository at this point
Copy the full SHA 494ce81View commit details -
Configuration menu - View commit details
-
Copy full SHA for f613689 - Browse repository at this point
Copy the full SHA f613689View commit details
Commits on Oct 4, 2018
-
Provide enums for DT_FLAGS and DT_FLAGS_1 (eliben#200)
* Provide enums for DT_FLAGS and DT_FLAGS_1 This change adds two enums with the name to value mappings for the two flags fields in the dynamic section. The values and corresponding names are taken from the elf/elf.h file in the most recent glibc version. The enums are also used to print the names instead of the raw hex values for DT_FLAGS and DT_FLAGS_1 in scripts/readelf.py. Fixes: eliben#189 * Add test file for DT_FLAGS/DT_FLAGS_1 parsing The test file has the DF_BIND_NOW and DF_ORIGIN flags set in DT_FLAGS as well as DF_1_NOW, DF_1_GLOBAL, DF_1_NOOPEN and DF_1_ORIGIN flags in DF_FLAGS_1. This is the source code for the dt_flags.elf file: #include <stdio.h> int function(const char *arg){ printf("Hello, %s!", arg); return 0; } and was compiled using the following command line: $ gcc -shared -m32 \ -Wl,-rpath,'$ORIGIN/lib',-z,global,-z,origin,-z,nodlopen,-z,now \ -o testfiles_for_readelf/dt_flags.elf dt_flags.c
Configuration menu - View commit details
-
Copy full SHA for 9f3bf5d - Browse repository at this point
Copy the full SHA 9f3bf5dView commit details
Commits on Oct 25, 2018
-
ARMAttribute: fix access to structs, stream and nul (eliben#203)
The __init__ function of ARMAttribute has two parameters structs and stream through which the caller can pass in the relevant objects (ARMAttributesSubsubsection does that after seeking to the right position in stream). The accesses for TAG_SECTION and TAG_SYMBOL, however, were referring to non-existing members instead of the parameters. Additionally, one assertion tries to access an undefined 'null_byte' variable which should be 'nul' instead.
Configuration menu - View commit details
-
Copy full SHA for c2f6fe3 - Browse repository at this point
Copy the full SHA c2f6fe3View commit details
Commits on Oct 27, 2018
-
Remove unnecessary 'preserve_stream_pos' (eliben#204)
The stream position in the .debug_info stream can't change when reading from the .debug_abbrev stream.
Configuration menu - View commit details
-
Copy full SHA for f9d3e90 - Browse repository at this point
Copy the full SHA f9d3e90View commit details
Commits on Nov 25, 2018
-
Implemented ELFFile.get_machine_arch for the remaining architectures. (…
…eliben#206) * Implemented ELFFile.get_machine_arch for the remaining architectures. Added all architectures according to the ENUM_E_MACHINE. * Refactored if statement into dict.get.
Configuration menu - View commit details
-
Copy full SHA for d60d952 - Browse repository at this point
Copy the full SHA d60d952View commit details
Commits on Dec 18, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 4c547a2 - Browse repository at this point
Copy the full SHA 4c547a2View commit details
Commits on Dec 20, 2018
-
Simplify handling of null DIEs (eliben#209)
The code that is intended to coalesce null DIEs into the DIE that precedes them does not do that and is actually not needed as the 'unflattening' procedure takes care of any unexpected null DIEs. Also added a unit test for verifying the DIE size calculation.
Configuration menu - View commit details
-
Copy full SHA for 5f9416f - Browse repository at this point
Copy the full SHA 5f9416fView commit details
Commits on Dec 24, 2018
-
Added support for decoding .debug_pubtypes and .debug_pubnames sectio…
…ns (eliben#208) * Added support for decoding .debug_pubtypes and .debug_pubnames sections * Added reference output to dwarf_pubnames_types.py example. * Added readelf support, fixed review comments and documentation updates * Avoid printing the entire die in pubnames example to workaround Python2 vs 3 imcompatibilites
Configuration menu - View commit details
-
Copy full SHA for ac90d06 - Browse repository at this point
Copy the full SHA ac90d06View commit details -
More efficient AbbrevDecl handling (eliben#212)
Create all the AbbrevDecl objects during parsing and later return references to them - this gives a small performance gain.
Configuration menu - View commit details
-
Copy full SHA for ee37f4c - Browse repository at this point
Copy the full SHA ee37f4cView commit details
Commits on Jan 30, 2019
-
Support for DWARFv4 location lists in dwarf_location_lists.py (eliben…
…#214) In DWARFv4 the location lists are referenced with the 'sec_offset' attribute form instead of 'data4' or 'data8'.
Configuration menu - View commit details
-
Copy full SHA for 41c9c50 - Browse repository at this point
Copy the full SHA 41c9c50View commit details
Commits on Jan 31, 2019
-
Fixup error on empty .debug_pubtypes section (eliben#215)
* tox: explicitly set locale Locale affects GNU binutils output translation which cause run_readelf_tests.py to fail if system language is not English. Signed-off-by: Efimov Vasily <[email protected]> * test: unittest reproducing error with empty ".debug_pubtypes" section Signed-off-by: Efimov Vasily <[email protected]> * NameLUT: use `construct.If` to declare "name" field This patch also fixes problem with empty first entry. Signed-off-by: Efimov Vasily <[email protected]> * NameLUT._get_entries: remove unused `bytes_read` Signed-off-by: Efimov Vasily <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for eeba82a - Browse repository at this point
Copy the full SHA eeba82aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 55af257 - Browse repository at this point
Copy the full SHA 55af257View commit details -
Configuration menu - View commit details
-
Copy full SHA for 551601b - Browse repository at this point
Copy the full SHA 551601bView commit details
Commits on Feb 16, 2019
-
Also decode strings in _DynamicStringTable.get_string() (eliben#217)
StringTableSection.get_string() returns an UTF-8 decoded string (or '' if fetching the string failed) since eliben#182 but the code in _DynamicStringTable was never updated to decode anything at all so it just returns a bytes sequence in Python 3. Let's convert the string there as well to be able to use both string tables the same way without having to worry about decoding. Adapt the test cases accordingly.
Configuration menu - View commit details
-
Copy full SHA for c382520 - Browse repository at this point
Copy the full SHA c382520View commit details
Commits on Mar 11, 2019
-
Fix LookupError when testing with tox (eliben#221)
On macOS I'm getting the following error when testing with tox on py27: ``` ERROR: invocation failed (exit code 1), logfile: /devel/pyelftools/.tox/py27/log/py27-33.log ERROR: actionid: py27 msg: installpkg cmdargs: ['/devel/pyelftools/.tox/py27/bin/pip', 'install', '-U', '--no-deps', '/devel/pyelftools/.tox/dist/pyelftools-0.25.zip'] DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. Processing ./.tox/dist/pyelftools-0.25.zip Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/private/var/folders/qz/XXX/T/pip-req-build-890d2p/setup.py", line 47, in <module> scripts=['scripts/readelf.py'] File "/devel/pyelftools/.tox/py27/lib/python2.7/site-packages/setuptools/__init__.py", line 144, in setup _install_setup_requires(attrs) File "/devel/pyelftools/.tox/py27/lib/python2.7/site-packages/setuptools/__init__.py", line 137, in _install_setup_requires dist.parse_config_files(ignore_option_errors=True) File "/devel/pyelftools/.tox/py27/lib/python2.7/site-packages/setuptools/dist.py", line 704, in parse_config_files self._parse_config_files(filenames=filenames) File "/devel/pyelftools/.tox/py27/lib/python2.7/site-packages/setuptools/dist.py", line 600, in _parse_config_files reader = io.TextIOWrapper(fp, encoding=encoding) LookupError: unknown encoding: ``` This is due to the specification of LC_ALL as simply `en_US` without an encoding. Python 3.x seems to be fine with this, but Python 2.7 barfs. As a fix, setting `LC_ALL` to `en_US.utf-8` (including an explicit encoding spec) works.
Configuration menu - View commit details
-
Copy full SHA for 9b601d3 - Browse repository at this point
Copy the full SHA 9b601d3View commit details
Commits on Mar 16, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 430e3a5 - Browse repository at this point
Copy the full SHA 430e3a5View commit details
Commits on Mar 19, 2019
-
Improve symbol table handling in DynamicSegment (eliben#219)
dynamic: parse DT_{GNU_}HASH for number of symbols In ultra-stripped binaries we can find the symbol table by parsing the dynamic segment and using the pointer in the DT_SYMTAB tag as the base address. However, we don't know anything about the number of symbols in the symbol table. Earlier, this code relied on finding the closest pointer value bigger than the base address of the symbol table. In PIE executables and shared libraries however this method could break as the pointer value for DT_SYMTAB is in the same range as things like DT_RELASZ or DT_STRSZ, leading to a too small number of symbols returned by iter_symbols(). The crashpad project has implemented a different strategy to find the number of symbols: parsing the symbol lookup hash tables (see [0]) as every symbol must have a corresponding entry in the hash table. This commit implements this behaviour for DynamicSegment, leaving the old code as a backup if neither DT_HASH or DT_GNU_HASH tags have been found. For DT_HASH type tables, it is quite easy as the header already contains the number of entries. For DT_GNU_HASH things are a bit more complicated as we need to work forward from the highest symbol referenced in the header (a good explanation of the format can be found at [1]). [0]: chromium/crashpad@1f1657d [1]: https://flapenguin.me/2017/05/10/elf-lookup-dt-gnu-hash/ * dynamic: provide more functions for symbol access So far, the DynamicSegment only provided a method to iterate over all symbols but for some use cases it might be useful to use the recovered symbol table more like a normal SymbolTableSection. To this end, provide get_symbol(index) to fetch a symbol by its index, num_symbols() to get the total number of symbols and get_symbol_by_name(name) to look for a list of symbols with a given name.
Configuration menu - View commit details
-
Copy full SHA for 27941c5 - Browse repository at this point
Copy the full SHA 27941c5View commit details
Commits on Apr 22, 2019
-
Configuration menu - View commit details
-
Copy full SHA for b66d892 - Browse repository at this point
Copy the full SHA b66d892View commit details
Commits on Jun 22, 2019
-
Fix deprecation warning in Python 3.7 (eliben#231)
$SITE_PYTHON/lib/python3.7/site-packages/elftools/construct/lib/container.py:5 Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working This change is compatible with Python 3.3 and up, when the ABCs were moved to collections.abc. Backward compatibility is retained through the try/except block.
Configuration menu - View commit details
-
Copy full SHA for 923c498 - Browse repository at this point
Copy the full SHA 923c498View commit details -
Configuration menu - View commit details
-
Copy full SHA for c6572cc - Browse repository at this point
Copy the full SHA c6572ccView commit details
Commits on Jul 18, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 7d017b9 - Browse repository at this point
Copy the full SHA 7d017b9View commit details -
dwarf/descriptions: Remove DW_LANG_Upc (eliben#234)
The standard defines only DW_LANG_UPC, and this value also contained a typo.
Configuration menu - View commit details
-
Copy full SHA for 94c9764 - Browse repository at this point
Copy the full SHA 94c9764View commit details
Commits on Jul 30, 2019
-
Fix for
CFIEntry.get_decoded()
(eliben#232)* test: test `CFIEntry.get_decoded()` This test detects an error in `CFIEntry.get_decoded()`, that occurs when decodes the `DW_CFA_def_cfa_register` instruction without some CFA definition previously. Signed-off-by: Koltunov Dmitry <[email protected]> * add empty `cfa` for fixup decode of the `DW_CFA_def_cfa_register` Signed-off-by: Koltunov Dmitry <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 678652d - Browse repository at this point
Copy the full SHA 678652dView commit details
Commits on Aug 2, 2019
-
Improved handling of location information (eliben#225)
This commit moves some of the location-handling code from the examples to a new class (LocationParser) in order to make it more reusable. Also adds two test files containing location information.
Configuration menu - View commit details
-
Copy full SHA for 19fafd6 - Browse repository at this point
Copy the full SHA 19fafd6View commit details
Commits on Sep 11, 2019
-
Portable import of collections.Mapping
Tested with Python 3.8 Based on eliben#237 by @Plailect. Closes eliben#237
Configuration menu - View commit details
-
Copy full SHA for 0210034 - Browse repository at this point
Copy the full SHA 0210034View commit details
Commits on Sep 17, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 12a0b9f - Browse repository at this point
Copy the full SHA 12a0b9fView commit details
Commits on Sep 18, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 85a698d - Browse repository at this point
Copy the full SHA 85a698dView commit details
Commits on Oct 3, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 5d0d111 - Browse repository at this point
Copy the full SHA 5d0d111View commit details
Commits on Oct 4, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 232b628 - Browse repository at this point
Copy the full SHA 232b628View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a89e6f - Browse repository at this point
Copy the full SHA 2a89e6fView commit details -
dwarf/constants: More DW_LANG, DW_ATE constants (eliben#245)
Most of these were added in DWARFv5.
Configuration menu - View commit details
-
Copy full SHA for cb0b3e9 - Browse repository at this point
Copy the full SHA cb0b3e9View commit details
Commits on Oct 18, 2019
-
dwarf/die: Handle DW_FORM_flag_present in value translation (eliben#246)
* dwarf/die: Handle DW_FORM_flag_present in value translation When an attribute has form DW_FORM_flag_present it is implicitly indicated as present, with no actual value. Ref. DWARFv4, section 7. * test: Add DW_FORM_flag_present value test * test: Fix iteration * test: Remove old assert
Configuration menu - View commit details
-
Copy full SHA for 1d1a498 - Browse repository at this point
Copy the full SHA 1d1a498View commit details
Commits on Oct 21, 2019
-
Include README.rst instead of README in manifest (eliben#247)
`setup.py bdist_wheel` warns about not finding README.
Configuration menu - View commit details
-
Copy full SHA for 1e43567 - Browse repository at this point
Copy the full SHA 1e43567View commit details
Commits on Oct 27, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 6f44f40 - Browse repository at this point
Copy the full SHA 6f44f40View commit details
Commits on Nov 8, 2019
-
Supersedes/closes eliben#216.
Configuration menu - View commit details
-
Copy full SHA for 670079a - Browse repository at this point
Copy the full SHA 670079aView commit details
Commits on Dec 5, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 8a40f29 - Browse repository at this point
Copy the full SHA 8a40f29View commit details -
Configuration menu - View commit details
-
Copy full SHA for 15bdb4e - Browse repository at this point
Copy the full SHA 15bdb4eView commit details
Commits on Dec 9, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 465a2be - Browse repository at this point
Copy the full SHA 465a2beView commit details
Commits on Dec 16, 2019
-
Configuration menu - View commit details
-
Copy full SHA for a347dbf - Browse repository at this point
Copy the full SHA a347dbfView commit details
Commits on Feb 4, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 9f5a73b - Browse repository at this point
Copy the full SHA 9f5a73bView commit details -
segments.py: fix TLS checks in section_in_segment() (eliben#275)
While the comment in section_in_segment() suggests that the logic follows the logic inside ELF_SECTION_IN_SEGMENT_1 with the strict parameter set, all of the checks in the binutils macro are written so that they must succeed for the section to be contained in the current segment. In our implementation, however, the checks were not properly negated. This showed in the case of .tdata and .tbss which did not appear in the section to segment mapping (these sections are found in glibc, for example). Fix it up by aligning the logic more closely to the binutils macro by implementing the same logic and returning False only if the checks fail. Additionally, introduce the third check from the upstream binutils which checks the combination of SHT_ALLOC sections and PT_LOAD-like segments. Furthermore, in the original check, the PT_GNU_RELRO type was misspelled with a 0 (zero) instead of an O so this check could never have worked. Fixes: eliben#263
Configuration menu - View commit details
-
Copy full SHA for 765e7ea - Browse repository at this point
Copy the full SHA 765e7eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1399ba2 - Browse repository at this point
Copy the full SHA 1399ba2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 46dea16 - Browse repository at this point
Copy the full SHA 46dea16View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4000c05 - Browse repository at this point
Copy the full SHA 4000c05View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9956e1c - Browse repository at this point
Copy the full SHA 9956e1cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 83ad8a2 - Browse repository at this point
Copy the full SHA 83ad8a2View commit details
Commits on Mar 6, 2020
-
construct_utils.py: add missing import (eliben#291)
Add a forgotten import of SizeofError. Fixes: eliben#278
Configuration menu - View commit details
-
Copy full SHA for e8b815d - Browse repository at this point
Copy the full SHA e8b815dView commit details
Commits on Mar 7, 2020
-
examples: Add dwarf_lineprogram_filenames.py (eliben#285)
This adds an example of the operation discussed in eliben#283. Usage: python3 ./dwarf_lineprogram_filenames.py --test x.elf y.elf z.elf
Configuration menu - View commit details
-
Copy full SHA for 934345e - Browse repository at this point
Copy the full SHA 934345eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 919dcda - Browse repository at this point
Copy the full SHA 919dcdaView commit details -
ref_addr size changed between v2 and v3 - take 2 (eliben#273)
In DWARF 2, the DW_FORM_ref_addr format matches the target address size, while in DWARF3+ it matches the bitness of the CU record. Here are the relevant fragments from the spec, part 7: v2: The second type of reference is the address of any debugging information entry within the same executable or shared object; it may refer to an entry in a different compilation unit from the unit containing the reference. This type of reference (DW_FORM_ref_addr) is the size of an address on the target architecture; it is relocatable in a relocatable object file and relocated in an executable file or shared object. v3: The second type of reference can identify any debugging information entry within a program; in particular, it may refer to an entry in a different compilation unit from the unit containing the reference, and may refer to an entry in a different shared object. This type of reference (DW_FORM_ref_addr) is an offset from the beginning of the .debug_info section of the target executable or shared object; it is relocatable in a relocatable object file and frequently relocated in an executable file or shared object. For references from one shared object or static executable file to another, the relocation and identification of the target object must be performed by the consumer. In the 32-bit DWARF format, this offset is a 4-byte unsigned value; in the 64-bit DWARF format, it is an 8-byte unsigned value (see Section 7.4). If elftools encounters 32-bit DWARF v2 targeting a 64-bit architecture, it will misparse DW_FORM_ref_addr and crash downstream. I encountered this in an iOS binary from 2017, built with Xcode several versions ago for ARM64. This probably never came up before because by the time 64 bit code became relevant, most toolchains would generate DWARF 3 or newer. Co-authored-by: Seva Alekseyev <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4ff90bf - Browse repository at this point
Copy the full SHA 4ff90bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ee8588 - Browse repository at this point
Copy the full SHA 8ee8588View commit details -
Configuration menu - View commit details
-
Copy full SHA for 85b30d2 - Browse repository at this point
Copy the full SHA 85b30d2View commit details -
Add resilience for degenerate cases present in files with only debug …
…information (eliben#287) Some ELF files which contain only debug symbols have important sections present in the section table but marked as NOBITS instead of PROGBITS. Attempting to extract the segments can lead to crashes through parsing invalid data. The first patch modifies the dynamic segment/section specifically to add a flag for this case, since it seems to assume that there will always be at least one entry, DT_NULL. The second patch modifies the segment code more generally to return a dummy answer for what data it holds. The actual way that this change prevents a crash is while trying to parse .eh_frame when it is in fact NOBITS - originally I had a more targeted patch, but decided that it was important enough to do more generally
Configuration menu - View commit details
-
Copy full SHA for a3f1b7c - Browse repository at this point
Copy the full SHA a3f1b7cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 92f4209 - Browse repository at this point
Copy the full SHA 92f4209View commit details -
Configuration menu - View commit details
-
Copy full SHA for f057241 - Browse repository at this point
Copy the full SHA f057241View commit details -
readelf.py: adapt section mapping output for .tbss sections (eliben#289)
* readelf.py: adapt section mapping output for .tbss sections GNU readelf does not show the .tbss section as part of the loaded data segment when listing the section to segment mappings, using the ELF_TBSS_SPECIAL macro in include/elf/internal.h to skip printing the section name. Implement the same logic in readelf.py. * test: add test file for .tbss output in readelf.py This test file includes a .tbss section which is not output by GNU readelf as part of the loaded data segment when listing the section to segment mappings. The source code for tls.elf is simply: __thread int i; int main(){} The file was compiled using the following command line: $ gcc -o tls.elf -m32 tls.c
Configuration menu - View commit details
-
Copy full SHA for c8ccce8 - Browse repository at this point
Copy the full SHA c8ccce8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 25a0660 - Browse repository at this point
Copy the full SHA 25a0660View commit details -
readelf: print addend for RELA relocations without symbol (eliben#292)
* readelf: print addend for RELA relocations without symbol When processing relocations from a SHT_RELA type section, GNU readelf displays the value of the 'r_addend' field if no symbol index is given (that is, 'r_info_sym' is 0). By also implementing this we can better test the output for 64-bit binaries which commonly use SHT_RELA relocations. The included test file is the same as tls.elf but compiled for x86_64. Its code is the following: __thread int i; int main(){} and it is compiled using the following command line: $ gcc -m64 -o tls64.elf tls.c * test: add source file for tls{,64}.elf The comments at the top describe how to compile the source file into tls.elf and tls64.elf.
Configuration menu - View commit details
-
Copy full SHA for 6fff9b5 - Browse repository at this point
Copy the full SHA 6fff9b5View commit details
Commits on Mar 9, 2020
-
Minor enhancements for readelf-based tests (eliben#293)
* Add handling for SHT_MIPS_ABIFLAGS section types * Add handling for SHF_MASKPROC section flags * Add handling for DT_MIPS_FLAGS dynamic table entries * Display DT_MIPS_SYMTABNO and DT_MIPS_LOCAL_GOTNO entries as decimal ints * Adjust display of NT_GNU_GOLD_VERSION notes
Configuration menu - View commit details
-
Copy full SHA for 2060b82 - Browse repository at this point
Copy the full SHA 2060b82View commit details -
{GNU,}HashSection: Implement symbol lookup (eliben#290)
In super-stripped binaries, symbol tables can not be accessed directly as we do not have section headers to find them. In this case, we can already use the mandatory DynamicSegment which provides methods for individual access and iteration over symbols via a minimal implementation of symbol hash sections which only provided the number of symbols so far. As we can also directly look up symbols via the hash table, let's implement this functionality as well. The code is based on @rhelmot's implementation as discussed in eliben#219, with some changes around reading the hash parameters. For supporting individual symbol lookup, we also need the corresponding symbol table to get the Symbol objects if the matching hash was found in the hash section. In regular ELF files, the symbol table is denoted by the section index provided in the sh_link field of the hash section and automatically created when building the hash section, for super-stripped binaries we can use the DynamicSegment (which needs to be present in any case) as the symbol table as it also provides a get_symbol() method relying on other ways to determine the list of symbols. Both of these variants can be seen in the improved test_hash.py file. The hash tables are implemented in a base class which does not derive from the Section class in order to allow instantiation even if no section headers are present in the underlying file.
Configuration menu - View commit details
-
Copy full SHA for 966438d - Browse repository at this point
Copy the full SHA 966438dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 25a2375 - Browse repository at this point
Copy the full SHA 25a2375View commit details
Commits on Mar 10, 2020
-
readelf.py: minor enhancements for debugging (eliben#294)
* readelf.py: add an option to show traceback on error * readelf.py: flush stdout before printing to sys.stderr This is necessary to make error messages appear after any display that was emitted before the error actually happened.
Configuration menu - View commit details
-
Copy full SHA for ecc5a2d - Browse repository at this point
Copy the full SHA ecc5a2dView commit details -
callframe.py: fix DW_EH_PE_absptr decoding (eliben#295)
* Handle type2/type3 relocation fields for ELF64 MIPS binaries * dwarf/callframe.py: fix field read using the DW_EH_PE_absptr encoding This encoding represents target addresses, so it is the virtual address space determines its size, not the DWARF format. Fixes eliben#288
Configuration menu - View commit details
-
Copy full SHA for a70ccd3 - Browse repository at this point
Copy the full SHA a70ccd3View commit details
Commits on Mar 13, 2020
-
Configuration menu - View commit details
-
Copy full SHA for cb5c2f6 - Browse repository at this point
Copy the full SHA cb5c2f6View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd84dd1 - Browse repository at this point
Copy the full SHA fd84dd1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7688f2a - Browse repository at this point
Copy the full SHA 7688f2aView commit details
Commits on Mar 14, 2020
-
Initial commit of new expr parsing function.
Basic unit tests pass, but old code is still in place and descriptions is not yet converted.
Configuration menu - View commit details
-
Copy full SHA for 43adb41 - Browse repository at this point
Copy the full SHA 43adb41View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d97b6e - Browse repository at this point
Copy the full SHA 3d97b6eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4cf5cb0 - Browse repository at this point
Copy the full SHA 4cf5cb0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a98d47 - Browse repository at this point
Copy the full SHA 4a98d47View commit details -
Configuration menu - View commit details
-
Copy full SHA for 79dd5d5 - Browse repository at this point
Copy the full SHA 79dd5d5View commit details -
Cache dispatch table between expr parses
In descriptions, ExprDumper invokes parse_expr many times on small expressions. Initializing the dispatch table for every parse is wasteful. Wrap parse_expr with a simple object that generates and caches the dispatch table during initialization. parse_expr remains stateless. Updates eliben#298
Configuration menu - View commit details
-
Copy full SHA for 2c8f7dc - Browse repository at this point
Copy the full SHA 2c8f7dcView commit details -
Simplify ExprDumper now that the expression parser is simpler.
We no longer need the part-by-part dumping and separate process/get_str. Also simplify tests. Fixes eliben#298
Configuration menu - View commit details
-
Copy full SHA for 9377b55 - Browse repository at this point
Copy the full SHA 9377b55View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ac99ad - Browse repository at this point
Copy the full SHA 6ac99adView commit details
Commits on Mar 17, 2020
-
Enhance MIPS64 testing and simplify handling code for its peculiar re…
…locations (eliben#300) * Add handling for SHF_MASKOS section flags * Add readelf testcases for MIPS64 specificities * Simplify the decoding of MIPS64 relocations Instead of using "fake" fields to parse the relocation structure and then use complex shift/masks to recover the conveyed information (once for big endian binaries, twice for little endian ones), use fields actually described in the spec and use straightforward shifts to synthetize the "fake" fields.
Configuration menu - View commit details
-
Copy full SHA for 3156d6f - Browse repository at this point
Copy the full SHA 3156d6fView commit details
Commits on Mar 21, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 742a7c7 - Browse repository at this point
Copy the full SHA 742a7c7View commit details
Commits on Mar 22, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 98f0cdb - Browse repository at this point
Copy the full SHA 98f0cdbView commit details -
Fix --parallel readelf test after previous commit
Previous commit broke them because lambdas can't be picked by multiprocessing
Configuration menu - View commit details
-
Copy full SHA for b9129ce - Browse repository at this point
Copy the full SHA b9129ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for e9df2e5 - Browse repository at this point
Copy the full SHA e9df2e5View commit details
Commits on Mar 23, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 641729c - Browse repository at this point
Copy the full SHA 641729cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2697329 - Browse repository at this point
Copy the full SHA 2697329View commit details
Commits on Mar 28, 2020
-
Configuration menu - View commit details
-
Copy full SHA for ea81c3e - Browse repository at this point
Copy the full SHA ea81c3eView commit details
Commits on Apr 22, 2020
-
Cached random access to CUs and DIEs (eliben#264)
* dwarf/compileunit: Lookup DIE from a reference Accept a resolved reference address for a DIE in a compile unit and parse the DIE at that location. Insert into the _diemap / _dielist cache shared with iter_DIE_children() for fast repeated lookups. This can be used to follow attribute references to a DIE that be referenced several times (eg for a DW_AT_type reference) or find a DIE referenced in a lookup table. * dwarf/dwarfinfo: Cache CUs, direct parse or search from known units Maintain a cache of compile units parsed and a map of their offsets similar to the one mainained of DIEs by compile units. Add the ability to parse a random compile unit when the offset of the compile unit header is known. Add the ability to search for a compile unit containing (spanning) a given refaddr, such as that obtained from a DIE reference class attribute, starting from the closest previous cached compile unit. * dwarf/die: search for parents on demand Add a function to set the _parent link of known chldren, iterating down each parent of a target DIE. Walk all children of a given parent and set each child's ._parent to avoid O(n^2) walking. A future commit will add other methods to instatiate a DIE that will not set the _parent link as the DIE is instantiated. This walk uses the knowledge that in a flattened tree a parents offset will always be less than the childs. The call to die.set_parent in compile_unit iter_DIE_children could be removed to make the method private,, but it is free to set starting from the top DIE. Alternativly make it an optional argument to DIE creation. * dwarf/dwarfinfo: APIs to lookup DIEs Add APIs to lookup a DIE from: (a) a DIE reference class attribute taking into account the attribute form, (b) from a lookup table entry (NameLUTEntry) from a .pub_types or .pub_names section, or (c) directly from a reference addresss (.debug_info offset) regardless of how it was obtained. Add a test that will lookup dies from pubnames and follow die by ref. This is a simple test that exercises the new cache lookup methods and provides a starting point on how to determine a variables type. For now raise NotImplemented exception for type signature lookup and supplemental dwarf object files.
Configuration menu - View commit details
-
Copy full SHA for 519a234 - Browse repository at this point
Copy the full SHA 519a234View commit details
Commits on Apr 27, 2020
-
Fix a typo in adapters.py (eliben#309)
Chunbo committedApr 27, 2020 Configuration menu - View commit details
-
Copy full SHA for e987bd8 - Browse repository at this point
Copy the full SHA e987bd8View commit details
Commits on May 21, 2020
-
Fix determining PAGESIZE under Jython (eliben#314)
Jython has neither `resource` nor `mmap`, therefore just use a reasonable default.
Configuration menu - View commit details
-
Copy full SHA for 478f61c - Browse repository at this point
Copy the full SHA 478f61cView commit details
Commits on May 23, 2020
-
fix issue in aranges cu_offset_at_addr (eliben#310)
* fix issue in aranges cu_offset_at_addr if there are aranges for some parts of the binary but not others, incorrect aranges may be returned * add test suite for absent/partial/complete aranges
Configuration menu - View commit details
-
Copy full SHA for 9f12da5 - Browse repository at this point
Copy the full SHA 9f12da5View commit details
Commits on Jun 1, 2020
-
dwarf/dwarf_expr: Add support for DW_OP_GNU_push_tls_address (eliben#315
) * dwarf/dwarf_expr: Add support for DW_OP_GNU_push_tls_address * dwarf/dwarf_expr: Use a single 64-bit operand for const8x DWARFv4 2.5.1.1: this should be consumed as a single 64-bit operand, not as two 32-bit operands. * dwarf/descriptions: Fix descriptions for const8{u,s} * test: Add tests for changed OPs
Configuration menu - View commit details
-
Copy full SHA for 1ed78f5 - Browse repository at this point
Copy the full SHA 1ed78f5View commit details
Commits on Jun 8, 2020
-
Add PT_GNU_PROPERTY enum (eliben#319)
This commit adds the missing `PT_GNU_PROPERTY` program header enums. Additional information regarding the `PT_GNU_PROPERTY` can be found at: * https://reviews.llvm.org/D70959 * https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf (linked in above url) * https://sourceware.org/pipermail/libc-alpha/2020-May/113841.html (commit in libc adding this value) This program header can be found, e.g., in a glibc in Ubuntu 20.04 (see `docker run --rm -it ubuntu:20.04 cat /usr/lib/x86_64-linux-gnu/libc-2.31.so > libc-2.31.so`).
Configuration menu - View commit details
-
Copy full SHA for a5ee9be - Browse repository at this point
Copy the full SHA a5ee9beView commit details
Commits on Jun 9, 2020
-
initial support for aarch64 little endian (eliben#318)
See also: https://static.docs.arm.com/ihi0056/b/IHI0056B_aaelf64.pdf for relocation types and https://developer.arm.com/docs/ihi0057/c/dwarf-for-the-arm-64-bit-architecture-aarch64-abi-2018q4 for DWARF register names. Issue eliben#317 Link: ClangBuiltLinux/frame-larger-than#4 Signed-off-by: Nick Desaulniers <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3d91dbe - Browse repository at this point
Copy the full SHA 3d91dbeView commit details
Commits on Jul 7, 2020
-
dwarf.CallFrameInfo: Support parsing LSDA pointers from FDEs. (eliben…
…#308) * dwarf.CallFrameInfo: Support parsing LSDA pointers from FDEs. * Add a test case. * Make 0 explicit. More doc-string.
Configuration menu - View commit details
-
Copy full SHA for ff8331a - Browse repository at this point
Copy the full SHA ff8331aView commit details
Commits on Jul 8, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 63e9137 - Browse repository at this point
Copy the full SHA 63e9137View commit details -
Configuration menu - View commit details
-
Copy full SHA for a2880a7 - Browse repository at this point
Copy the full SHA a2880a7View commit details -
for sibling of form ref_addr, only sibling value should be used (elib…
…en#268) * for sibling of form ref_addr, only sibling value should be used * Add ELF testcase for PR eliben#268
Configuration menu - View commit details
-
Copy full SHA for 5754253 - Browse repository at this point
Copy the full SHA 5754253View commit details -
Revert "for sibling of form ref_addr, only sibling value should be us…
…ed (eliben#268)" This reverts commit 5754253. This breaks the tests: Test file 'test/testfiles_for_readelf/sibling_ref_addr.elf' .......................FAIL ....for option "-e" ....Output #1 is readelf, Output eliben#2 is pyelftools @@ Mismatch on line eliben#13: >> flags: 0x80000000, emb<< >> flags: 0x80000000<< ([('equal', 0, 47, 0, 47), ('delete', 47, 52, 47, 47)]) @@ Output #1 dumped to file: /tmp/out1_vn_mmkbu.stdout @@ Output eliben#2 dumped to file: /tmp/out2_l8_zbr6h.stdout .......................FAIL ....for option "-n" ....Output #1 is readelf, Output eliben#2 is pyelftools @@ Mismatch on line eliben#2: >> apuinfo 0x00000008 nt_arch (architecture)<< >> apuinfo 0x00000008 nt_gnu_hwcap (dso-supplied software hwcap info)<< ([('equal', 0, 37, 0, 37), ('insert', 37, 37, 37, 66), ('equal', 37, 39, 66, 68), ('insert', 39, 39, 68, 72), ('equal', 39, 40, 72, 73), ('replace', 40, 41, 73, 75), ('equal', 41, 42, 75, 76), ('delete', 42, 47, 76, 76), ('equal', 47, 48, 76, 77), ('replace', 48, 55, 77, 80), ('equal', 55, 56, 80, 81)]) @@ Output #1 dumped to file: /tmp/out1_kla3jq33.stdout @@ Output eliben#2 dumped to file: /tmp/out2_qzmuu23z.stdout @@ aborting - 'test/external_tools/readelf -x.text' returned '1' Conclusion: FAIL
Configuration menu - View commit details
-
Copy full SHA for b87fbea - Browse repository at this point
Copy the full SHA b87fbeaView commit details -
Configuration menu - View commit details
-
Copy full SHA for d1fc159 - Browse repository at this point
Copy the full SHA d1fc159View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ca1668 - Browse repository at this point
Copy the full SHA 7ca1668View commit details
Commits on Jul 20, 2020
-
Return the correct number of program headers when e_phnum is 0xffff (e…
…liben#326) * Return the correct number of program headers when e_phnum is 0xffff * Added link and relevant text of the specification
Configuration menu - View commit details
-
Copy full SHA for eeddaba - Browse repository at this point
Copy the full SHA eeddabaView commit details
Commits on Jul 25, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 619ba26 - Browse repository at this point
Copy the full SHA 619ba26View commit details
Commits on Aug 18, 2020
-
Fix python versions for tests that run
On Travis run fewer old Python versions. Locally, only run the latest Python 2.x and 3.x Closes eliben#305
Configuration menu - View commit details
-
Copy full SHA for 9d722d7 - Browse repository at this point
Copy the full SHA 9d722d7View commit details
Commits on Aug 19, 2020
-
Configuration menu - View commit details
-
Copy full SHA for ee0face - Browse repository at this point
Copy the full SHA ee0faceView commit details
Commits on Sep 23, 2020
-
Configuration menu - View commit details
-
Copy full SHA for a570d48 - Browse repository at this point
Copy the full SHA a570d48View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e503b5 - Browse repository at this point
Copy the full SHA 9e503b5View commit details -
Set to run only on ubuntu because of readelf binary
Also fix mentions of Travis
Configuration menu - View commit details
-
Copy full SHA for b9f0e40 - Browse repository at this point
Copy the full SHA b9f0e40View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9023023 - Browse repository at this point
Copy the full SHA 9023023View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab84e68 - Browse repository at this point
Copy the full SHA ab84e68View commit details
Commits on Oct 1, 2020
-
elf: support for ELF files with a large number of sections (eliben#333)
* elf: implement support for ELF files with a large number of sections As documented in the ELF specification [0] and reported in eliben#330, the number of sections (`e_shnum` member of the ELF header) as well as the section table index of the section name string table (`e_shstrndx` member) could exceed the SHN_LORESERVE (0xff00) value. In this case, the members of the ELF header are set to 0 or SHN_XINDEX (0xffff), respectively, and the actual values are found in the inital entry of the section header table (which is otherwise set to zeroes). So far, the implementation of `elffile.num_sections()` didn't handle these situations and simply reported that the file contained 0 sections, and `scripts/readelf.py` presented invalid values. Fix it by following the specification more closely and showing the corresponding correct values in `readelf.py`. [0]: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html Closes: eliben#330 * test: add test file with a large number of sections This file was generated with the following commands: $ for i in {1..65280}; do echo "void __attribute__((section(\"s.$i\"), naked)) f$i(void) {}"; done > many_sections.c; echo "int main(){}" >> many_sections.c $ gcc-8 -fno-asynchronous-unwind-tables -c -o many_sections.o.elf many_sections.c $ strip many_sections.o.elf
Configuration menu - View commit details
-
Copy full SHA for 49ffaf4 - Browse repository at this point
Copy the full SHA 49ffaf4View commit details
Commits on Oct 10, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 9704150 - Browse repository at this point
Copy the full SHA 9704150View commit details
Commits on Oct 26, 2020
-
hash.py: observe endianness when reading hashes (eliben#338)
Reading the hashes from a GNUHashTable didn't properly use the endianness of the underlying ELF file, so looking up hashes would fail if the byte order of the analyzed file did not match the native byte order of the current machine. The test file consists of two functions: int callee(){ return 42; } int caller(){ return callee(); } and was compiled using `aarch64_be-linux-gcc` (version 8.3 on an x86_64 host) with the `-mbig-endian` and `-shared` command line flags.
Configuration menu - View commit details
-
Copy full SHA for d6b2913 - Browse repository at this point
Copy the full SHA d6b2913View commit details
Commits on Oct 27, 2020
-
Configuration menu - View commit details
-
Copy full SHA for e5ed0ee - Browse repository at this point
Copy the full SHA e5ed0eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for b9548e6 - Browse repository at this point
Copy the full SHA b9548e6View commit details -
Configuration menu - View commit details
-
Copy full SHA for ee723a3 - Browse repository at this point
Copy the full SHA ee723a3View commit details -
Add a bit more details to dwarf_pubnames_types example
Fix reference output and make test emit both outputs when they differ
Configuration menu - View commit details
-
Copy full SHA for 2ec8d03 - Browse repository at this point
Copy the full SHA 2ec8d03View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba73057 - Browse repository at this point
Copy the full SHA ba73057View commit details -
Configuration menu - View commit details
-
Copy full SHA for dc26051 - Browse repository at this point
Copy the full SHA dc26051View commit details -
Configuration menu - View commit details
-
Copy full SHA for 28e7f6d - Browse repository at this point
Copy the full SHA 28e7f6dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f851f7 - Browse repository at this point
Copy the full SHA 9f851f7View commit details
Commits on Dec 7, 2020
-
added a method for returning the index of a section by name (eliben#331)
* added an method for returning the index of a section by name Signed-off-by: Jonathan <[email protected]> * changed naming of init mapping function Signed-off-by: Jonathan <[email protected]> * Fixed CR Added a test file containing 3 tests 1. test index of existing section 2. test index of missing section 3. test index of existing section when section_map_name is None Signed-off-by: Jonathan Bruchim <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ad5375f - Browse repository at this point
Copy the full SHA ad5375fView commit details
Commits on Jan 12, 2021
-
ELFFile: allow filtering of sections by type in iter_sections (eliben…
…#345) As stated in the corresponding issue, we can already filter the output of Dynamic.iter_tags() by the type of the tag we're looking for. Let's adapt the iteration over the sections of the ELF file so that it only yields sections of a certain type if the optional type parameter is passed to iter_sections(). By doing this we can also simplify two call sites inside the ELFFile class. Fixes: eliben#344
Configuration menu - View commit details
-
Copy full SHA for d71faeb - Browse repository at this point
Copy the full SHA d71faebView commit details -
dynamic.py: move logic around to allow symbol access more easily (eli…
…ben#346) So far, the implementation of num_symbols() and get_symbol() in the DynamicSegment class depended on iter_symbols(). However, most part of iter_symbols() is actually about determining the number of symbols. Let's move that logic to the correct method and use it in iter_symbols(). Additionally, in an ELF file without any exported symbols, the hash table will be empty and will thus return a too low number of symbols. However, a loader might still need to access the imported symbols (which also have an entry in the symbol table, with st_shndx set to SHN_UNDEF). To allow this, make get_symbol() take any index and simply read the symbol data from the corresponding index, and use get_symbol() from iter_symbols(). This way, one can for example use symbol index information from relocation entries to directly access the symbol data. These changes also make the logic in DynamicSegment resemble the code in SymbolTableSection more closely. Fixes: eliben#342
Configuration menu - View commit details
-
Copy full SHA for 14bc163 - Browse repository at this point
Copy the full SHA 14bc163View commit details
Commits on Jan 20, 2021
-
fix wrong prpsinfo in 32bit coredump (eliben#347)
* fix wrong prpsinfo in 32bit coredump * add a sample coredump * finish the testcase for 32bit core dump
Configuration menu - View commit details
-
Copy full SHA for fd7df9d - Browse repository at this point
Copy the full SHA fd7df9dView commit details
Commits on Jan 26, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 46187f4 - Browse repository at this point
Copy the full SHA 46187f4View commit details
Commits on Apr 18, 2021
-
Configuration menu - View commit details
-
Copy full SHA for a643660 - Browse repository at this point
Copy the full SHA a643660View commit details
Commits on May 15, 2021
-
initial support for PPC64LE (eliben#360)
* initial support for PPC64LE See also: https://openpowerfoundation.org/wp-content/uploads/2016/03/ABI64BitOpenPOWERv1.1_16July2015_pub4.pdf 3.4.1 Symbol Values 3.5.3 Relocation Types Table Fixes eliben#317 Signed-off-by: Nick Desaulniers <[email protected]> * remove references to LLVM_ADDR_SIG
Configuration menu - View commit details
-
Copy full SHA for 0664de0 - Browse repository at this point
Copy the full SHA 0664de0View commit details
Commits on May 21, 2021
-
dwarf/constants: add DW_LNCT_* constants (eliben#362)
These were introduced with DWARFv5 and are documented in S. 6.2.4.1.
Configuration menu - View commit details
-
Copy full SHA for e128bab - Browse repository at this point
Copy the full SHA e128babView commit details
Commits on May 27, 2021
-
dwarf: initial DWARFv5 support (eliben#363)
* dwarf: initial DWARFv5 support * dwarf/structs: use Embed to select header layout * dwarf/structs: DW_FORM_strx family Not sure how best to handle 24-bit values yet. * dwarf/structs: use IfThenElse `If` alone wraps the else in a `Value`. * dwarf/structs: DW_FORM_addrx family handling * dwarf_expr: support DW_OP_addrx Not complete, but gets readelf.py to the end of a single binary. * dwarf/constants: DW_UT_* constants * dwarf/structs: fix some DW_FORMs * elftools, test: plumbing for DWARFv5 sections * dwarf/constants: fix typo * dwarf/structs: re-add a comment that got squashed * dwarf/structs: DWARFv5 table header scaffolding * dwarf/constants: typo * test: add a basic DWARFv5 test
Configuration menu - View commit details
-
Copy full SHA for 4384ad8 - Browse repository at this point
Copy the full SHA 4384ad8View commit details
Commits on Aug 2, 2021
-
fixed parsing for structures containing uids or gids in core dumps fo…
…r most architectures (eliben#354) * fixed parsing for structures containing uids or gids in core dumps for most architectures * added testcase for mips corefile uid/gid parsing * better description * better email
Configuration menu - View commit details
-
Copy full SHA for ab444d9 - Browse repository at this point
Copy the full SHA ab444d9View commit details
Commits on Aug 31, 2021
-
[example] bug fixes in dwarf_decode_address example (eliben#361)
* [example] Handle lpe with end_sequence correctly * [example] exclude highpc in address comparison in decode_funcname Co-authored-by: Jangseop Shin <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9db67b1 - Browse repository at this point
Copy the full SHA 9db67b1View commit details
Commits on Sep 17, 2021
-
Keep raw note descriptors in ELF note sections as raw bytes (eliben#372)
* ELF notes: keep raw note descriptors as bytes * py3compat: add bytes2hex function * elf/descriptions: use bytes2hex where needed * ELF notes: convert to string only for known types
Configuration menu - View commit details
-
Copy full SHA for cc47f5f - Browse repository at this point
Copy the full SHA cc47f5fView commit details
Commits on Oct 16, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 4e88880 - Browse repository at this point
Copy the full SHA 4e88880View commit details
Commits on Oct 25, 2021
-
ELFFile: allow filtering by segment type in iter_segments() (eliben#375)
This is very similar to the filtering implemented for sections in commit d71faeb.
Configuration menu - View commit details
-
Copy full SHA for a74b8ab - Browse repository at this point
Copy the full SHA a74b8abView commit details
Commits on Oct 29, 2021
-
Configuration menu - View commit details
-
Copy full SHA for fa46554 - Browse repository at this point
Copy the full SHA fa46554View commit details
Commits on Nov 6, 2021
-
* DWARF 5 tags and attributes * DW_AT_virtual Co-authored-by: Seva Alekseyev <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 87c7eba - Browse repository at this point
Copy the full SHA 87c7ebaView commit details
Commits on Nov 17, 2021
-
DW_AT_private=0x24 (eliben#382)
* DWARF 5 tags and attributes * DW_AT_private Co-authored-by: Seva Alekseyev <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0a997c1 - Browse repository at this point
Copy the full SHA 0a997c1View commit details
Commits on Dec 7, 2021
-
Add support for .note.gnu.property notes section (eliben#386)
* Add support for .note.gnu.properties notes section References: - Doc: https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf - Linux: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=00e19ceec80b03a43f626f891fcc53e57919f1b3 - Glibc: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/dl-prop.h;h=385548fad3e4ad71dbdcdbfada58585c2f24ea5e;hb=HEAD - Binutils: https://sourceware.org/git/?p=binutils-gdb.git&a=search&h=HEAD&st=commit&s=NT_GNU_PROPERTY_TYPE_0 * Add descriptions for .note.gnu.properties notes * descriptions: add missing PT_GNU_PROPERTY description * py3compat: add optional separator for bytes2hex * readelf: align notes column headers * elf/descriptions: conform to real readelf's output format * test: special case some known readelf output quirks * test: add test ELFs for .note.gnu.property notes
Configuration menu - View commit details
-
Copy full SHA for 5ee4158 - Browse repository at this point
Copy the full SHA 5ee4158View commit details
Commits on Dec 10, 2021
-
Update readelf to v2.37, adapt readelf.py output and tests (eliben#387)
Changes to conform the output of readelf.py to binutils readelf v2.37: - Use singular "entry" when needed instead of "entries". - Output the last entry for the .debug_line output table when DW_LNE_end_sequence is encountered, as DWARF standard dictates. Looks looks like this was a readelf bug which was fixed in commit ba8826a82a29a19b78c18ce4f44fe313de279af7 of the GNU binutils-gdb repo. - Add additional "Stmt" field in the .debug_line output table, and ignore the new "View" field. The "Stmt" field has been implemented in readelf.py. The "View" field is not something that the DWARF standard defines, it's an internal register added to the line number information state machine by binutils to perform assembler checks (see commit ba8826a82a29a19b78c18ce4f44fe313de279af7 of GNU binutils-gdb repo for more info, in particular gas/doc/as.texinfo). "View" is unimplemented in pyelftools for now and a special case has been added in the readelf test suite to ignore it. - Add support for printing section names when dumping .symtab entries of st_type STT_SECTION as readelf v2.37 does (see commit 23356397449a8aa65afead0a895a20be53b3c6b0 of GNU binutils-gdb repo). - Add suport for recognizing SOs specifically tagged as PIE (DT_FLAGS_1 dynamic tag with DF_1_PIE set). In such case, describe the file as "Position-Independent Executable file" instead of "Shared object file", as readelf v2.37 does. - Add leading "0x" for version section addresses when dumping version information (-V) as readelf does. - Ignore "D (mbind)" in section headers flags legend (pyelftools does not output this flag). Special cases ADDED for run_readelf_tests.py: - Ignore "View" column for --debug-dump=decodedline in readelf's output. - Ignore ellipsis ("[...]") for long names/symbols/paths in readelf's output. Special cases REMOVED for run_readelf_tests.py: - Detection of additional '@' after symbol names (flag_after_symtable) seems to no longer be needed as all tests pass whitout this exception. - Special case for DW_AT_apple_xxx seems to no longer be needed, readelf now recognizes those. - Special case for PT_GNU_PROPERTY no longer needed, readelf now recognizes it. Other changes: - Add missing import in elftools/dwarf/lineprogram.py. References: - GNU binutils-gdb repo: https://sourceware.org/git/?p=binutils-gdb.git
Configuration menu - View commit details
-
Copy full SHA for 662e4ab - Browse repository at this point
Copy the full SHA 662e4abView commit details -
Configuration menu - View commit details
-
Copy full SHA for 18a82d8 - Browse repository at this point
Copy the full SHA 18a82d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9689294 - Browse repository at this point
Copy the full SHA 9689294View commit details
Commits on Dec 15, 2021
-
Add support for note GNU_PROPERTY_X86_FEATURE_1_AND (eliben#388)
- Implement support for GNU property note type GNU_PROPERTY_X86_FEATURE_1_AND (which is a feature bitmask) and its relative flags. - Fix off-by-one in "Data size" column alignment for readelf.py note sections dump. References: - https://gitlab.com/x86-psABIs/x86-64-ABI
Configuration menu - View commit details
-
Copy full SHA for 8f7a0be - Browse repository at this point
Copy the full SHA 8f7a0beView commit details
Commits on Jan 11, 2022
-
Add PS3/CellOS OSABI identifier (eliben#389)
* Add PS3/CellOS OSABI identifier. * Remove "OS" from CELL OS ABI * Remove "OS" from CELL OS ABI * Add Missing comma for ELFOSABI_CELL_LV2.
Configuration menu - View commit details
-
Copy full SHA for dd6cd02 - Browse repository at this point
Copy the full SHA dd6cd02View commit details
Commits on Jan 13, 2022
-
Configuration menu - View commit details
-
Copy full SHA for dedef14 - Browse repository at this point
Copy the full SHA dedef14View commit details
Commits on Feb 3, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 7d69c1a - Browse repository at this point
Copy the full SHA 7d69c1aView commit details
Commits on Feb 14, 2022
-
Add support for DT_RELR/SHT_RELR compressed relocation sections (elib…
…en#395) As more and more tools now support DT_RELR compressed relocations (most notably, the just released GNU binutils 2.38 [0]), let's add support for reading these relocations as well. The original discussion about advantages of packe RELATIVE relocations can be found at [1]. In a nutshell, the format exploits the fact that RELATIVE relocations are often placed next to each other and (for x86_64) stores up to 64 relocations in two 8-byte words. In a regular .rela.dyn table, these would take up 24 * 64 = 1536 bytes. The compressed relocations work as follows: The first word in the section describes a base address and contains an offset for a relocation. This offset must always lie at an even address. Following this entry can be one or more bitmap(s) which have their least significant bit set to 1. All other bits describe (in increasing order of significance) if the following continuous offsets also contain a relocation. The addends for existing relocations are stored at the corresponding offsets in the file (that is, they work like REL relocations). A good description of the history of this feature and its current adoption is the following blog post [2]. [0]: https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00009.html [1]: https://groups.google.com/g/generic-abi/c/bX460iggiKg?pli=1 [2]: https://maskray.me/blog/2021-10-31-relative-relocations-and-relr
Configuration menu - View commit details
-
Copy full SHA for c2cfef0 - Browse repository at this point
Copy the full SHA c2cfef0View commit details
Commits on May 10, 2022
-
Improve DWARF 5 compatibility. (eliben#400)
* Add support DW_FORM_implicit_const * Add support for DW_FORM_line_strp * Add new tests for DW_FORM_implicit_const and DW_FORM_linestrp.
Configuration menu - View commit details
-
Copy full SHA for 97bf779 - Browse repository at this point
Copy the full SHA 97bf779View commit details
Commits on May 14, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 6a43578 - Browse repository at this point
Copy the full SHA 6a43578View commit details -
Merge pull request #1 from michaelbrownuc/rebase-upstream
elftools/* Reapply S2E-specific commits.
Configuration menu - View commit details
-
Copy full SHA for 011f917 - Browse repository at this point
Copy the full SHA 011f917View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4eed0ee - Browse repository at this point
Copy the full SHA 4eed0eeView commit details