summaryrefslogtreecommitdiffstats
path: root/libdwfl/open.c
Commit message (Collapse)AuthorAgeFilesLines
* libdwelf: New function dwelf_elf_begin.Mark Wielaard2018-11-091-8/+22
| | | | | | | | | | | | | | | | | | This introduces a new function dwelf_elf_begin which creates a (read-only) ELF handle from a possibly compressed file handle or a file that start with a linux kernel header. This can be used in eu-readelf to (re)open a (pure) ELF. eu-readelf uses libdwfl to relocate addresses in the original file in case it is ET_REL. But to show the "raw" data it might need to (re)open the file. Which could fail if the file was compressed. And produced an obscure error message: "cannot create EBL handle". This rewrites __libdw_open_file a little so that the given file handle will never be closed (whether on success or failure) and introduces a new internal function __libdw_open_elf that dwelf_elf_begin wraps. Signed-off-by: Mark Wielaard <[email protected]>
* Avoid double-including config.hUlf Hermann2017-05-021-0/+4
| | | | | | | | | | | | | | | | config.h doesn't have include guards, so including it twice is bad. We deal with this by checking for PACKAGE_NAME, but only in some places. Once we start using gnulib, we will need to include config.h before any gnulib-generated headers. This is problematic if we include it transitively through our own private headers. In order to set a clear rule about inclusion of config.h, it is now included in every .c file as first header, but not in any header. This will definitely avoid double-inclusion and satisfy the condition that it has to be included before gnulib headers. It comes at the price of adding some redundancy, but there is no clean way to avoid this. Signed-off-by: Ulf Hermann <[email protected]>
* Simplify code and build now that zlib support is no longer optional.Mark Wielaard2016-01-081-8/+2
| | | | | | | Now that we always require zlib support we don't need to conditionally build or compile code that depends on it. Signed-off-by: Mark Wielaard <[email protected]>
* Trust AC_SYS_LARGEFILE to provide large file supportJosh Stone2015-10-091-2/+2
| | | | | | | | | | | | | | | AC_SYS_LARGEFILE defines _FILE_OFFSET_BITS in config.h if needed for LFS, and this automatically maps things like open to open64. But quite a few places used explicit 64-bit names, which won't work on platforms like FreeBSD where off_t is always 64-bit and there are no foo64 names. It's better to just trust that AC_SYS_LARGEFILE is doing it correctly. But we can verify this too, as some file could easily forget to include config.h. The new tests/run-lfs-symbols.sh checks all build targets against lfs-symbols (taken from lintian) to make sure everything was implicitly mapped to 64-bit variants when _FILE_OFFSET_BITS is set. Signed-off-by: Josh Stone <[email protected]>
* libdwfl: Try opening files all installed compression libraries.Mark Wielaard2013-02-221-3/+3
| | | | | | | | | | rhbz #909481. When a compression library wasn't installed libdwfl would not try the next compression library for opening a file. Retry with the next available compression library if a previous one isn't installed. Also disable tests that depend on a particular compression library (run-readelf-s.sh and run-dwflsyms.sh) if that library isn't installed. Signed-off-by: Mark Wielaard <[email protected]>
* Update name, license and contributor policy.Mark Wielaard2012-06-051-40/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change name from "Red Hat elfutils" to "elfutils". * Update license of standalone tools and test from GPLv2 to GPLv3+. * Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+. * Add Developer Certificate of Origin based contributor policy. top-level: - COPYING: Upgraded from GPLv2 to GPLv3. - CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files. - NEWS: Added note about new contribution and license policy. - Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST. - configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'. backends, lib, libasm, libcpu, libdw, libdwfl, libebl, libelf: - All files updated to GPLv2/LGPLv3+. Except some very small files (<5 lines) which didn't have any headers at all before, the linker .maps files and the libcpu/defs files which only contain data and libelf/elf.h which comes from glibc and is under LGPLv2+. config: - elfutils.spec.in: Add new License: headers and new %doc files. - Update all license headers to GPLv2/LGPLv3+ for files used by libs. src, tests: - All files updated to GPLv3+. Except for the test bz2 data files, the linker maps and script files and some very small files (<5 lines) that don't have any headers. Signed-off-by: Richard Fontana <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Rewrite kernel image support: use calculation instead of brute force, ↵Roland McGrath2009-08-271-20/+65
| | | | support uncompressed payloads.
* libdwfl: Support automatic decompression of files in XZ format.Roland McGrath2009-08-261-1/+7
|
* Fix crash in libdw with empty input files.Ulrich Drepper2009-02-101-0/+2
|
* Fix build when missing -lz and -lbz2.Roland McGrath2009-01-221-8/+15
|
* libdwfl automagic decompression supportRoland McGrath2009-01-051-0/+143