| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Found with afl-fuzz.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
The commands to check for invalid text relocations in the generated DSOs
shouldn't be displayed. They contain an echo which prints the text.
This patch suppresses the commands from being printed.
|
|
|
|
|
|
|
| |
Using elf_getphdrnum lets us handle ELF files that use more than PN_XNUM
phdrs. And guards against some corrupt files.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
| |
Since elf_strptr can fail and return NULL we should always check the result
before usage. Debug sections are only handled by section name, so make sure
the name actually exists.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add new function dwarf_peel_type. Some type annotations in DWARF are
specified by modifier tag type wrappers instead of attributes.
For type aliases (typedef) and qualifiers (const, volatile, restrict)
tags dwarf_peel_type follows the DW_AT_type attributes till it finds
a base, user-defined, reference or pointer type DIE.
Use this new function in the backends for return type DIEs (replacing
the existing dwarf_peel_type there) and in dwarf_aggregate_size so
it can provide the sizes for qualified types too. Add a new version
and testcase for the new dwarf_aggregate_size functionality.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
glibc now supplies these (compatible) structs instead of including the
kernel's <asm/ptrace.h> header, so let's use them. Annoyingly this will
cause new elfutils to FTBFS on old glibc, and vice versa. So include a
new configure check for the new struct names and use the old ones if
they are not avilable.
Signed-off-by: Kyle McMartin <kyle@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
The big endian vs little endian changes are already handled by detecting
the EI_DATA data encoding. And the function descriptors are already not
used when we see there is no .opd section. This change adds new checks
for st_other bits, new relocations and recognizes DT_PPC64_OPT.
Signed-off-by: Menanteau Guy <menantea@linux.vnet.ibm.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
Found with run-native-test.sh om debian arm64.
http://bugs.debian.org/753552
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The DW_TAG_mutable_type was only mentioned in an early draft of DWARFv3.
But was removed because there are no C++ mutable qualified types. It was
replaced by a new attribute DW_AT_mutable on DW_TAG_member DIEs. The new
attribute is available in dwarf.h.
http://dwarfstd.org/ShowIssue.php?issue=050223.1
DW_TAG_mutable_type was only used internally in some backends (which
just ignored it anyway). dwarves did use it to turn it into a string
value, libabigail used it and ignored it (patches to remove sent).
GCC, GDB and binutils don't use nor define it.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ARM EABI says that the zero bit of function symbol st_value indicates
whether the symbol points to a THUMB or ARM function. Also the return
value address in an unwind will contain the same extra bit to indicate
whether to return to a regular ARM or THUMB function. Add a new ebl
function to mask off such bits and turn a function value into a function
address so that we get the actual value that a function symbol or return
address points to. It isn't easily possible to reuse the existing
ebl_resolve_sym_value for this purpose, so we end up with another hook
that can be used from dwfl_module_getsym, handle_cfi and elflint.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
... instead of inlining equivalent code.
Signed-off-by: Petr Machata <pmachata@redhat.com>
|
|
|
|
|
|
|
|
|
| |
And implement for arm and ia64. Both have special section types that
are valid targets for a reloc. Both refer to unwind data. elflint now
just calls ebl_check_reloc_target_type instead of hard coding the
expected section types.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
|
|
|
|
|
|
|
|
|
| |
The --enable-mudflap configure build has been broken for 2 years without
anybody apparently noticing. GCC 4.9 removed mudflap support. Before
release we now run make distcheck with valgrind support. Removal of the
mudflap configure option simplifies the build a little.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
| |
Add aarch64 backend functions frame_nregs and set_initial_registers_tid.
Mark pc_register in aarch64 prstatus_regs as pc_register.
Add backtrace-core-aarch64 testcase.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Add the initial register setup for AARCH64 running ARM code (so
called compat mode). This makes 'eu-stack -p' happy on ARM binaries
while running on a AARCH64 kernel.
Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
This is tested now in a native aarch64 build by tests/run-elflint-self.sh
since we added some .o files to the self tests.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows CFI unwinding for ARM. It relies on having .debug_frame around
which is always the case in our testsuite. All native backtrace tests PASS
on arm if debuginfo (for glibc) is installed on the system. Otherwise the
tests SKIP.
For non-debug unwinding ARM uses EXIDX tables, not .eh_frames, which
would have to be translated to CFI to do unwinding without .debug_frame
available.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The elflint self test now also checks ET_REL files. Update the list of
relocation types to include all known relocations from elf.h.
R_ARM_SWI24 was obsolete and is now named R_ARM_TLS_DESC. The only other
relocation used in the dynamic linker is R_ARM_IRELATIVE.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
| |
This just makes sure that all format strings are given as literals to
printf like functions so the compiler can see and check them. Remove
all no_Wformat, add -Wformat=2 unconditionally to AM_CFLAGS.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
To distinguish between the current PPC64 ELF ABI and the revised
ELFv2 ABI that will not use function descriptors binutils started
to emit the version (currently 1) in the ehdr e_flags. Recognize
all valid versions (0, 1 or 2) in elflint by adding the hook
ppc64_machine_flag_check.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
| |
Setup initial CIE values for aarch64 for use with dwarf_frame functions.
Register info prefix should be the empty string (not NULL) when not used.
Add an EM_AARCH64 testcase to tests/run-addrcfi.sh to check both issues.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Like some other architectures aarch64 has a special rule for the
_GLOBAL_OFFSET_TABLE_ symbol. Even if there is a .plt.got section the symbol
value still points to the start of the .got section. This is also what the
dynamic linker expects.
See https://sourceware.org/ml/libc-ports/2013-06/msg00057.html
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some arches like ppc64 use function descriptor values instead of function
addresses causing matching of names and addresses to fail when using
dwfl_module_getsym or dwfl_module_addrsym.
Add ebl hook to resolve any function descriptor values found in non-ET_REL
modules.
The new function dwfl_module_getsym_info doesn't adjust the symbol value
in any way, but returns the adjusted and/or resolved address associated
with the symbol separately. The new function dwfl_module_addrinfo resolves
against both the address associated with the symbol (which could be the
function entry address) value and the adjusted st_value. So that it is
easy to resolve and match either function descriptors and/or function
entry addresses.
Since these new functions also return more information they replace the
dwfl_module_getsym_elf and dwfl_module_addrsym_elf functions that never
made it into a released elfutils version.
addr2line and readelf now use the new functions when looking up functions
names. addr2line will now also display the section the address was found
in when given -x.
Extra testcases were added for both addr2line and the dwflsyms testscase.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
| |
Use union to avoid type-punning when assigning a double to a Dwarf_Word.
gcc complains otherwise. error: dereferencing type-punned pointer will
break strict-aliasing rules.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
| |
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
| |
Signed-off-by: Petr Machata <pmachata@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Register rules using expressions are stored using an offset from the
start of the .eh_frame or .debug_frame ELF section data. Since abi_cfi
rules aren't stored in those ELF sections they should use neither
DW_CFA_expression nor DW_CFA_val_expression. The only backend that used
DW_CFA_val_expression was ppc_cfi.c. It was easier to express the same
rule using DW_CFA_val_offset than to change the code to handle register
rules using expressions. On most architectures this did work by accident.
See the definition of struct dwarf_frame_register value in libdw/cfi.h to
see why. But on ia64 the abi_cfi data and actual frame data were placed
too far apart and caused a crash in tests/run-addrcfi.sh for ppc32.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New arm_abi_cfi that defines initial CFA, rules for callee-saved regs,
including VFP ones and return register.
Note the DWARF abi extension for ARM says that "registers intentionally
unused" should also be initialized as if by DW_CFA_same_value. The
example given is "an integer-only function might be included in one
executable file for targets with VFP and another for targets without".
We don't currently do this yet. See the DWARF and calling convention
documents:
DWARF for the ARM Architecture ABI r2.09
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0040b/IHI0040B_aadwarf.pdf
Procedure Call Standard for the ARM Architecture ABI r2.09
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042e/IHI0042E_aapcs.pdf
Also adds addrcfi arm testcase.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
For ia64 and tilegx *prefix was already set to the empty string, but
arm, ppc and sh used NULL to indicate no prefix preceded the register
name in the canonical assembler syntax. Consistently use the empty string
in all backends since dwfl_module_register_names says: 'a prefix used in
assembler syntax (such as "%" or "$", may be "")'. So users had to handle
the empty string already, and might forget to handle the NULL case
(like our own addrcfi testcase).
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
autoreconf will install config/test-driver, ignore it.
Update gettext m4 and po files to version 0.18.2.
Use AM_CPPFLAGS instead of INCLUDES.
All changes are backward compatible with Automake 1.11.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dwarf_attr () or dwarf_form () functions leave typedie NULL when they fail
because of missing attribute or unexpected form. In such cases first check
the DIE exists and return error instead of calling dwarf_tag () and crashing.
This also happens in the testsuite with native tests when elfutils is build
without DWZ support on a distro that uses DWZ DWARF compression on system
libraries. Only the backends used dwarf_tag () directly without checking,
all other uses in elfutils already checked whether the given DIE was NULL.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile.am (s390_SRCS): Add s390_corenote.c and s390x_corenote.c.
* linux-core-note.c (ALIGN_PR_REG): New definitions.
(struct EBLHOOK(prstatus)): Change field pr_reg to anonymous struct with
ALIGN_PR_REG.
(EXTRA_ITEMS): New macro.
* s390_corenote.c: New file.
* s390_init.c (s390x_core_note): New declaration.
(s390_init): Install s390x_core_note and s390_core_note.
* s390x_corenote.c: New file.
tests/
* run-readelf-mixed-corenote.sh: New testcase for readelf -n of s390
and s390x core notes.
* testfile67.bz2: New file.
* testfile68.bz2: New file.
* Makefile.am (EXTRA_DIST): Add testfile67.bz2 and testfile68.bz2 .
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
| |
* arm_corenote.c (vfp_items): Remove zero COUNT initializer.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* readelf.c (ITEM_WRAP_COLUMN, REGISTER_WRAP_COLUMN): Merge to ...
(WRAP_COLUMN): ... here.
(print_core_item): Remove parameter format_max. Update function
comment. Replace FORMAT_MAX by the real output width.
(handle_core_item): Remove the FORMAT_MAX values in TYPES, DO_TYPE,
calls of print_core_item, remove variable maxfmt, change
ITEM_WRAP_COLUMN to WRAP_COLUMN.
(handle_core_register): Remove the FORMAT_MAX values in TYPES, BITS,
calls of print_core_item, change REGISTER_WRAP_COLUMN to WRAP_COLUMN.
backends/
2012-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-core-note.c (prstatus_items): Rename groups of sigpend and
sighold to signal2 and signal3.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
| |
Signed-off-by: Petr Machata <pmachata@redhat.com>
|
|
|
|
| |
Signed-off-by: Petr Machata <pmachata@redhat.com>
|
|
|
|
| |
Signed-off-by: Jeff Kenton <jkenton@tilera.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 <rfontana@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
| |
|
| |
|
|
|
|
| |
<tg@mirbsd.de>.
|
|
|
|
|
|
|
|
|
|
| |
As I wrote when accepting the patches, there is nothing innovative in
these patches. These are copies of the files from other archs with
SH-specific data filled in from the ELF adn Dwarf spec.
Attribution is given but ownership is with Red Hat. This is so far
the only way since Red Hat doesn't have an assignment process in place
yet.
|