| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
make_error_code(object_error) is slow because object::object_category()
uses a ManagedStatic variable. But the real problem is that the function is
called too frequently. This patch uses std::error_code() instead of
object_error::success. In most cases, we return "success", so this patch
reduces number of function calls to that function.
http://reviews.llvm.org/D10333
llvm-svn: 239409
|
|
|
|
|
|
| |
mach_header_64.
llvm-svn: 239110
|
|
|
|
|
|
|
|
| |
Report proper error code from MachOObjectFile constructor if we
can't parse another segment load command (we already return a proper
error if segment load command contents is suspicious).
llvm-svn: 239109
|
|
|
|
| |
llvm-svn: 239106
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Properly report the error in segment load commands from MachOObjectFile
constructor instead of crashing the program.
Adjust the test case accordingly.
Test Plan: regression test suite
Reviewers: rafael, filcab
Subscribers: llvm-commits
llvm-svn: 239081
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Currently all load commands are parsed in MachOObjectFile constructor.
If the next load command cannot be parsed, or if command size is too
small, properly report it through the error code and fail to construct
the object, instead of crashing the program.
Test Plan: regression test suite
Reviewers: rafael, filcab
Subscribers: llvm-commits
llvm-svn: 239080
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Instead, properly report this error from MachOObjectFile constructor.
Test Plan: regression test suite
Reviewers: rafael
Subscribers: llvm-commits
llvm-svn: 239078
|
|
|
|
| |
llvm-svn: 239077
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Avoid parsing object file each time MachOObjectFile::getHeader() is
called. Instead, cache the header in MachOObjectFile constructor, where
it's parsed anyway. In future, we must avoid constructing the object
at all if the header can't be parsed.
Test Plan: regression test suite.
Reviewers: rafael
Subscribers: llvm-commits
llvm-svn: 239075
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Now users don't have to manually deal with getFirstLoadCommandInfo() /
getNextLoadCommandInfo(), calculate the number of load segments, etc.
No functionality change.
Test Plan: regression test suite
Reviewers: rafael, lhames, loladiro
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10144
llvm-svn: 238983
|
|
|
|
| |
llvm-svn: 238898
|
|
|
|
| |
llvm-svn: 238703
|
|
|
|
| |
llvm-svn: 238700
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds partial support for MachO relocations to RelocVisitor.
A simple test case is added to show that relocations are indeed being
applied and that using llvm-dwarfdump on MachO files no longer errors.
Correctness is not yet tested, due to an unrelated bug in DebugInfo,
which will be fixed with appropriate testcase in a followup commit.
Differential Revision: http://reviews.llvm.org/D8148
llvm-svn: 238663
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MachO and COFF quite reasonably only define the size for common symbols.
We used to try to figure out the "size" by computing the gap from one symbol to
the next.
This would not be correct in general, since a part of a section can belong to no
visible symbol (padding, private globals).
It was also really expensive, since we would walk every symbol to find the size
of one.
If a caller really wants this, it can sort all the symbols once and get all the
gaps ("size") in O(n log n) instead of O(n^2).
On MachO this also has the advantage of centralizing all the checks for an
invalid n_sect.
llvm-svn: 238028
|
|
|
|
|
|
| |
We still detect the same errors, but now we do it earlier.
llvm-svn: 238024
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This supersedes http://reviews.llvm.org/D4010, hopefully properly
dealing with the JIT case and also adds an actual test case.
DwarfContext was basically already usable for the JIT (and back when
we were overwriting ELF files it actually worked out of the box by
accident), but in order to resolve relocations correctly it needs
to know the load address of the section.
Rather than trying to get this out of the ObjectFile or requiring
the user to create a new ObjectFile just to get some debug info,
this adds the capability to pass in that info directly.
As part of this I separated out part of the LoadedObjectInfo struct
from RuntimeDyld, since it is now required at a higher layer.
Reviewers: lhames, echristo
Reviewed By: echristo
Subscribers: vtjnash, friss, rafael, llvm-commits
Differential Revision: http://reviews.llvm.org/D6961
llvm-svn: 237961
|
|
|
|
|
|
| |
Following r233392, http://llvm.org/viewvc/llvm-project?rev=233392&view=rev.
llvm-svn: 233555
|
|
|
|
|
|
| |
Mach-O AArch64 linker optimization hints for ADRP code optimization.
llvm-svn: 227246
|
|
|
|
| |
llvm-svn: 226229
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
accesses while reading MachO files.
Summary:
Shift an older “invalid file” test to get a consistent naming for these tests.
Bugs found by afl-fuzz
Reviewers: rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6945
llvm-svn: 226219
|
|
|
|
|
|
|
|
|
| |
be exported from a dylib if their containing object file were linked into one.
No test case: No command line tools query this flag, and there are no Object
unit tests.
llvm-svn: 226217
|
|
|
|
| |
llvm-svn: 225271
|
|
|
|
| |
llvm-svn: 224792
|
|
|
|
|
|
| |
-private-headers.
llvm-svn: 224627
|
|
|
|
|
|
| |
-private-headers.
llvm-svn: 224616
|
|
|
|
|
|
| |
-private-headers.
llvm-svn: 224607
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This fixes the exports iterator if the export list is empty.
Reviewers: Bigcheese, kledzik
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6732
llvm-svn: 224563
|
|
|
|
|
|
| |
-private-headers.
llvm-svn: 224548
|
|
|
|
|
|
| |
-private-headers.
llvm-svn: 224534
|
|
|
|
|
|
|
|
|
|
| |
-private-headers.
Also corrected the name of the load command to not end in an ’S’ as well as corrected
the name of the MachO::linker_option_command struct and other places that had the
word option as plural which did not match the Mac OS X headers.
llvm-svn: 224485
|
|
|
|
|
|
|
|
| |
-private-headers
and add tests for the two AArch64 binaries.
llvm-svn: 224400
|
|
|
|
|
|
| |
-private-headers.
llvm-svn: 224390
|
|
|
|
|
|
|
|
| |
These methods are only used by MCJIT and are very specific to it. In fact, they
are also fairly specific to the fact that we have a dynamic linker of
relocatable objects.
llvm-svn: 223964
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add rpath load command support in Mach-O object and update llvm-objdump to use it.
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6512
llvm-svn: 223343
|
|
|
|
|
|
|
| |
Don't assert if we can return an error code, reuse existing
functionality like is64Bit().
llvm-svn: 221915
|
|
|
|
|
|
|
|
| |
a public version MachOObjectFile::getScatteredRelocationType().
This should fix the build bot for the unused function error.
llvm-svn: 221216
|
|
|
|
|
|
| |
symbolizer.
llvm-svn: 221211
|
|
|
|
| |
llvm-svn: 220668
|
|
|
|
|
|
|
|
|
| |
a dangling ArrayRef.
This works because uuid's are always little endian so it's not swapped.
Fixes use-after-return reported by asan.
llvm-svn: 220567
|
|
|
|
|
|
|
| |
This prints disassembly comments for Objective-C references to CFStrings,
Selectors, Classes and method calls.
llvm-svn: 220500
|
|
|
|
|
|
| |
(See e.g. http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/17653)
llvm-svn: 220249
|
|
|
|
|
|
|
|
| |
symbol table.
Patch by Anthony Pesch. Thanks Anthony!
llvm-svn: 220245
|
|
|
|
| |
llvm-svn: 220119
|
|
|
|
|
|
|
| |
This CL introduces MachOObjectFile::getUuid(). This function returns an ArrayRef to the object file's UUID, or an empty ArrayRef if the object file doesn't contain an LC_UUID load command.
The new function is gonna be used by llvm-symbolizer.
llvm-svn: 219866
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are two methods in SectionRef that can fail:
* getName: The index into the string table can be invalid.
* getContents: The section might point to invalid contents.
Every other method will always succeed and returning and std::error_code just
complicates the code. For example, a section can have an invalid alignment,
but if we are able to get to the section structure at all and create a
SectionRef, we will always be able to read that invalid alignment.
llvm-svn: 219314
|
|
|
|
| |
llvm-svn: 217935
|
|
|
|
|
|
| |
getLibraryShortNameByIndex() error handling.
llvm-svn: 217930
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This finishes the ability of llvm-objdump to print out all information from
the LC_DYLD_INFO load command.
The -bind option prints out symbolic references that dyld must resolve
immediately.
The -lazy-bind option prints out symbolc reference that are lazily resolved on
first use.
The -weak-bind option prints out information about symbols which dyld must
try to coalesce across images.
llvm-svn: 217853
|
|
|
|
|
|
|
|
|
|
| |
Similar to my previous -exports-trie option, the -rebase option dumps info from
the LC_DYLD_INFO load command. The rebasing info is a list of the the locations
that dyld needs to adjust if a mach-o image is not loaded at its preferred
address. Since ASLR is now the default, images almost never load at their
preferred address, and thus need to be rebased by dyld.
llvm-svn: 217709
|