| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
llvm-svn: 223781
|
|
|
|
|
|
|
|
|
|
|
| |
Instead, walk the obj symbol list in parallel to find the GV. This shouldn't
change anything on ELF where global symbols are not mangled, but it is a step
toward supporting other object formats.
Gold itself is ELF only, but bfd ld supports COFF and the logic in the gold
plugin could be reused on lld.
llvm-svn: 223780
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Tested with check-all with no regressions.
llvm-svn: 223112
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 222735
|
|
|
|
|
|
|
|
|
|
| |
We can now use the ELF relocation .def files to create the mapping
of relocation numbers to names and avoid having to duplicate the
list of relocations.
Patch by Will Newton.
llvm-svn: 222567
|
|
|
|
|
|
|
|
|
|
| |
We can now use the ELF relocation .def files to create the mapping
of relocation numbers to names and avoid having to duplicate the
list of relocations.
Patch by Will Newton.
llvm-svn: 222566
|
|
|
|
|
|
|
|
| |
It printed out base relocation table header as table entry.
This patch also makes llvm-readobj to not skip ABSOLUTE entries
becuase it was confusing.
llvm-svn: 222299
|
|
|
|
| |
llvm-svn: 222289
|
|
|
|
| |
llvm-svn: 222208
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In support of serializing executables, obj2yaml now records the virtual address
and size of sections. It also serializes whatever we strictly need from
the PE header, it expects that it can reconstitute everything else via
inference.
yaml2obj can reconstitute a fully linked executable.
In order to get executables correctly serialized/deserialized, other
bugs were fixed as a circumstance. We now properly respect file and
section alignments. We also avoid writing out string tables unless they
are strictly necessary.
llvm-svn: 221975
|
|
|
|
| |
llvm-svn: 221919
|
|
|
|
|
|
|
| |
Don't assert if we can return an error code, reuse existing
functionality like is64Bit().
llvm-svn: 221915
|
|
|
|
|
|
| |
No functional change intended.
llvm-svn: 221880
|
|
|
|
|
|
|
|
|
|
| |
Split getObject's smarts into checkOffset, use this to replace the
handwritten check in getSectionContents. Similarly, replace checks in
section_rel_begin/section_rel_end with getNumberOfRelocations.
No functionality change intended.
llvm-svn: 221873
|
|
|
|
|
|
|
|
| |
lib/Object is supposed to be robust to malformed object files. Don't
assert if we don't have a symbol table. I'll try to come up with a test
case later.
llvm-svn: 221870
|
|
|
|
|
|
|
| |
Use StringRef::startswith to tidy up some code, no functionality change
intended.
llvm-svn: 221869
|
|
|
|
|
|
|
|
| |
getObject didn't consider the case where a pointer came before the start
of the object file. No test is included, trying to come up with
something reasonable.
llvm-svn: 221868
|
|
|
|
| |
llvm-svn: 221855
|
|
|
|
|
|
|
|
|
|
| |
For historical reasons archives on mach-o have two possible names for the
file containing the table of contents for the archive: "__.SYMDEF SORTED"
and "__.SYMDEF". But the libObject archive reader only supported the former.
This patch fixes llvm::object::Archive to support both names.
llvm-svn: 221747
|
|
|
|
|
|
|
| |
Patch by Daniel Stewart <stewartd@codeaurora.org>!
Phabricator Revision: http://reviews.llvm.org/D6192
llvm-svn: 221639
|
|
|
|
|
|
|
|
| |
The ELF symbol `st_other` field might contain additional flags besides
visibility ones. This patch implements support for some MIPS specific
flags.
llvm-svn: 221491
|
|
|
|
|
|
|
| |
mingw lies about the size of a function's AuxFunctionDefinition. Ignore
the field and rely on our heuristic to determine the symbol's size.
llvm-svn: 221485
|
|
|
|
|
|
|
|
|
| |
Use the position of the subsequent symbol in the object file to infer
the size of it's predecessor. I hope to eventually remove whatever COFF
specific details from this little algorithm so that we can unify this
logic with what Mach-O does.
llvm-svn: 221444
|
|
|
|
| |
llvm-svn: 221333
|
|
|
|
| |
llvm-svn: 221268
|
|
|
|
|
|
|
|
| |
a public version MachOObjectFile::getScatteredRelocationType().
This should fix the build bot for the unused function error.
llvm-svn: 221216
|
|
|
|
|
|
| |
symbolizer.
llvm-svn: 221211
|
|
|
|
|
|
|
| |
Do a better job classifying symbols. This increases the consistency
between the COFF handling code and the ELF side of things.
llvm-svn: 220952
|
|
|
|
| |
llvm-svn: 220668
|
|
|
|
|
|
|
|
|
|
| |
To do this, change the representation of lazy loaded functions.
The previous representation cannot differentiate between a function whose body
has been removed and one whose body hasn't been read from the .bc file. That
means that in order to drop a function, the entire body had to be read.
llvm-svn: 220580
|
|
|
|
|
|
|
|
|
| |
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: 220230
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
While getSectionContents was updated to do the right thing,
getSectionSize wasn't. Move the logic to getSectionSize and leverage it
from getSectionContents.
llvm-svn: 219391
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is not useful to return the data beyond VirtualSize it's less than
SizeOfRawData.
An implementation detail of COFF requires the section size to be rounded
up to a multiple of FileAlignment; this means that SizeOfRawData is not
representative of how large the section is. Instead, we should cap it
to VirtualSize when this occurs as it represents the true size of the
section.
Note that this is only relevant in executable files because this
rounding doesn't occur in object files (and VirtualSize is always zero).
llvm-svn: 219388
|
|
|
|
| |
llvm-svn: 219383
|
|
|
|
| |
llvm-svn: 219324
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
It can only return null if passed a corrupted reference with a null Ref.p.
Checking for null is then an issue for asserts to check for internal
consistency, not control flow to check for invalid input.
I didn't add an assert(sec != nullptr) because toSec itself has a far more
complete assert.
llvm-svn: 219235
|
|
|
|
|
|
|
|
|
| |
There is no need to compute the coff_section of the symbol just to compare the
pointer.
Inspired by the ELF implementation.
llvm-svn: 219233
|
|
|
|
| |
llvm-svn: 218996
|
|
|
|
|
|
|
|
|
| |
This patch adds another iterator to access the delay-load import table
and use it from llvm-readobj.
http://reviews.llvm.org/D5594
llvm-svn: 218933
|
|
|
|
|
|
|
|
| |
This patch defines a new iterator for the imported symbols.
Make a change to COFFDumper to use that iterator to print
out imported symbols and its ordinals.
llvm-svn: 218915
|