#
f69ac42a |
| 30-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Don't return error_code from a function that doesn't fail.
llvm-svn: 241039
|
#
99c041b7 |
| 30-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Don't return error_code from a function that doesn't fail.
llvm-svn: 241033
|
#
96d071cd |
| 29-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Don't return error_code from function that never fails.
llvm-svn: 241021
|
#
2fa80cc5 |
| 26-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Simplify getSymbolType.
This is still a really odd function. Most calls are in object format specific contexts and should probably be replaced with a more direct query, but at least now this is not
Simplify getSymbolType.
This is still a really odd function. Most calls are in object format specific contexts and should probably be replaced with a more direct query, but at least now this is not too obnoxious to use.
llvm-svn: 240777
show more ...
|
#
6bf32210 |
| 24-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Make computeSymbolSizes never fail.
On ELF that was already the case since getting the size of a symbol never fails.
On MachO and COFF we could fail trying to get the section of a symbol. But we do
Make computeSymbolSizes never fail.
On ELF that was already the case since getting the size of a symbol never fails.
On MachO and COFF we could fail trying to get the section of a symbol. But we don't really need the section, just the section number to know if two symbols are in the same section or not.
llvm-svn: 240580
show more ...
|
Revision tags: llvmorg-3.6.2 |
|
#
991af666 |
| 24-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Add a SymbolRef::getValue.
This returns either the symbol offset or address. Since it is not defined which one, it never has to lookup the section and so never fails.
I will add users in the next c
Add a SymbolRef::getValue.
This returns either the symbol offset or address. Since it is not defined which one, it never has to lookup the section and so never fails.
I will add users in the next commit.
llvm-svn: 240569
show more ...
|
#
59128921 |
| 24-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Refactor duplicated code. NFC.
llvm-svn: 240563
|
#
d7a32ea4 |
| 24-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Change how symbol sizes are handled in lib/Object.
COFF and MachO only define symbol sizes for common symbols. Reflect that in the class hierarchy by having a method for common symbols only in the b
Change how symbol sizes are handled in lib/Object.
COFF and MachO only define symbol sizes for common symbols. Reflect that in the class hierarchy by having a method for common symbols only in the base and a general one in ELF.
This avoids the need of using a magic value for the size, which had a few problems * Most callers didn't check for it. * The ones that did could not tell the magic value from a file actually having that value.
llvm-svn: 240529
show more ...
|
Revision tags: llvmorg-3.6.2-rc1 |
|
#
9ac06a0e |
| 18-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Improve the --expand-relocs handling of MachO.
In a relocation target can take 3 basic forms
* A r_value in scattered relocations. * A symbol in external relocations. * A section is non-external re
Improve the --expand-relocs handling of MachO.
In a relocation target can take 3 basic forms
* A r_value in scattered relocations. * A symbol in external relocations. * A section is non-external relocations.
Have the dump reflect that. With this change we go from
CHECK-NEXT: Extern: 0 CHECK-NEXT: Type: X86_64_RELOC_SUBTRACTOR (5) CHECK-NEXT: Symbol: 0x2 CHECK-NEXT: Scattered: 0
To just
// CHECK-NEXT: Type: X86_64_RELOC_SUBTRACTOR (5) // CHECK-NEXT: Section: __data (2)
Since the relocation is with a section, we print the seciton name and don't need to say that it is not scattered or external.
Someone motivated can add further special cases for things like ARM64_RELOC_ADDEND and ARM_RELOC_PAIR.
llvm-svn: 240073
show more ...
|
#
40baa0aa |
| 16-Jun-2015 |
Frederic Riss <friss@apple.com> |
Have MachOObjectFile::isValidArch() accept armv7
llvm-svn: 239833
|
#
7d099195 |
| 09-Jun-2015 |
Rui Ueyama <ruiu@google.com> |
Remove object_error::success and use std::error_code() instead
make_error_code(object_error) is slow because object::object_category() uses a ManagedStatic variable. But the real problem is that the
Remove object_error::success and use std::error_code() instead
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
show more ...
|
#
fa5edc5a |
| 04-Jun-2015 |
Alexey Samsonov <vonosmas@gmail.com> |
[Object, MachO] Fixup for r239075: use union to store mach_header and mach_header_64.
llvm-svn: 239110
|
#
f8a7bf8c |
| 04-Jun-2015 |
Alexey Samsonov <vonosmas@gmail.com> |
[Object, MachO] Don't crash on incomplete MachO segment load commands.
Report proper error code from MachOObjectFile constructor if we can't parse another segment load command (we already return a p
[Object, MachO] Don't crash on incomplete MachO segment load commands.
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
show more ...
|
#
e1a76ab8 |
| 04-Jun-2015 |
Alexey Samsonov <vonosmas@gmail.com> |
[Object, MachO] Simplify load segment parsing code. NFC.
llvm-svn: 239106
|
#
074da9b5 |
| 04-Jun-2015 |
Alexey Samsonov <vonosmas@gmail.com> |
[Object, MachO] Don't crash on invalid MachO segment load commands.
Summary: Properly report the error in segment load commands from MachOObjectFile constructor instead of crashing the program.
Adj
[Object, MachO] Don't crash on invalid MachO segment load commands.
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
show more ...
|
#
de5a94a6 |
| 04-Jun-2015 |
Alexey Samsonov <vonosmas@gmail.com> |
[Object, MachO] Don't crash on invalid MachO load commands.
Summary: Currently all load commands are parsed in MachOObjectFile constructor. If the next load command cannot be parsed, or if command s
[Object, MachO] Don't crash on invalid MachO load commands.
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
show more ...
|
#
9f336636 |
| 04-Jun-2015 |
Alexey Samsonov <vonosmas@gmail.com> |
[Object, MachO] Don't crash on parsing invalid MachO header.
Summary: Instead, properly report this error from MachOObjectFile constructor.
Test Plan: regression test suite
Reviewers: rafael
Subs
[Object, MachO] Don't crash on parsing invalid MachO header.
Summary: Instead, properly report this error from MachOObjectFile constructor.
Test Plan: regression test suite
Reviewers: rafael
Subscribers: llvm-commits llvm-svn: 239078
show more ...
|
#
4fdbed38 |
| 04-Jun-2015 |
Alexey Samsonov <vonosmas@gmail.com> |
[Object, MachO] Remove some code duplication. NFC.
llvm-svn: 239077
|
#
13415ede |
| 04-Jun-2015 |
Alexey Samsonov <vonosmas@gmail.com> |
[Object, MachO] Cache parsed MachO header in MachOObjectFile. NFC.
Summary: Avoid parsing object file each time MachOObjectFile::getHeader() is called. Instead, cache the header in MachOObjectFile c
[Object, MachO] Cache parsed MachO header in MachOObjectFile. NFC.
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
show more ...
|
#
d319c4fb |
| 03-Jun-2015 |
Alexey Samsonov <vonosmas@gmail.com> |
[Object, MachO] Introduce MachOObjectFile::load_commands() range iterator.
Summary: Now users don't have to manually deal with getFirstLoadCommandInfo() / getNextLoadCommandInfo(), calculate the num
[Object, MachO] Introduce MachOObjectFile::load_commands() range iterator.
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
show more ...
|
#
37070a5a |
| 03-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Move to llvm-objdump a large amount of code to that is only used there.
llvm-svn: 238898
|
#
5eb02e45 |
| 01-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Simplify another function that doesn't fail.
llvm-svn: 238703
|
#
a4d22472 |
| 31-May-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Simplify interface of function that doesn't fail.
llvm-svn: 238700
|
#
281b6941 |
| 30-May-2015 |
Keno Fischer <kfischer@college.harvard.edu> |
Add RelocVisitor support for MachO
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 usin
Add RelocVisitor support for MachO
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
show more ...
|
#
62a07cb5 |
| 22-May-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Stop inventing symbol sizes.
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
Stop inventing symbol sizes.
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
show more ...
|