| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
In tree they are only used by llvm-readobj, but it is also used by
https://github.com/mono/CppSharp.
While at it, add some missing error checking.
llvm-svn: 244320
|
|
|
|
|
|
|
|
| |
This makes llvm-nm consistent with binutils nm on executables and DLLs.
For a vanilla hello world executable, the address of main should include
the default image base of 0x400000.
llvm-svn: 243755
|
|
|
|
| |
llvm-svn: 242998
|
|
|
|
| |
llvm-svn: 242981
|
|
|
|
| |
llvm-svn: 242839
|
|
|
|
| |
llvm-svn: 242712
|
|
|
|
|
|
| |
Use just the pointers and check for invalid relocation sections.
llvm-svn: 242700
|
|
|
|
| |
llvm-svn: 242676
|
|
|
|
|
|
| |
We now use a simple pointer and have range loops.
llvm-svn: 242669
|
|
|
|
| |
llvm-svn: 242658
|
|
|
|
|
|
| |
Sorry about that.
llvm-svn: 242083
|
|
|
|
|
|
| |
This time without breaking the bots.
llvm-svn: 241869
|
|
|
|
| |
llvm-svn: 241815
|
|
|
|
| |
llvm-svn: 241781
|
|
|
|
| |
llvm-svn: 241765
|
|
|
|
|
|
| |
It is pretty unambiguous how to interpret it and gnu ar accepts it too.
llvm-svn: 241750
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When talking about the virtual address of sections the coff spec says:
... for simplicity, compilers should set this to zero. Otherwise, it is an
arbitrary value that is subtracted from offsets during relocation.
We don't currently subtract it, so check that it is zero.
If some producer does create such files, we can change getRelocationOffset
instead.
llvm-svn: 241447
|
|
|
|
|
|
| |
Thanks to Aboud, Amjad for reporting the regression and providing the testcase.
llvm-svn: 241440
|
|
|
|
| |
llvm-svn: 241109
|
|
|
|
|
|
| |
We were already checking, but were missing a test.
llvm-svn: 241094
|
|
|
|
| |
llvm-svn: 241070
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
We were already checking this, but had no tests.
llvm-svn: 240945
|
|
|
|
| |
llvm-svn: 240944
|
|
|
|
|
|
|
|
| |
This case had been failing on testers that didn't have x86 support. Rather
than XFAIL it on testers without x86 support, I've just assembled it and used
the raw object as the test input.
llvm-svn: 240875
|
|
|
|
|
|
|
|
|
|
| |
The parser provides a convenient interface for reading llvm stackmap v1 sections
in object files.
This patch also includes a new option for llvm-readobj, '-stackmap', which uses
the parser to pretty-print stackmap sections for debugging/testing purposes.
llvm-svn: 240860
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch changes getRelocationAddend to use ErrorOr and considers it an error
to try to get the addend of a REL section.
If, for example, a x86_64 file has a REL section, that file is corrupted and
we should reject it.
Using ErrorOr is not ideal since we check the section type once per relocation
instead of once per section.
Checking once per section would involve getRelocationAddend just asserting and
callers checking the section before iterating over the relocations.
In any case, this is an improvement and includes a test.
llvm-svn: 240176
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Instead, properly report this error from MachOObjectFile constructor.
Test Plan: regression test suite
Reviewers: rafael
Subscribers: llvm-commits
llvm-svn: 239078
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
We still detect the same errors, but now we do it earlier.
llvm-svn: 238024
|
|
|
|
| |
llvm-svn: 237451
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gep operator
Similar to gep (r230786) and load (r230794) changes.
Similar migration script can be used to update test cases, which
successfully migrated all of LLVM and Polly, but about 4 test cases
needed manually changes in Clang.
(this script will read the contents of stdin and massage it into stdout
- wrap it in the 'apply.sh' script shown in previous commits + xargs to
apply it over a large set of test cases)
import fileinput
import sys
import re
rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL)
def conv(match):
line = match.group(1)
line += match.group(4)
line += ", "
line += match.group(2)
return line
line = sys.stdin.read()
off = 0
for match in re.finditer(rep, line):
sys.stdout.write(line[off:match.start()])
sys.stdout.write(conv(match))
off = match.end()
sys.stdout.write(line[off:])
llvm-svn: 232184
|
|
|
|
|
|
|
| |
In the review for r230567, it was pointed out we should really test
the lib/Object part of that change. This does so using llvm-readobj.
llvm-svn: 230779
|
|
|
|
|
|
| |
This adds section group support to the tools obj2yaml and yaml2obj.
llvm-svn: 230124
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 64-bit MIPS ELF archive file format is used by MIPS64 targets.
The main difference from a regular archive file is the symbol table format:
1. ar_name is equal to "/SYM64/"
2. number of symbols and offsets are 64-bit integers
http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf
Page 96
The patch allows reading of such archive files by llvm-nm, llvm-objdump
and other tools. But it does not support archive files with number of symbols
and/or offsets exceed 2^32. I think it is a rather rare case requires more
significant modification of `Archive` class code.
http://reviews.llvm.org/D7546
llvm-svn: 229520
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
accesses while reading MachO files.
Summary:
Shift an older “invalid file” test to get a consistent naming for these tests.
Bugs found by afl-fuzz
Reviewers: rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6945
llvm-svn: 226219
|
|
|
|
| |
llvm-svn: 225271
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This fixes the exports iterator if the export list is empty.
Reviewers: Bigcheese, kledzik
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6732
llvm-svn: 224563
|
|
|
|
|
|
| |
This is just sufficient for 'ar t' to work.
llvm-svn: 224307
|
|
|
|
| |
llvm-svn: 223346
|
|
|
|
|
|
| |
indicator bit
llvm-svn: 222726
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
The MRI scripts have to work with CRLF, and in general it is probably
a good idea to support this in a core utility like LineIterator.
llvm-svn: 221153
|
|
|
|
| |
llvm-svn: 219480
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Long section names are represented as a slash followed by a numeric
ASCII string. This number is an offset into a string table.
Print the appropriate entry in the string table instead of the less
enlightening /4.
N.B. yaml2obj already does the right thing, this test exercises both
sides of the (de-)serialization.
llvm-svn: 219458
|
|
|
|
|
|
|
|
| |
It would prevent the display of a single byte instruction before a label.
Patch by Steve King!
llvm-svn: 215837
|
|
|
|
| |
llvm-svn: 213327
|
|
|
|
|
|
| |
obj2yaml and yaml2obj tools.
llvm-svn: 212908
|