| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D14109
llvm-svn: 252043
|
|
|
|
| |
llvm-svn: 251834
|
|
|
|
| |
llvm-svn: 251753
|
|
|
|
|
|
| |
We only need to store a StringRef.
llvm-svn: 251748
|
|
|
|
|
|
| |
Patch by Richard.
llvm-svn: 251215
|
|
|
|
| |
llvm-svn: 250908
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
characters
in the size field in the archive header for the member is not a number. To do this we
have all of the needed methods return ErrorOr to push them up until we get out of lib.
Then the tools and can handle the error in whatever way is appropriate for that tool.
So the solution is to plumb all the ErrorOr stuff through everything that touches archives.
This include its iterators as one can create an Archive object but the first or any other
Child object may fail to be created due to a bad size field in its header.
Thanks to Lang Hames on the changes making child_iterator contain an
ErrorOr<Child> instead of a Child and the needed changes to ErrorOr.h to add
operator overloading for * and -> .
We don’t want to use llvm_unreachable() as it calls abort() and is produces a “crash”
and using report_fatal_error() to move the error checking will cause the program to
stop, neither of which are really correct in library code. There are still some uses of
these that should be cleaned up in this library code for other than the size field.
Also corrected the code where the size gets us to the “at the end of the archive”
which is OK but past the end of the archive will return object_error::parse_failed now.
The test cases use archives with text files so one can see the non-digit character,
in this case a ‘%’, in the size field.
llvm-svn: 250906
|
|
|
|
|
|
|
|
|
|
| |
malformed Mach-O file that caused a crash. This was because of an
assert where the code was incorrectly attempting to parse relocation
entries off of the sections and the filetype was not an MH_OBJECT.
rdar://22983603
llvm-svn: 249921
|
|
|
|
|
|
| |
test/tools/llvm-objdump/malformed-machos.test added in r249845.
llvm-svn: 249909
|
|
|
|
|
|
|
|
|
|
|
| |
from malformed Mach-O files that caused crashes. The first because the
offset in a dyld bind table entry was out of range. The second because their
was no image info section and the routine printing it did not have the
need check to see the section did not exist.
rdar://22983603
llvm-svn: 249845
|
|
|
|
|
|
|
|
|
| |
from malformed Mach-O files that caused a crash because of a
section header had a size that extended past the end of the file.
rdar://22983603
llvm-svn: 249768
|
|
|
|
|
|
|
| |
from malformed Mach-O files that caused a crash because of loops
in the class meta data.
llvm-svn: 249700
|
|
|
|
|
|
|
|
|
|
| |
llvm-nm only needs the target to parse module level assembly in bitcode. It doesn't need a disassembler or codegen.
llvm-objdump needs to be able to disassemble a file, but doesn't need asm parsers or codegen.
This reduces the sizes of these tools by a few MB each, depending on how many backends are linked in.
llvm-svn: 249632
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
from malformed Mach-O files that caused crashes.
We recently got about 700 malformed Mach-O files which we have
been using the improve the robustness of tools that deal with reading
data from object files. These resulted in about 20 small bug fixes to
the darwin based tools.
The goal here is to also improve the robustness of llvm-objdump and
this is the first two fixes. In talking with Tim Northover the approach
we thought might be best is to:
1) Only include tests for the malformed Mach-O files that cause crashes
(not all 700+ tests).
2) The test should only contain the command line option that caused the
crash and not all the others that don’t matter.
3) There should be only one line for the FileCheck that is past the point
of the crash if possible and if possible indicates the malformation.
Again the goal is to fix crashes and not so much care about how the
printing of malformed data comes out.
Tim also suggested if we really wanted to add test cases for all 700+
malformed Mach-O files putting them in the regression tests might be
an option. But many of these do not cause crashes.
llvm-svn: 249479
|
|
|
|
|
|
|
|
|
|
| |
AArch64 uses $d* and $x* to interleave between text and data.
llvm-objdump didn't know about this so it ended up printing garbage.
This patch is a first step towards a solution of the problem.
Differential Revision: http://reviews.llvm.org/D13360
llvm-svn: 249083
|
|
|
|
|
|
|
| |
There's already a test that covers this situation, so we should be
fine.
llvm-svn: 248976
|
|
|
|
|
|
|
|
|
|
| |
directories; other minor cleanups.
Patch by Eugene Zelenko!
Differential Revision: http://reviews.llvm.org/D13172
llvm-svn: 248811
|
|
|
|
|
|
|
| |
This is closer to the expected behavior of an iterator and avoids awkward
warnings from clang's -Wrange-loop-analysis below.
llvm-svn: 248497
|
|
|
|
|
|
| |
extra times. NFC
llvm-svn: 248140
|
|
|
|
|
|
|
|
| |
related. NFC.
Eric has replied and has demanded the patch be reverted.
llvm-svn: 247702
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and related. NFC.
Summary:
This is the first patch in the series to migrate Triple's (which are ambiguous)
to TargetTuple's (which aren't).
For the moment, TargetTuple simply passes all requests to the Triple object it
holds. Once it has replaced Triple, it will start to implement the interface in
a more suitable way.
This change makes some changes to the public C++ API. In particular,
InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer()
now take TargetTuples instead of Triples. The other public C++ API's have
been left as-is for the moment to reduce patch size.
This commit also contains a trivial patch to clang to account for the C++ API
change. Thanks go to Pavel Labath for fixing LLDB for me.
Reviewers: rengolin
Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin
Differential Revision: http://reviews.llvm.org/D10969
llvm-svn: 247692
|
|
|
|
|
|
| |
LLDB needs to be updated in the same commit.
llvm-svn: 247686
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is the first patch in the series to migrate Triple's (which are ambiguous)
to TargetTuple's (which aren't).
For the moment, TargetTuple simply passes all requests to the Triple object it
holds. Once it has replaced Triple, it will start to implement the interface in
a more suitable way.
This change makes some changes to the public C++ API. In particular,
InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer()
now take TargetTuples instead of Triples. The other public C++ API's have
been left as-is for the moment to reduce patch size.
This commit also contains a trivial patch to clang to account for the C++ API
change.
Reviewers: rengolin
Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin
Differential Revision: http://reviews.llvm.org/D10969
llvm-svn: 247683
|
|
|
|
| |
llvm-svn: 246976
|
|
|
|
| |
llvm-svn: 246676
|
|
|
|
| |
llvm-svn: 246031
|
|
|
|
|
|
|
|
|
|
| |
After r244870 flush() will only compare two null pointers and return,
doing nothing but wasting run time. The call is not required any more
as the stream and its SmallString are always in sync.
Thanks to David Blaikie for reviewing.
llvm-svn: 244928
|
|
|
|
| |
llvm-svn: 244888
|
|
|
|
|
|
|
| |
This matches the rest of llvm-objdump better and isolates it from upcoming
changes to ELFFile.
llvm-svn: 244500
|
|
|
|
|
|
|
| |
This function can actually fail since the symbol contains an index to the
section and that can be invalid.
llvm-svn: 244375
|
|
|
|
|
|
| |
Reported by: Rafael Espindola.
llvm-svn: 244184
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we kept going on partly corrupted input, which might result
in garbage being printed, or even worse, random crashes.
Rafael mentioned that this is the GNU behavior as well, but after some
discussion we both agreed it's probably better to emit a reasonable
error message and exit. As a side-effect of this commit, now we don't
rely on global state for error codes anymore. objdump was the last tool
in the toolchain which needed to be converted. Hopefully the old behavior
won't sneak into the tree again.
llvm-svn: 244019
|
|
|
|
| |
llvm-svn: 243905
|
|
|
|
|
|
| |
true when we want it rather than when we want to discard it.
llvm-svn: 243558
|
|
|
|
|
|
| |
some predicate logic.
llvm-svn: 243556
|
|
|
|
| |
llvm-svn: 243526
|
|
|
|
|
|
| |
on all sections instead of just text sections.
llvm-svn: 243041
|
|
|
|
|
|
| |
We now use a simple pointer and have range loops.
llvm-svn: 242669
|
|
|
|
|
|
|
| |
compiler configuration is giving me an error and it seems to be
recommended anyway.
llvm-svn: 241892
|
|
|
|
|
|
|
| |
Don't let the disassembler pick call <.text> if a function happens to
live at the start of the section by only using function symbols.
llvm-svn: 241830
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
option that works with all object container formats.
Now that clang modules/PCH are object containers this option is useful to
to construct pipes like
llvm-objdump -raw-clang-ast foo.pcm | llvm-bcanalyzer -
to inspect the AST contents in a PCH container.
Will be tested via clang.
Belatedly addresses review feedback for r233390.
llvm-svn: 241659
|
|
|
|
|
|
|
| |
GNU binutils provides this behavior. objdump -r doesn't really help
when you aren't dealing with relocation object files.
llvm-svn: 241631
|
|
|
|
|
|
|
|
|
|
|
| |
getSymbolValue now returns a value that in convenient for most callers:
* 0 for undefined
* symbol size for common symbols
* offset/address for symbols the rest
Code that needs something more specific can check getSymbolFlags.
llvm-svn: 241605
|
|
|
|
| |
llvm-svn: 241456
|
|
|
|
|
|
|
| |
It can fail trying to get the section on ELF and COFF. This makes sure the
error is handled.
llvm-svn: 241366
|
|
|
|
|
|
|
| |
In MachO the value of the symbol is always the address, so we can use the
simpler function.
llvm-svn: 241364
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function can really fail since the string table offset can be out of
bounds.
Using ErrorOr makes sure the error is checked.
Hopefully a lot of the boilerplate code in tools/* can go away once we have
a diagnostic manager in Object.
llvm-svn: 241297
|
|
|
|
| |
llvm-svn: 241266
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This also improves the logic of what is an error:
* getSection(uint_32): only return an error if the index is out of bounds. The
index 0 corresponds to a perfectly valid entry.
* getSection(Elf_Sym): Returns null for symbols that normally don't have
sections and error for out of bound indexes.
In many places this just moves the report_fatal_error up the stack, but those
can then be fixed in smaller patches.
llvm-svn: 241156
|
|
|
|
| |
llvm-svn: 241074
|