| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 354535
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we could emit a warning and generate a potentially invalid
wasm module (due to call sites and functions having conflicting
signatures). Now, rather than create invalid binaries we handle such
cases by creating stub functions containing unreachable, effectively
turning these into runtime errors rather than validation failures.
Differential Revision: https://reviews.llvm.org/D57909
llvm-svn: 354528
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Three MIPS-specific sections `.reginfo`, `.MIPS.options`, and `.MIPS.abiflags`
are used by loader to read their contents and setup environment for running
a program. Loader looks up these data in the corresponding segments:
`PT_MIPS_REGINFO`, `PT_MIPS_OPTIONS`, and `PT_MIPS_ABIFLAGS` respectively.
This patch put these sections to separate segments like we do already
for ARM `SHT_ARM_EXIDX` section.
Differential Revision: http://reviews.llvm.org/D58381
llvm-svn: 354468
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This field is unreferenced outside of createSyntheticSections.
Reviewers: ruiu, pcc, espindola, grimar
Reviewed By: grimar
Subscribers: grimar, emaste, arichardson, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58423
llvm-svn: 354449
|
|
|
|
|
|
|
|
| |
This field is unreferenced outside of createSyntheticSections.
Differential Revision: https://reviews.llvm.org/D58422
llvm-svn: 354428
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: ruiu, espindola
Reviewed By: ruiu
Subscribers: emaste, arichardson, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58265
llvm-svn: 354422
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
We translate @llvm.used to COFF by generating /include directives
in the .drectve section. However, in LTO links, this happens after
directives have already been processed, so the new directives do
not take effect. This change marks @llvm.used symbols as GCRoots
so that they are preserved as intended.
Fixes PR40733.
Reviewers: rnk, pcc, ruiu
Reviewed By: ruiu
Subscribers: mehdi_amini, steven_wu, dexonsmith, dang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58255
llvm-svn: 354410
|
|
|
|
| |
llvm-svn: 354405
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Rename MemoryIndex to InitFlags and implement logic for determining
data segment layout in ObjectYAML and MC. Also adds a "passive" flag
for the .section assembler directive although this cannot be assembled
yet because the assembler does not support data sections.
Reviewers: sbc100, aardappel, aheejin, dschuff
Subscribers: jgravelle-google, hiraditya, sunfish, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57938
llvm-svn: 354397
|
|
|
|
|
|
|
|
| |
LinkerDriver::link is getting too long, it's time to simplify it.
Differential Revision: https://reviews.llvm.org/D58395
llvm-svn: 354391
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D58380
llvm-svn: 354387
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a private undocumented option, intended to be used by
the MinGW driver frontend.
Also restructure the condition to put if (Config->MinGW) first.
This changes the behaviour for the tautological combination of
-export-all-symbols without -lldmingw.
Differential Revision: https://reviews.llvm.org/D58380
llvm-svn: 354386
|
|
|
|
| |
llvm-svn: 354341
|
|
|
|
|
|
| |
yaml2obj was changed in r354338("[yaml2obj][obj2yaml] - Support SHT_GNU_versym (.gnu.version) section.")
llvm-svn: 354339
|
|
|
|
|
|
|
| |
The test checks common functionality. Let's use `x86` (generic LLD target)
as a target architecture.
llvm-svn: 354336
|
|
|
|
| |
llvm-svn: 354315
|
|
|
|
|
|
|
|
| |
MIPS R6 code uses the `R_MIPS_PC26_S2` relocation for calls which might
cross boundaries of non-PIC-to-PIC code. We need to create a LA25 thunks
for that case.
llvm-svn: 354312
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch solves two tasks:
1. MIPS ABI allows to mix regular and microMIPS code and perform
cross-mode jumps. Linker needs to detect such cases and replace
jump/branch instructions by their cross-mode equivalents.
2. Other tools like dunamic linkers need to recognize cases when dynamic
table entries, e_entry field of an ELF header etc point to microMIPS
symbol. Linker should provide such information.
The first task is implemented in the `MIPS<ELFT>::relocateOne()` method.
New routine `fixupCrossModeJump` detects ISA mode change, checks and
replaces an instruction.
The main problem is how to recognize that relocation target is microMIPS
symbol. For absolute and section symbols compiler or assembler set the
less-significant bit of the symbol's value or sum of the symbol's value
and addend. And this bit signals to linker about microMIPS code. For
global symbols compiler cannot do the same trick because other tools like,
for example, disassembler wants to know an actual position of the symbol.
So compiler sets STO_MIPS_MICROMIPS flag in the `st_other` field.
In `MIPS<ELFT>::relocateOne()` method we have a symbol's value only and
cannot access any symbol's attributes. To pass type of the symbol
(regular/microMIPS) to that routine as well as other places where we
write a symbol value as-is (.dynamic section, `Elf_Ehdr::e_entry` field
etc) we set when necessary a less-significant bit in the `getSymVA`
function.
Differential revision: https://reviews.llvm.org/D40147
llvm-svn: 354311
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D58301
llvm-svn: 354241
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On PowerPC64, it is necessary to keep the LocalEntry bits in st_other,
especially when -r is used. Otherwise, when the resulting object is used
in a posterior linking, LocalEntry info will be unavailable and
functions may be called through the wrong entrypoint.
Patch by Leandro Lupori.
Differential Revision: https://reviews.llvm.org/D56782
llvm-svn: 354184
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D58026
llvm-svn: 354086
|
|
|
|
|
|
| |
This reverts commit 9934f2ff02dba9fdabe6e27a83f9f95388bf4132.
llvm-svn: 354081
|
|
|
|
|
|
| |
This reverts commit 2694810153cf992823eb45253d26b8567424438f.
llvm-svn: 354080
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
So this patch just make sure that the thread is at least stated
before we return from main.
If we just detach then the thread may be actually be stated just after
the process returned from main and it's calling atexit handers. Then the thread may try to create own function static variable and it will
add new at exit handlers confusing libc.
GLIBC before 2.27 had race in that case which corrupted atexit handlers
list. Support for this use-case for other implementation is also unclear,
so we can try just avoid that.
PR40162
Reviewers: ruiu, espindola
Subscribers: emaste, arichardson, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58246
llvm-svn: 354078
|
|
|
|
| |
llvm-svn: 354054
|
|
|
|
| |
llvm-svn: 354052
|
|
|
|
| |
llvm-svn: 354049
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we showed the following message for an unknown relocation:
foo.o: unrecognized reloc 256
This patch improves it so that the error message includes a symbol name:
foo.o: unknown relocation (256) against symbol bar
llvm-svn: 354040
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Turns out nobody understands what "conflicting comdat type" is supposed to
mean, so just emit a regular "duplicate symbol" error and move the comdat
selection information into /verbose output.
This also fixes a problem where the error output would depend on the order of
.obj files passed. Before this patch:
- If passed `one_only.obj discard.obj`, lld-link would only err "conflicting
comdat type"
- If passed `discard.obj one_only.obj`, lld-link would err "conflicting comdat
type" and then "duplicate symbol"
Now lld-link only errs "duplicate symbol" in both cases.
I considered adding a "Detail" parameter to reportDuplicate() that's printed in
parens at the end of the "duplicate symbol" diag if present, and then put the
comdat selection mismatch details there, but since users don't know what it's
supposed to mean decided against it. I also considered special-casing the
Detail message for one_only/discard mismatches, which in practice means
"function defined as inline in TU 1 but as out-of-line in TU 2", but I wasn't
sure how useful it is so I omitted that too.
Differential Revision: https://reviews.llvm.org/D58180
llvm-svn: 354006
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
IRELATIVE where possible.
Non-GOT non-PLT relocations to non-preemptible ifuncs result in the
creation of a canonical PLT, which now takes the identity of the IFUNC
in the symbol table. This (a) ensures address consistency inside and
outside the module, and (b) fixes a bug where some of these relocations
end up pointing to the resolver.
Fixes (at least) PR40474 and PR40501.
Differential Revision: https://reviews.llvm.org/D57371
llvm-svn: 353981
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a 7.0 -> 8.0 regression when parsing
OUTPUT_FORMAT("elf32-powerpc"); or elf32-bigmips directive in ldscripts
as well as an unknown emulation error when lld is invoked by clang due
to missed elf32ppclinux case.
Patch by vit9696
Differential Revision: https://reviews.llvm.org/D58005
llvm-svn: 353968
|
|
|
|
|
|
|
|
|
|
| |
Previously, we validated -z options after we process --version or --help flags.
So, if one of these flags is given, we wouldn't show an "unknown -z option"
error. This patch fixes that behavior.
Differential Revision: https://reviews.llvm.org/D55446
llvm-svn: 353967
|
|
|
|
|
|
|
| |
The printing of branch operands for call instructions was changed to properly
handle negative offsets. Updating the tests to reflect that.
llvm-svn: 353866
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A follow up to the intial patch that unblocked linking against libgcc.
For lld we don't need to bother tracking which objects have got based small
code model relocations. This is due to the fact that the compilers on
powerpc64 use the .toc section to generate indirections to symbols (rather then
using got relocations) which keeps the got small. This makes overflowing a
small code model got relocation very unlikely.
Differential Revision: https://reviews.llvm.org/D57245
llvm-svn: 353849
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gold accepts quoted strings. binutils requires quoted strings for some
kinds of symbols, e.g.:
it accepts quoted symbols with @ in name:
$ echo 'EXTERN("__libc_start_main@@GLIBC_2.2.5")' > a.script
$ g++ a.script
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
but rejects them if unquoted:
$ echo 'EXTERN(__libc_start_main@@GLIBC_2.2.5)' > a.script
$ g++ a.script
a.script: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
To maintain compatibility with existing linker scripts support quoted
strings in lld as well.
Patch by Lucian Adrian Grijincu.
Differential Revision: https://reviews.llvm.org/D57987
llvm-svn: 353756
|
|
|
|
| |
llvm-svn: 353751
|
|
|
|
|
|
|
| |
.dynamic section format accepted by yaml2obj was
changed in r353606
llvm-svn: 353607
|
|
|
|
| |
llvm-svn: 353605
|
|
|
|
|
|
|
|
| |
the bin directory. [NFC]
This error was introduced in r353508.
llvm-svn: 353602
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The message "could not get the buffer for the member defining symbol"
now also contains the name of the archive and the name of the archive
member that we tried to open.
Reviewers: ruiu
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57974
llvm-svn: 353572
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code producing error messages relating to missing thin archive
members was missing any testing as far as I could see, so this patch
adds a test for it.
Reviewed by: ruiu
Differential Revision: https://reviews.llvm.org/D57899
llvm-svn: 353508
|
|
|
|
|
|
|
|
|
|
| |
Also add to the docs.
This is refactor in preparation for https://reviews.llvm.org/D57909
Differential Revision: https://reviews.llvm.org/D57920
llvm-svn: 353478
|
|
|
|
|
|
|
|
|
|
|
|
| |
import names in the .o format
Add a flag to allow symbols to have a wasm import name which differs from the
linker symbol name, allowing the linker to link code using the import_module
attribute.
Differential Revision: https://reviews.llvm.org/D57632
llvm-svn: 353473
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D57913
llvm-svn: 353451
|
|
|
|
|
|
|
|
| |
R_X86_64_PC{8,16} relocations are sign-extended, so when we check
for relocation overflow, we had to use checkInt instead of checkUInt.
I confirmed that GNU linkers create the same output for the test case.
llvm-svn: 353437
|
|
|
|
| |
llvm-svn: 353399
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the same as D57749, but for x64 target.
"ELF Handling For Thread-Local Storage" p41 says (https://www.akkadia.org/drepper/tls.pdf):
R_X86_64_GOTTPOFF relocation is used for IE TLS models.
Hence if linker sees this relocation we should add DF_STATIC_TLS flag.
Differential revision: https://reviews.llvm.org/D57821
llvm-svn: 353378
|
|
|
|
|
|
|
|
|
|
|
|
| |
This flag means that symbol should be exported in the final binary.
The reason for this change is to allow source level annotations to
trigger a given symbol to be exported:
https://github.com/emscripten-core/emscripten/issues/7702
Differential Revision: https://reviews.llvm.org/D57869
llvm-svn: 353364
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D57868
llvm-svn: 353358
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D57808
llvm-svn: 353342
|