- Jun 26, 2017
-
-
Peter Smith authored
On many architectures gcc and clang will recognize _GLOBAL_OFFSET_TABLE_ - . and produce a relocation that can be processed without needing to know the value of _GLOBAL_OFFSET_TABLE_. This is not always the case; for example ARM gcc produces R_ARM_BASE_PREL but clang produces the more general R_ARM_REL32 to _GLOBAL_OFFSET_TABLE_. To evaluate this relocation correctly _GLOBAL_OFFSET_TABLE_ must be defined to be the either the base of the GOT or end of the GOT dependent on architecture.. If/when llvm-mc is changed to recognize _GLOBAL_OFFSET_TABLE_ - . this change will not be necessary for new objects. However there may still be old objects and versions of clang. Differential Revision: https://reviews.llvm.org/D34355 llvm-svn: 306282
-
- Jun 24, 2017
-
-
Anton Korobeynikov authored
llvm-svn: 306225
-
Petar Jovanovic authored
r306095 in LLVM has changed register positions for instruction aui. This change updates the test that checks for aui. llvm-svn: 306173
-
- Jun 23, 2017
-
-
Reid Kleckner authored
llvm-svn: 306135
-
Peter Collingbourne authored
llvm-svn: 306128
-
Peter Collingbourne authored
This is useful when an upper limit on the cache size needs to be controlled independently of the amount of the amount of free space. One use case is a machine with a large number of cache directories (e.g. a buildbot slave hosting a large number of independent build jobs). By imposing an upper size limit on each cache directory, users can more easily estimate the server's capacity. Differential Revision: https://reviews.llvm.org/D34547 llvm-svn: 306126
-
Reid Kleckner authored
Summary: For SECTION relocations against absolute symbols, MSVC emits the largest output section index plus one. I've implemented that by threading a global variable through DefinedAbsolute that is filled in by the Writer. A more library-oriented approach would be to thread the Writer through Chunk::writeTo and SectionChunk::applyRel*, but Rui seems to prefer doing it this way. MSVC rejects SECREL relocations against absolute symbols, but only when the relocation is in a real output section. When the relocation is in a CodeView debug info section destined for the PDB, it seems that this relocation error is suppressed, and absolute symbols become zeros in the object file. This is easily implemented by checking the input section from which we're applying relocations. This should fix errors about __safe_se_handler_table and __guard_fids_table when linking the CRT and generating a PDB. Reviewers: ruiu Subscribers: aprantl, llvm-commits Differential Revision: https://reviews.llvm.org/D34541 llvm-svn: 306071
-
- Jun 22, 2017
-
-
Zachary Turner authored
Now you run llvm-pdbutil dump <options>. This is a followup after having renamed the tool, whereas before raw was obviously just the style of dumping, whereas now "dump" is the action to perform with the "util". llvm-svn: 306055
-
Rui Ueyama authored
Previously, when symbol A is renamed B, both A and B end up having the same name. This is because name is a symbol's attribute, and we memcpy symbols for symbol renaming. This pathc saves the original symbol name and restore it after memcpy to keep the original name. This patch shouldn't change program's meaning, but names in symbol tables make more sense than before. llvm-svn: 306036
-
Igor Kudrin authored
Differential Revision: https://reviews.llvm.org/D34442 llvm-svn: 305983
-
- Jun 21, 2017
-
-
Peter Collingbourne authored
This is unnecessary because --gc-sections runs before ICF. Differential Revision: https://reviews.llvm.org/D34465 llvm-svn: 305954
-
Reid Kleckner authored
Summary: The main complexity in adding symbol records is that we need to "relocate" all the type indices. Type indices do not have anything like relocations, an opaque data structure describing where to find existing type indices for fixups. The linker just has to "know" where the type references are in the symbol records. I added an overload of `discoverTypeIndices` that works on symbol records, and it seems to be able to link the standard library. Reviewers: zturner, ruiu Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D34432 llvm-svn: 305933
-
Rui Ueyama authored
This works around a strange interaction with Authenticode signatures, in which a signed PE executable with {Major,Minor}LinkerVersion = 0.0 fails to validate on Windows 7 (but is OK on Windows 10). Setting the linker version to 14.0 (which is what VS2015 outputs) makes it work again. Patch by Simon Tatham <simon.tatham@arm.com>. llvm-svn: 305929
-
Rui Ueyama authored
The --exclude-libs option is not a popular option, but at least some programs in Android depend on it, so it's worth to support it. Differential Revision: https://reviews.llvm.org/D34422 llvm-svn: 305920
-
Rui Ueyama authored
llvm-svn: 305877
-
Rui Ueyama authored
VC2017 contains these new symbols as undefined symobls. They are used for /guard:cf. Since we do not support the control flow guard, but we want to at least ignore these symbols so that we can link against VS2017 libraries. Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=727193. llvm-svn: 305876
-
Rui Ueyama authored
llvm-svn: 305868
-
- Jun 20, 2017
-
-
Reid Kleckner authored
We forgot to serialize these because llvm-readobj didn't dump them. They are typically all zeros in an object file. The linker fills them in with relocations before adding them to the PDB. Now we can properly round trip these symbols through pdb2yaml -> yaml2pdb. I made these fields optional with a zero default so that we can elide them from our test cases. llvm-svn: 305857
-
Sam Clegg authored
The option numbers in the macro were off by one which leads to some confusion. There are actually 12 arguments to this macro. Differential Revision: https://reviews.llvm.org/D34413 llvm-svn: 305823
-
Reid Kleckner authored
Summary: Previously we didn't add debug info chunks to the SparseChunks array, so they didn't participate in section GC. Now we do. Reviewers: ruiu Subscribers: aprantl, llvm-commits Differential Revision: https://reviews.llvm.org/D34356 llvm-svn: 305811
-
Yuka Takahashi authored
This is patch for GSoC project, bash-completion for clang. To use this on bash, please run `source clang/utils/bash-autocomplete.sh`. bash-autocomplete.sh is code for bash-completion. In this patch, Options.td was mainly changed in order to add value class in Options.inc. llvm-svn: 305805
-
Rafael Espindola authored
I found this while trying to build u-boot. It uses -Ttext in combination with linker scripts. My first reaction was to change the linker scripts to have the correct value, but I found that it is actually quite convenient to have -Ttext take precedence. By having just .text : { *(.text) } In the script, they can define the text address in a single Makefile and pass it to ld with -Ttext and for the C code with -DFoo=value. Doing the same with linker scripts would require them to be generated during the build. llvm-svn: 305766
-
- Jun 19, 2017
-
-
Kevin Enderby authored
to fail due to change in llvm trunk r305744. llvm-svn: 305747
-
Konstantin Zhuravlyov authored
Differential Revision: https://reviews.llvm.org/D34358 llvm-svn: 305742
-
Eric Beckmann authored
Summary: Have writeCOFFWriter return Expected<unique_ptr> instead of requiring being passed an uninitialized unique_ptr. Reviewers: zturner, ruiu Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D34307 llvm-svn: 305730
-
Rui Ueyama authored
llvm-svn: 305726
-
Rui Ueyama authored
llvm-svn: 305718
-
Reid Kleckner authored
llvm-svn: 305716
-
Rui Ueyama authored
llvm-svn: 305714
-
Reid Kleckner authored
Summary: This is a first step towards getting line info to show up in VS and windbg. So far, only llvm-pdbutil can parse the PDBs that we produce. cvdump doesn't like something about our file checksum tables. I'll have to dig into that next. This patch adds a new DebugSubsectionRecordBuilder which takes bytes directly from some other producer, such as a linker, and sticks it into the PDB. Line tables only need to be relocated. No data needs to be rewritten. File checksums and string tables, on the other hand, need to be re-done. Reviewers: zturner, ruiu Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D34257 llvm-svn: 305713
-
Andrew Ng authored
This patch adds support for segment NONE in linker scripts which enables the specification that a section should not be assigned to any segment. Note that GNU ld does not disallow the definition of a segment named NONE, which if defined, effectively overrides the behaviour described above. This feature has been copied. Differential Revision: https://reviews.llvm.org/D34203 llvm-svn: 305700
-
James Henderson authored
In r305364, Rui changed the mechanism that parses -z option values slightly. This caused a bug, as demonstrated by this test, which now fails: --- # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o # RUN: ld.lld %t.o -o %t -z max-page-size .global _start _start: nop --- Before, the link succeeded and set the max-page-size to the target default. After we get the following two error messages: "invalid max-page-size: " "max-page-size: value isn't a power of 2" The latter error is because an uninitialised variable ends up being passed back to getMaxPageSize). This change ensures we only get the first error. Reviewers: ruiu Differential Revision: https://reviews.llvm.org/D34234 llvm-svn: 305679
-
Peter Smith authored
The get{ARM,AArch64}UndefinedRelativeWeakVA() functions should only be called for PC-relative relocations. Complete the supported pc-relative relocations in the switch statement and make the default case unreachable. The R_ARM_TARGET relocation can be evaluated as R_ARM_REL32 but it is only used in the context of exception tables, and is never output with respect to a weak reference so it does not appear in the switch statement. Differential Revision: https://reviews.llvm.org/D34138 llvm-svn: 305673
-
- Jun 17, 2017
-
-
Eric Beckmann authored
Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34316 llvm-svn: 305631
-
Rafael Espindola authored
We would crash before. llvm-svn: 305615
-
Rafael Espindola authored
We would crash instead before. llvm-svn: 305614
-
Rafael Espindola authored
We would crash instead before. llvm-svn: 305613
-
Zachary Turner authored
This option is no longer needed. Differential Revision: https://reviews.llvm.org/D34302 llvm-svn: 305610
-
Rui Ueyama authored
llvm-svn: 305601
-
- Jun 16, 2017
-
-
Eric Beckmann authored
In this patch, I flip the switch in DriverUtils from using the external cvtres.exe tool to using the Windows Resource library in llvm. I also fixed a bug where .rsrc sections were marked as discardable memory and therefore were placed in the wrong order in the final PE. Furthermore, I modified WindowsResource to write the coff directly to a memory buffer instead of to file, also had it use the machine types already declared in COFF.h instead creating my own enum. Finally, I flipped the switch to allow all unit tests that had previously run only on windows due to a winres dependency to run cross-platform. Reviewers: zturner, ruiu Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D34265 llvm-svn: 305592
-