| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
Don't trust the elf version given by the file. It could be completely
bogus. In which case gelf_fsize just returns zero. Which could cause
divide by zero errors.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c34
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c31
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
This is similar to commit 9644aa for readelf print_attributes.
Bail out when the vendor name isn't terminated and add overflow check
for subsection_len.
Note that readelf does handle non-gnu attributes, while elflint doesn't.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
On 32bit using int might overflow.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c31
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
Nothing good comes from trying to continue with a bogus hash function.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c31
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#32
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
| |
futimes is not standard function, and it's not available in uClibc.
Use futimens which is POSIX.
Suggested-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
|
|
|
|
|
|
| |
mtrace is a GNU extension not supported by uClibc and it's believed to
not be really used. Drop mtrace() calls and #include <mcheck.h>.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
argp is not part of POSIX standards and not provided by uClibc or
some other standard C libraries. However, it is possible to link
against a breakout argp library. One is provided at
http://www.lysator.liu.se/~nisse/misc/
This patch tests if libc provides argp otherwise it adds the linker
flag -largp where needed in the build system.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
|
|
|
|
|
|
|
|
| |
gcc -fsanitize=undefined pointed out that on 32bit systems the calculation
to match the cie_offset to the cie_id could be undefined because a cie_id
could be an unsigned 64bit value while ptrdiff_t is only 32bits. Correct
the calculation to use 64bit values.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c29
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
| |
Even if we cannot create a proper Dwarf dbg we can still print the
information of various debug sections. All all debug print section
functions already check first they can access the appropriate data.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c29
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
The date didn't really add much information (it is the day on which the
code happened to be compiled) and it prevents creating reproducible builds.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Make the macro names properly scoped (DWARF_ALL_KNOWN_* and
DWARF_ONE_KNOWN_*).
- Simplify the calling convention: don't keep track of the comment
associated with the enumerator, always use the non-_DESC
DWARF_ONE_KNOWN_* callback.
- Install known-dwarf.h alongside libdw.h and others.
Signed-off-by: Petr Machata <pmachata@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
commit 0a545e "elflint: Add various low-level checks." introduced a bug
in the handling of the gnu_symbias. The symbol in the bucket should first
be compared to STN_UNDEF before applying the bias. And the used symbol
index should have the bias added when compared against plain hash symbol.
Found on Debian wheezy with run-elflint-self.sh.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c17
Reported-by: Alexander Cherepanov <cherepan@mccme.ru>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
| |
elflint could crash or hang because it didn't check some low level issues.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810
Reported-by: Alexander Cherepanov <cherepan@mccme.ru>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810
Reported-by: Alexander Cherepanov <cherepan@mccme.ru>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Also add section index number in error message.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810
Reported-by: Alexander Cherepanov <cherepan@mccme.ru>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
Add a testcase to show eu-nm now handles archives with 64-bit symbol table.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Otherwise we will keep looping on that same invalid entry.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810
Reported-by: Alexander Cherepanov <cherepan@mccme.ru>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810
Reported-by: Alexander Cherepanov <cherepan@mccme.ru>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810
Reported-by: Alexander Cherepanov <cherepan@mccme.ru>
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.
|
|
|
|
|
|
|
| |
Some CFA ops don't take any arguments, for those it is valid to be at the
end of the data block.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
Don't just crash using the NULL result in print_decoded_line_section.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
| |
We use a couple of bits to keep track of the addr size, dwarf size and
warning given for a loclist or rangelist offset. Normally offset won't
be that big and will fit in 61-bits easily. But if not, don't assert,
but just warn we don't handle such large offsets.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
Just report invalid data and continue.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Both get_uleb128 and get_sleb128 now take an end pointer to prevent
reading too much data. Adjust all callers to provide the end pointer.
There are still two exceptions. "Raw" dwarf_getabbrevattr and
read_encoded_valued don't have a end pointer associated yet.
They will have to be provided in the future.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
Don't assert.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Josh Stone <jistone@redhat.com>
|
|
|
|
|
|
|
|
| |
The function which contains an inline might not be the immediate next
die scope. For instance, there may be a lexical scope in between.
Instead, iterate the remaining scopes until an appropriate tag is found.
Signed-off-by: Josh Stone <jistone@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
| |
print_cfa_program might call print_ops with zero offset size. We don't
need (and don't know) the DWARF offset size in that case. DW_OP_call_ref
and DW_OP_GNU_implicit_pointer need to know the offset size because they
reference a DIE. But they are invalid when used from CFA.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
| |
Reported-by: Alexander Cherepanov <cherepan@mccme.ru>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
Since all values are 64bit, not 32bit as in other hashes, we need to
explicitly check for overflow.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
We might need the original destshdr for handling other relocations.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
Avoids comparison between signed and unsigned integer expressions warning.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
For DW_LNS_const_add_pc and special opcodes don't accept line_range
being zero.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|