| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 241042
|
|
|
|
| |
llvm-svn: 241040
|
|
|
|
| |
llvm-svn: 241039
|
|
|
|
| |
llvm-svn: 241021
|
|
|
|
|
|
| |
I doesn't depend on the object anymore.
llvm-svn: 240996
|
|
|
|
|
|
|
|
|
|
| |
This moves the error checking for string tables to getStringTable which returns
an ErrorOr<StringRef>.
This improves error checking, makes it uniform across all string tables and
makes it possible to check them once instead of once per name.
llvm-svn: 240950
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was a fairly broken concept for an ELF only class.
An ELF file can have two symbol tables, but they have exactly the same
format. There is no concept of a dynamic or a static symbol. Storing this
on the iterator also makes us do more work per symbol than necessary. To fetch
a name we would:
* Find if we had a static or a dynamic symbol.
* Look at the corresponding symbol table and find the string table section.
* Look at the string table section to fetch its contents.
* Compute the name as a substring of the string table.
All but the last step can be done per symbol table instead of per symbol. This
is a step in that direction.
llvm-svn: 240939
|
|
|
|
| |
llvm-svn: 240785
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This allows user code to say Sym.getSize() instead of having to manually fetch
the object.
llvm-svn: 240708
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This reverts commit r240364 (git c49542e5bb186). The issue r240364 was
trying to fix was fixed independently in r240362.
llvm-svn: 240448
|
|
|
|
|
|
| |
Should fix the arm bots.
llvm-svn: 240439
|
|
|
|
|
|
|
|
|
|
|
| |
Only common symbol on MachO and COFF have a size.
For COFF we already had a custom format.
For MachO, there is no native objdump and we were printing it as ELF. Now
we only print the sizes for symbols that actually have them.
llvm-svn: 240422
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
That way llvm-objdump can rely on it without adding an extra dependency
on CodeGen.
This change duplicates the FaultKind enum and the code that serializes
it to a string. I could not figure out a way to get around this without
adding a new dependency to Object
Reviewers: rafael, ab
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10619
llvm-svn: 240364
|
|
|
|
| |
llvm-svn: 240362
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The parser is exercised by llvm-objdump using -print-fault-maps. As is
probably obvious, the code itself was "heavily inspired" by
http://reviews.llvm.org/D10434.
Reviewers: reames, atrick, JosephTremoulet
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10491
llvm-svn: 240304
|
|
|
|
| |
llvm-svn: 240112
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
setting instprinter appropriately.
llvm-svn: 239265
|
|
|
|
|
|
|
|
| |
* If the input file is missing;
* If the type of input object file can't be recognized;
* If the object file can't be parsed correctly.
llvm-svn: 239065
|
|
|
|
|
|
|
| |
We already handled a section with no symbols, extend that to also handle a
section with symbols that don't include the section start.
llvm-svn: 239039
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ELF spec is very clear:
-----------------------------------------------------------------------------
If the value is non-zero, it represents a string table index that gives the
symbol name. Otherwise, the symbol table entry has no name.
--------------------------------------------------------------------------
In particular, a st_name of 0 most certainly doesn't mean that the symbol has
the same name as the section.
llvm-svn: 238899
|
|
|
|
| |
llvm-svn: 238898
|
|
|
|
| |
llvm-svn: 238703
|
|
|
|
| |
llvm-svn: 238700
|
|
|
|
| |
llvm-svn: 238557
|
|
|
|
|
|
| |
at a time which is the semantic unit for Hexagon. Fixing tests to use the new format. Disabling tests in the direct object emission path for a followup patch.
llvm-svn: 238556
|
|
|
|
| |
llvm-svn: 238552
|
|
|
|
| |
llvm-svn: 238494
|
|
|
|
|
|
|
|
| |
triple.
Differential Revision: http://reviews.llvm.org/D8427
llvm-svn: 238457
|
|
|
|
|
|
| |
directly to stream.
llvm-svn: 238453
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D9416
Reviewed by: rafael
llvm-svn: 236279
|
|
|
|
|
|
|
|
|
|
| |
-non-verbose
option to print the archive headers using raw numeric values. Also add the -archive-member-offsets
for use with these to also trigger printing of the offset of the archive member from the start
of the archive.
llvm-svn: 236252
|
|
|
|
|
|
|
|
|
|
| |
This will enable us to create a PDBContext so as to expose some
amount of debug info functionality through a common interace.
Differential Revision: http://reviews.llvm.org/D9205
Reviewed by: Alexey Samsonov
llvm-svn: 235612
|
|
|
|
|
|
|
|
| |
Mach-O files
with the -section option as objc_protocol_t structs.
llvm-svn: 235141
|
|
|
|
| |
llvm-svn: 235130
|
|
|
|
|
|
| |
with the existing -objc-meta-data and -macho options for Mach-O files.
llvm-svn: 235119
|
|
|
|
|
|
|
| |
incorrectly because it came from an expression using S.getAddress() which always
returns a 64-bit value.
llvm-svn: 234251
|
|
|
|
|
|
| |
with the existing -objc-meta-data and -macho options for Mach-O files.
llvm-svn: 234185
|
|
|
|
| |
llvm-svn: 233856
|