| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
This matches gnu nm.
llvm-svn: 241488
|
|
|
|
| |
llvm-svn: 241484
|
|
|
|
|
|
| |
Printing the symbol size matches the behavior or both gnu nm and freebsd nm.
llvm-svn: 241480
|
|
|
|
|
|
|
| |
It can fail trying to get the section on ELF and COFF. This makes sure the
error is handled.
llvm-svn: 241366
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: 240784
|
|
|
|
| |
llvm-svn: 240783
|
|
|
|
|
|
| |
And with those, simplify getSymbolNMTypeChar.
llvm-svn: 240780
|
|
|
|
|
|
|
| |
This allows user code to say Sym.getSize() instead of having to manually fetch
the object.
llvm-svn: 240708
|
|
|
|
|
|
| |
This matches gnu nm and has the advantage that there is a upper case N.
llvm-svn: 240655
|
|
|
|
| |
llvm-svn: 240645
|
|
|
|
|
|
|
|
| |
* Have it return a iterator_range.
* Remove the global function.
* Rename to getDynamicSymbolIterators.
llvm-svn: 240644
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 238703
|
|
|
|
|
|
|
| |
It is explicitly documented to have no effect on object formats where symbols
don't have sizes.
llvm-svn: 238019
|
|
|
|
|
|
|
|
|
|
|
|
| |
The loop and error handling in checkMachOAndArchFlags didn't make sense
to me (a loop that only ever executes once? An error path that uses the
element the loop stopped at (which must always be a buffer overrun if
I'm reading that right?)... I'm confused) but I've made a guess at what
was intended.
Based on a patch by Richard Thomson to simplify boolean expressions.
llvm-svn: 233025
|
|
|
|
|
|
|
|
|
|
|
| |
utils/sort_includes.py.
I clearly haven't done this in a while, so more changed than usual. This
even uncovered a missing include from the InstrProf library that I've
added. No functionality changed here, just mechanical cleanup of the
include order.
llvm-svn: 225974
|
|
|
|
|
|
| |
This is the same return type of Archive::create.
llvm-svn: 223827
|
|
|
|
|
|
|
| |
Do a better job classifying symbols. This increases the consistency
between the COFF handling code and the ELF side of things.
llvm-svn: 220952
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This format is simply a regular object file with the bitcode stored in a
section named ".llvmbc", plus any number of other (non-allocated) sections.
One immediate use case for this is to accommodate compilation processes
which expect the object file to contain metadata in non-allocated sections,
such as the ".go_export" section used by some Go compilers [1], although I
imagine that in the future we could consider compiling parts of the module
(such as large non-inlinable functions) directly into the object file to
improve LTO efficiency.
[1] http://golang.org/doc/install/gccgo#Imports
Differential Revision: http://reviews.llvm.org/D4371
llvm-svn: 218078
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for reading the "bigobj" variant of COFF produced by
cl's /bigobj and mingw's -mbig-obj.
The most significant difference that bigobj brings is more than 2**16
sections to COFF.
bigobj brings a few interesting differences with it:
- It doesn't have a Characteristics field in the file header.
- It doesn't have a SizeOfOptionalHeader field in the file header (it's
only used in executable files).
- Auxiliary symbol records have the same width as a symbol table entry.
Since symbol table entries are bigger, so are auxiliary symbol
records.
Write support will come soon.
Differential Revision: http://reviews.llvm.org/D5259
llvm-svn: 217496
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries
(like Archive) and we had to create dummy buffers just to handle that. It is
also a bad fit for IRObjectFile where the Module wants to own the buffer too.
Keeping this ownership would make supporting IR inside native objects
particularly painful.
This patch focuses in lib/Object. If something elsewhere used to own an Binary,
now it also owns a MemoryBuffer.
This patch introduces a few new types.
* MemoryBufferRef. This is just a pair of StringRefs for the data and name.
This is to MemoryBuffer as StringRef is to std::string.
* OwningBinary. A combination of Binary and a MemoryBuffer. This is needed
for convenience functions that take a filename and return both the
buffer and the Binary using that buffer.
The C api now uses OwningBinary to avoid any change in semantics. I will start
a new thread to see if we want to change it and how.
llvm-svn: 216002
|
|
|
|
| |
llvm-svn: 215218
|
|
|
|
|
|
|
|
|
| |
Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get
a reference to it.
Thanks to David Blaikie for the suggestion.
llvm-svn: 214516
|
|
|
|
|
|
| |
This opens the way for a few std::uinque_ptr cleanups.
llvm-svn: 214439
|
|
|
|
| |
llvm-svn: 214377
|
|
|
|
|
|
| |
to just print the symbol name. So it matches darwin’s nm(1) -u option.
llvm-svn: 214143
|
|
|
|
|
|
|
|
| |
The -print-file-name option in llvm-nm is to precede each symbol
with the object file it came from. While code for the parsing of this
option and its aliases existed there was no code to implement it.
llvm-svn: 213906
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
them explicit in the type system.
createBinary documented that it destroyed the parameter in error cases,
though by observation it does not. By passing the unique_ptr by value
rather than lvalue reference, callers are now explicit about passing
ownership and the function implements the documented contract. Remove
the explicit documentation, since now the behavior cannot be anything
other than what was documented, so it's redundant.
Also drops a unique_ptr::release in llvm-nm that was always run on a
null unique_ptr anyway.
llvm-svn: 213557
|
|
|
|
|
|
| |
No functional change.
llvm-svn: 213330
|
|
|
|
| |
llvm-svn: 213327
|
|
|
|
|
|
|
|
|
| |
symbol in hex.
(generally use for debugging the tools). This is same functionality as darwin’s
nm(1) "-x" flag.
llvm-svn: 213176
|
|
|
|
| |
llvm-svn: 212920
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the specified section. This is same functionality as darwin’s nm(1) "-s" flag.
There is one FIXME in the code and I’m all ears to anyone that can help me
with that. This option takes exactly two strings and should be allowed
anywhere on the command line. Such that "llvm-nm -s __TEXT __text foo.o"
would work. But that does not as the CommandLine Library does not have a
way to make this work as far as I can tell. For now the "-s __TEXT __text"
has to be last on the command line.
llvm-svn: 212842
|
|
|
|
|
|
|
|
|
|
| |
This will allow the "-s" flag to implemented in the future as it
is in darwin’s nm(1) to list symbols only in the specified section.
Given a LGTM by Shankar Easwaran who originally implemented
the support for lvm-nm’s -print-armap and archive map symbols.
llvm-svn: 212576
|
|
|
|
| |
llvm-svn: 212405
|
|
|
|
|
|
|
|
| |
symbol’s name. On darwin the -j flag is used (often in combinations
with other flags) to produce a complete list of symbol names which
than can then be reorder and used with ld(1)’s -order_file.
llvm-svn: 212294
|
|
|
|
| |
llvm-svn: 212283
|
|
|
|
|
|
| |
This also enables it in llvm-nm so that it can be tested.
llvm-svn: 212282
|
|
|
|
|
|
| |
as darwin’s nm(1) uses -U for this functionality.
llvm-svn: 212280
|
|
|
|
|
|
| |
which exists in other Unix nm(1)’s.
llvm-svn: 212235
|
|
|
|
| |
llvm-svn: 212143
|
|
|
|
|
|
|
|
| |
universal file. This also includes support for -arch all, selecting the host
architecture by default from a universal file and checking if -arch is used
with a standard Mach-O it matches that architecture.
llvm-svn: 212054
|
|
|
|
|
|
|
|
| |
This makes the buffer ownership on error conditions very natural. The buffer
is only moved out of the argument if an object is constructed that now
owns the buffer.
llvm-svn: 211546
|
|
|
|
|
|
|
|
|
|
| |
This allows us to just use a std::unique_ptr to store the pointer to the buffer.
The flip side is that they have to support releasing the buffer back to the
caller.
Overall this looks like a more efficient and less brittle api.
llvm-svn: 211542
|
|
|
|
|
|
|
| |
It used to be inconvenient to mix ErrorOr and UniquePtr, but with c++11
they work OK together.
llvm-svn: 211532
|
|
|
|
|
|
|
|
|
| |
to match llvm-size and other UNIX systems for their nm(1).
Tweak test cases that used llvm-nm with standard input to add a "-" to
indicate that and add a test case to check the default of a.out for llvm-nm.
llvm-svn: 211529
|
|
|
|
|
|
|
|
| |
the tool is given multiple files. Also fix the same issue with Mach-O
universal files. And fix the newline spacing to separate the output
in these cases.
llvm-svn: 211405
|
|
|
|
|
|
| |
which is what the darwin tools use for the Mach-O format output.
llvm-svn: 211326
|
|
|
|
|
|
|
|
| |
‘b’ for
data and bss symbols instead of the generic ’s’ for a symbol in a section.
llvm-svn: 211321
|