| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| |
| | |
Fixup futimens issues.
|
| | |
| |
| |
| |
| |
| | |
Always free the scopes returned by dwarf_getscopes () when done.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We try to handle (in-place) stripping of ar archives, but since elf_clone
doesn't really support cloning ar members and we don't handle reducing
the size of the members, moving the offsets of other members. This causes
crashes or writing garbage. Better to just admit that for now we don't
support stripping archives. Call error when we see an ELF_K_AR file.
https://bugzilla.redhat.com/show_bug.cgi?id=766156
https://lists.fedorahosted.org/pipermail/elfutils-devel/2009-August/000567.html
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| | |
When d_size is zero d_buf might be NULL.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
All library code now builds with this warning and -Werror enabled.
Add exceptions for most of the src tools (ldgeneric, readelf, nm, size,
strip, elflint, findtextrel, elfcmp objdump, ranlib, ar and unstrip).
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
If dwarf_getscopes_die () fails then scopes might not be reset and we
could cause a double free.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds an option --pretty-print to eu-addr2line to show all information
on one line and all inlines on a line of their own. This mimics the same
option from binutils addr2line, but without the short option variant -p.
Since we already use -p to select the process.
Example output:
eu-addr2line --pretty-print -s -i -f -C -p$(pidof firefox) 0x00007f368c6f8915
mozilla::ReentrantMonitor::Wait(unsigned int) at ReentrantMonitor.h:92
(inlined by) mozilla::ReentrantMonitorAutoEnter::Wait(unsigned int) at ReentrantMonitor.h:190
A couple of tests were added to check the output matches that of
binutils addr2line.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
Makes the -C, --demangle option visible and implements it (ignoring the
demangle style argument). Adds a new test with sample output.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| | |
Adds test cases with sample output.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
We would sometimes interpret input addresses as decimal or octal.
That could be confusing and isn't what binutils addr2line does.
Be consistent and always treat input addresses as hex.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
This makes it clear that -j, --section=NAME is about how input is treated,
not how the output is formatted.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There were various places where a bogus/unexpected input file would cause
eu-strip to crash. Also on an unexpected error eu-strip would leak the temp
debug file it was writing.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c34
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 <[email protected]>
|
| | |
| |
| |
| |
| |
| | |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c31
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
On 32bit using int might overflow.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c31
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| | |
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 <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
futimes is not standard function, and it's not available in uClibc.
Use futimens which is POSIX.
Suggested-by: Mike Frysinger <[email protected]>
Signed-off-by: Max Filippov <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
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 <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 <[email protected]>
Signed-off-by: Max Filippov <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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 <[email protected]>
|
| | |
| |
| |
| |
| |
| | |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c29
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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 <[email protected]>
|
| | |
| |
| |
| |
| |
| | |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c29
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
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 <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- 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 <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c17
Reported-by: Alexander Cherepanov <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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 <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810
Reported-by: Alexander Cherepanov <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Also add section index number in error message.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810
Reported-by: Alexander Cherepanov <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| | |
Add a testcase to show eu-nm now handles archives with 64-bit symbol table.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Otherwise we will keep looping on that same invalid entry.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810
Reported-by: Alexander Cherepanov <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810
Reported-by: Alexander Cherepanov <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
https://bugzilla.redhat.com/show_bug.cgi?id=1170810
Reported-by: Alexander Cherepanov <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| |\| |
|
| | |
| |
| |
| |
| |
| | |
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 <[email protected]>
|
| | |
| |
| |
| |
| |
| | |
Don't just crash using the NULL result in print_decoded_line_section.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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 <[email protected]>
|
| | |
| |
| |
| |
| |
| | |
Just report invalid data and continue.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| | |
Signed-off-by: Mark Wielaard <[email protected]>
|