|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init |
|
| #
e980f16d |
| 30-Jun-2022 |
Fangrui Song <[email protected]> |
[ELF] Move whyExtract/backwardReferences from LinkerDriver to Ctx. NFC
Ctx was recently added as a more suitable place for such singletons.
|
|
Revision tags: llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2 |
|
| #
b862bcbf |
| 19-Apr-2022 |
Shoaib Meenai <[email protected]> |
[ELF] Move SymbolUnion assertions to source file
Otherwise they fires for every single file which includes the header, which is very noisy when building.
Reviewed By: MaskRay, peter.smith
Differen
[ELF] Move SymbolUnion assertions to source file
Otherwise they fires for every single file which includes the header, which is very noisy when building.
Reviewed By: MaskRay, peter.smith
Differential Revision: https://reviews.llvm.org/D124041
show more ...
|
|
Revision tags: llvmorg-14.0.1 |
|
| #
7c7702b3 |
| 16-Mar-2022 |
Fangrui Song <[email protected]> |
[ELF] Move section assignment from initializeSymbols to postParse
https://discourse.llvm.org/t/parallel-input-file-parsing/60164
initializeSymbols currently sets Defined::section and handles non-pr
[ELF] Move section assignment from initializeSymbols to postParse
https://discourse.llvm.org/t/parallel-input-file-parsing/60164
initializeSymbols currently sets Defined::section and handles non-prevailing COMDAT groups. Move the code to the parallel postParse to reduce work from the single-threading code path and make parallel section initialization infeasible.
Postpone reporting duplicate symbol errors so that the messages have the section information. (`Defined::section` is assigned in postParse and another thread may not have the information).
* duplicated-synthetic-sym.s: BinaryFile duplicate definition (very rare) now has no section information * comdat-binding: `%t/w.o %t/g.o` leads to an undesired undefined symbol. This is not ideal but we report a diagnostic to inform that this is unsupported. (See release note) * comdat-discarded-lazy.s: %tdef.o is unextracted. The new behavior (discarded section error) makes more sense * i386-comdat.s: switched to a better approach working around .gnu.linkonce.t.__x86.get_pc_thunk.bx in glibc<2.32 for x86-32. Drop the ancient no-longer-relevant workaround for __i686.get_pc_thunk.bx
Depends on D120640
Differential Revision: https://reviews.llvm.org/D120626
show more ...
|
| #
9b61fff0 |
| 16-Mar-2022 |
Fangrui Song <[email protected]> |
Revert D120626 "[ELF] Move section assignment from initializeSymbols to postParse"
This reverts commit c30e6447c0225f675773d07f2b6d4e3c2b962155. It exposed brittle support for __x86.get_pc_thunk.bx.
Revert D120626 "[ELF] Move section assignment from initializeSymbols to postParse"
This reverts commit c30e6447c0225f675773d07f2b6d4e3c2b962155. It exposed brittle support for __x86.get_pc_thunk.bx. Need to think a bit how to support __x86.get_pc_thunk.bx.
show more ...
|
| #
c1d4c677 |
| 16-Mar-2022 |
Fangrui Song <[email protected]> |
[ELF] Suppress duplicate symbol error for __x86.get_pc_thunk.bx
|
| #
c30e6447 |
| 14-Mar-2022 |
Fangrui Song <[email protected]> |
[ELF] Move section assignment from initializeSymbols to postParse
https://discourse.llvm.org/t/parallel-input-file-parsing/60164
initializeSymbols currently sets Defined::section and handles non-pr
[ELF] Move section assignment from initializeSymbols to postParse
https://discourse.llvm.org/t/parallel-input-file-parsing/60164
initializeSymbols currently sets Defined::section and handles non-prevailing COMDAT groups. Move the code to the parallel postParse to reduce work from the single-threading code path and make parallel section initialization infeasible.
Postpone reporting duplicate symbol errors so that the messages have the section information. (`Defined::section` is assigned in postParse and another thread may not have the information).
* duplicated-synthetic-sym.s: BinaryFile duplicate definition (very rare) now has no section information * comdat-binding: `%t/w.o %t/g.o` leads to an undesired undefined symbol. This is not ideal but we report a diagnostic to inform that this is unsupported. (See release note) * comdat-discarded-lazy.s: %tdef.o is unextracted. The new behavior (discarded section error) makes more sense
Depends on D120640
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D120626
show more ...
|
| #
c7cf960d |
| 14-Mar-2022 |
Fangrui Song <[email protected]> |
[ELF] Set the priority of STB_GNU_UNIQUE the same as STB_WEAK
In GCC -fgnu-unique output, STB_GNU_UNIQUE symbols are always defined relative to a section in a COMDAT group. Currently `other` cannot
[ELF] Set the priority of STB_GNU_UNIQUE the same as STB_WEAK
In GCC -fgnu-unique output, STB_GNU_UNIQUE symbols are always defined relative to a section in a COMDAT group. Currently `other` cannot be STB_GNU_UNIQUE for valid input, so this patch is NFC.
If we switch to the model that ignores COMDAT resolution when performing symbol resolution (D120626), this will fix bogus `relocation refers to a symbol in a discarded section` errors when mixing -fno-gnu-unique objects with -fgnu-unique objects.
Differential Revision: https://reviews.llvm.org/D120640
show more ...
|
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2 |
|
| #
b07ef4d5 |
| 28-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] Rename Symbol::compare to shouldReplace. NFC
The return value is not a boolean instead of a tri-state. Suggested by Peter Smith in D120640.
|
| #
d14d8664 |
| 27-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] Change global variable backwardReferences to a LinkerDriver member variable. NFC
Similar to whyExtract.
|
| #
7fd3849b |
| 27-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] Move --print-archive-stats= and --why-extract= beside --warn-backrefs report
So that early errors don't suppress their output.
|
| #
19e37a74 |
| 24-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] Update comment. NFC
|
| #
6d943408 |
| 24-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] Simplify resolveDefined and resolveCommon
This is NFC for valid input (COMMON symbols cannot be weak or versioned).
|
| #
15617cdb |
| 24-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] Simplify --fortran-common. NFC
|
| #
4129890d |
| 24-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] De-template Symbol::resolveLazy. NFC
|
| #
8ca46bba |
| 24-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] Move isUsedInRegularObj assignment from ctor to call sites. NFC
This removes the tricky `isUsedInRegularObj(!file || file->kind() == InputFile::ObjKind)` and the copy from `Symbol::mergeProper
[ELF] Move isUsedInRegularObj assignment from ctor to call sites. NFC
This removes the tricky `isUsedInRegularObj(!file || file->kind() == InputFile::ObjKind)` and the copy from `Symbol::mergeProperties`.
show more ...
|
| #
88d66f6e |
| 22-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] Move duplicate symbol check after input file parsing
https://discourse.llvm.org/t/parallel-input-file-parsing/60164
To decouple symbol initialization and section initialization, `Defined::sec
[ELF] Move duplicate symbol check after input file parsing
https://discourse.llvm.org/t/parallel-input-file-parsing/60164
To decouple symbol initialization and section initialization, `Defined::section` assignment should be postponed after input file parsing. To avoid spurious duplicate definition error due to two definitions in COMDAT groups of the same signature, we should postpone the duplicate symbol check.
The function is called postScan instead of a more specific name like checkDuplicateSymbols, because we may merge Symbol::mergeProperties into postScan. It is placed after compileBitcodeFiles to apply to ET_REL files produced by LTO. This causes minor diagnostic regression for skipLinkedOutput configurations: ld.lld --thinlto-index-only a.bc b.o (bitcode definition prevails) won't detect duplicate symbol error. I think this is an acceptable compromise. The important cases where (a) both files are bitcode or (b) --thinlto-index-only is unused are still detected.
Reviewed By: ikudrin
Differential Revision: https://reviews.llvm.org/D119908
show more ...
|
| #
467e1b3a |
| 15-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] reportDuplicate: change Symbol * to const Symbol &. NFC
|
| #
3d854240 |
| 15-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] Parse archives as --start-lib object files
https://maskray.me/blog/2022-01-16-archives-and-start-lib
For every definition in an extracted archive member, we intern the symbol twice, once for
[ELF] Parse archives as --start-lib object files
https://maskray.me/blog/2022-01-16-archives-and-start-lib
For every definition in an extracted archive member, we intern the symbol twice, once for the archive index entry, once for the .o symbol table after extraction. This is inefficient.
Symbols in a --start-lib ObjFile/BitcodeFile are only interned once because the result is cached in symbols[i].
Just handle an archive using the --start-lib code path. We can therefore remove ArchiveFile and LazyArchive. For many projects, archive member extraction ratio is high and it is a net performance win. Linking a Release build of clang is 1.01x as fast.
Note: --start-lib scans symbols in the same order that llvm-ar adds them to the index, so in the common case the semantics should be identical. If the archive symbol table was created in a different order, or is incomplete, this strategy may have different semantics. Such cases are considered user error.
The `is neither ET_REL nor LLVM bitcode` error is changed to a warning. Previously an archive may have such members without a diagnostic. Using a warning prevents breakage.
* For some tests, the diagnostics get improved where we did not consider the archive member name: `b.a:` => `b.a(b.o):`. * `no-obj.s`: the link is now allowed, matching GNU ld * `archive-no-index.s`: the `is neither ET_REL nor LLVM bitcode` diagnostic is demoted to a warning. * `incompatible.s`: even when an archive is unextracted, we may report an "incompatible with" error.
---
I recently decreased sizeof(SymbolUnion) by 8 and decreased memory usage quite a bit, so retaining `symbols` for un-extracted archive members should not cause a memory usage problem.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D119074
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc1 |
|
| #
27bb7990 |
| 08-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] Clean up headers. NFC
|
| #
977a1a52 |
| 06-Feb-2022 |
Fangrui Song <[email protected]> |
[ELF] Symbol::replace: use the old nameData/nameSize. NFC
Currently `this->getName() == newSym.getName()`. By keeping the old nameData/nameSize, newSym's nameData/nameSize will be ignored. The call
[ELF] Symbol::replace: use the old nameData/nameSize. NFC
Currently `this->getName() == newSym.getName()`. By keeping the old nameData/nameSize, newSym's nameData/nameSize will be ignored. The call sites can avoid calling getName().
printTraceSymbol needs to take the symbol name since `other`'s name is empty.
show more ...
|
|
Revision tags: llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3 |
|
| #
9e885eac |
| 16-Jan-2022 |
Fangrui Song <[email protected]> |
[ELF] Remove !isLazy() condition from computeBinding
Seems applicable since we demote lazy symbols to Undefined (D111365).
|
| #
c0fc09ab |
| 16-Jan-2022 |
Fangrui Song <[email protected]> |
[ELF] Remove config->relocatable condition from Symbol::computeBinding
|
| #
b3cc4700 |
| 16-Jan-2022 |
Fangrui Song <[email protected]> |
[ELF] Speed up Symbol::computeBinding. NFC
When computeBinding is inlined into includeInDynsym and computeIsPreemptible, the optimizer can remove the config->gnuUnique load.
|
| #
01a51629 |
| 16-Jan-2022 |
Fangrui Song <[email protected]> |
[ELF] Slightly speed up Symbol::includeInDynsym. NFC
|
| #
7330fd23 |
| 16-Jan-2022 |
Fangrui Song <[email protected]> |
[ELF] Simplify Symbol::includeInDynsym
|