Age | Commit message (Collapse) | Author | Files | Lines |
|
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
|
|
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
|
|
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
|
|
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
|
|
Differential Revision: http://reviews.llvm.org/D9416
Reviewed by: rafael
llvm-svn: 236279
|
|
print the Objective-C runtime meta data for Mach-O files.
There are three types of Objective-C runtime meta data, Objc2 64-bit,
Objc2 32-bit and Objc1 32-bit. This prints the first of these types. The
changes to print the others will follow next.
llvm-svn: 233840
|
|
an MCInstPrinter. Update all callers and use where we wanted a Triple
previously.
llvm-svn: 233648
|
|
per-function subtarget.
Currently, code-gen passes the default or generic subtarget to the constructors
of MCInstPrinter subclasses (see LLVMTargetMachine::addPassesToEmitFile), which
enables some targets (AArch64, ARM, and X86) to change their instprinter's
behavior based on the subtarget feature bits. Since the backend can now use
different subtargets for each function, instprinter has to be changed to use the
per-function subtarget rather than the default subtarget.
This patch takes the first step towards enabling instprinter to change its
behavior based on the per-function subtarget. It adds a bit "PassSubtarget" to
AsmWriter which tells table-gen to pass a reference to MCSubtargetInfo to the
various print methods table-gen auto-generates.
I will follow up with changes to instprinters of AArch64, ARM, and X86.
llvm-svn: 233411
|
|
StringRef. Removing reinterpret_casts.
llvm-svn: 232659
|
|
llvm-svn: 232654
|
|
to print the Mach-O dynamic shared libraries used by a linked image or the
library id of a shared library.
llvm-svn: 232406
|
|
Mach-O info plist section as strings.
llvm-svn: 231974
|
|
segname,sectname to specify a Mach-O section to print. The printing is based on
the section type or section attributes.
The printing of the module initialization and termination section types is printed
with this change. Printing of other section types will be added next.
llvm-svn: 227649
|
|
Mach-O AArch64 linker optimization hints for ADRP code optimization.
llvm-svn: 227246
|
|
objdump.
llvm-svn: 226932
|
|
Mach-O data in code table.
llvm-svn: 226921
|
|
indirect symbol table to llvm-objdump.
llvm-svn: 226848
|
|
Mach-O parser).
llvm-svn: 226612
|
|
archive headers to llvm-objdump.
llvm-svn: 226228
|
|
universal headers to llvm-objdump.
llvm-svn: 225537
|
|
used with
options other than just -disassemble so that universal files can be used with other
options combined with -arch options.
No functional change to existing options and use. One test case added for the
additional functionality with a universal file an a -arch option.
llvm-svn: 225383
|
|
llvm-svn: 224413
|
|
-macho
with fixes. Includes the move of tests for llvm-objdump for universal files to an X86
directory. And the fix where it was failing on linux Rafael tracked down with asan.
I had both Jim Grosbach and Adam Hemet look over the second fix since I could not
set up asan to reproduce with the old version but not with the fix.
llvm-svn: 223416
|
|
The code is using uninitialized memory and failing on linux.
llvm-svn: 223315
|
|
llvm-svn: 223277
|
|
llvm-objdump printed out an error message for this off-by-one error,
but because it always exits with 0 whether or not it found an error,
the test (llvm-objdump/coff-many-relocs.test) succeeded.
I made llvm-objdump exit with EXIT_FAILURE when an error is found.
llvm-svn: 222852
|
|
We were a little lax in a few areas:
- We pretended that import libraries were like any old COFF file, they
are not. In fact, they aren't really COFF files at all, we should
probably grow some specialized functionality to handle them smarter.
- Our symbol iterators were more than happy to attempt to go past the
end of the symbol table if you had a symbol with a bad list of
auxiliary symbols.
llvm-svn: 222124
|
|
llvm-svn: 221782
|
|
With this patch MCDisassembler::getInstruction takes an ArrayRef<uint8_t>
instead of a MemoryObject.
Even on X86 there is a maximum size an instruction can have. Given
that, it seems way simpler and more efficient to just pass an ArrayRef
to the disassembler instead of a MemoryObject and have it do a virtual
call every time it wants some extra bytes.
llvm-svn: 221751
|
|
Empty sections are just noise when using objdump.
This is similar to what binutils does.
llvm-svn: 221680
|