| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[lld-macho] Filter TAPI re-exports by target Previously, we were loading re-exports without checking whether they were compatible with our target. Prior to {D97209}, it meant that we were defining dylib symbols that were invalid -- usually a silent failure unless our binary actually used them. D97209 exposed this as an explicit error. Along the way, I've extended our TAPI compatibility check to cover the platform as well, instead of just checking the arch. To this end, I've replaced MachO::Architecture with MachO::Target in our Config struct. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D97867 | 5 年前 | |
[lld-macho][NFC] Purge stale test-output trees prior to split-file Enforce standard practice Differential Revision: https://reviews.llvm.org/D102112 | 5 年前 | |
[lld-macho] Always include custom syslibroot when running tests This greatly reduces the amount of boilerplate in our tests. Reviewed By: #lld-macho, compnerd Differential Revision: https://reviews.llvm.org/D87960 | 5 年前 | |
[lld-macho][nfc] Clean up tests * Migrate most of our tests to use split-file instead of echo * Remove individual rm -f %t/libfoo.a commands in favor of a top-level rm -rf %t * Remove unused Inputs/libfunction.s Reviewed By: #lld-macho, compnerd Differential Revision: https://reviews.llvm.org/D93604 | 5 年前 | |
[lld/mac] Don't assert during thunk insertion if there are undefined symbols We end up calling resolveBranchVA(), which asserts for Undefineds. As fix, just return early in Writer::run() if there are any diagnostics after processing relocations (which is where undefined symbol errors are emitted). This matches what the ELF port does. Differential Revision: https://reviews.llvm.org/D109079 | 4 年前 | |
[lld-macho] Refactor archive loading The previous logic was duplicated between symbol-initiated archive loads versus flag-initiated loads (i.e. -force_load and -ObjC). This resulted in code duplication as well as redundant work -- we would create Archive instances twice whenever we had one of those flags; once in getArchiveMembers and again when we constructed the ArchiveFile. This was motivated by an upcoming diff where we load archive members containing ObjC-related symbols before loading those containing ObjC-related sections, as well as before performing symbol resolution. Without this refactor, it would be difficult to do that while avoiding loading the same archive member twice. Differential Revision: https://reviews.llvm.org/D108780 | 4 年前 | |
[lld] Add test suite mode for running LLD main twice LLD_IN_TEST determines how many times each port's main function is run in each LLD process, and setting LLD_IN_TEST=2 (or higher) is useful for checking if we're cleaning up and resetting global state correctly. Add a test suite parameter to enable this easily. There's work in progress to remove global state (e.g. D108850), but this seems useful in the interim. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D112898 | 4 年前 | |
[lld-macho] Include address offsets in error messages This makes it easier to pinpoint the source of the problem. TODO: Have more relocation error messages make use of this functionality. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D118798 | 4 年前 | |
[lld-macho] Include address offsets in error messages This makes it easier to pinpoint the source of the problem. TODO: Have more relocation error messages make use of this functionality. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D118798 | 4 年前 | |
[lld-macho][nfc] Convert tabs to spaces | 5 年前 | |
[lld-macho][nfc] Convert tabs to spaces | 5 年前 | |
[lld-macho] Include address offsets in error messages This makes it easier to pinpoint the source of the problem. TODO: Have more relocation error messages make use of this functionality. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D118798 | 4 年前 | |
[lld-macho] Associate compact unwind entries with function symbols Compact unwind entries (CUEs) contain pointers to their respective function symbols. However, during the link process, it's far more useful to have pointers from the function symbol to the CUE than vice versa. This diff adds that pointer in the form of Defined::compactUnwind. In particular, when doing dead-stripping, we want to mark CUEs live when their function symbol is live; and when doing ICF, we want to dedup sections iff the symbols in that section have identical CUEs. In both cases, we want to be able to locate the symbols within a given section, as well as locate the CUEs belonging to those symbols. So this diff also adds InputSection::symbols. The ultimate goal of this refactor is to have ICF support dedup'ing functions with unwind info, but that will be handled in subsequent diffs. This diff focuses on simplifying -dead_strip -- findFunctionsWithUnwindInfo is no longer necessary, and Defined::isLive() is now a lot simpler. Moreover, UnwindInfoSection no longer has to check for dead CUEs -- we simply avoid adding them in the first place. Additionally, we now support stripping of dead LSDAs, which follows quite naturally since markLive() can now reach them via the CUEs. Reviewed By: #lld-macho, gkm Differential Revision: https://reviews.llvm.org/D109944 | 4 年前 | |
[lld-macho] Use fewer indirections in UnwindInfo implementation The previous implementation of UnwindInfoSection materialized all the compact unwind entries & applied their relocations, then parsed the resulting data to generate the final unwind info. This design had some unfortunate conseqeuences: since relocations can only be applied after their referents have had addresses assigned, operations that need to happen before address assignment must contort themselves. (See {D113582} and observe how this diff greatly simplifies it.) Moreover, it made synthesizing new compact unwind entries awkward. Handling PR50956 will require us to do this synthesis, and is the main motivation behind this diff. Previously, instead of generating a new CompactUnwindEntry directly, we would have had to generate a ConcatInputSection with a number of Relocs that would then get "flattened" into a CompactUnwindEntry. This diff introduces an internal representation of CompactUnwindEntry (the former CompactUnwindEntry has been renamed to CompactUnwindLayout). The new CompactUnwindEntry stores references to its personality symbol and LSDA section directly, without the use of Reloc structs. In addition to being easier to work with, this diff also allows us to handle unwind info whose personality symbols are located in sections placed after the __unwind_info. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D123276 | 4 年前 | |
[lld-macho][nfc] Remove unnecessary -pie flags in tests D101513 means that we no longer need to specify -pie in most of our test RUN commands. Let's clean up the unused flags so as not to confuse future test writers. Reviewed By: #lld-macho, oontvoo, MaskRay Differential Revision: https://reviews.llvm.org/D113114 | 4 年前 | |
[lld-macho] Include address offsets in error messages This makes it easier to pinpoint the source of the problem. TODO: Have more relocation error messages make use of this functionality. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D118798 | 4 年前 | |
[lld-macho][nfc] Give every SyntheticSection a fake InputSection Previously, it was difficult to write code that handled both synthetic and regular sections generically. We solve this problem by creating a fake InputSection at the start of every SyntheticSection. This refactor allows us to handle DSOHandle like a regular Defined symbol (since Defined symbols must be attached to an InputSection), and paves the way for supporting __mh_*header symbols. Additionally, it simplifies our binding/rebase code. I did have to extend Defined a little -- it now has a linkerInternal flag, to indicate that ___dso_handle should not be in the final symbol table. I've also added some additional testing for ___dso_handle. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D98545 | 5 年前 | |
[lld-macho] Use source information in duplicate symbol errors Similarly to how undefined symbol diagnostics were changed in D128184, we now show where in the source file duplicate symbols are defined at: ld64.lld: error: duplicate symbol: _foo >> defined in bar.c:42 >> /path/to/bar.o >> defined in baz.c:1 >> /path/to/libbaz.a(baz.o) For objects that don't contain DWARF data, the format is unchanged. A slight difference to undefined symbol diagnostics is that we don't print the name of the symbol on the third line, as it's already contained on the first line. Differential Revision: https://reviews.llvm.org/D128425 | 3 年前 | |
[lld-macho] Basic support for linkage and visibility attributes in LTO When parsing bitcode, convert LTO Symbols to LLD Symbols in order to perform resolution. The "winning" symbol will then be marked as Prevailing at LTO compilation time. This is similar to what the other LLD ports do. This change allows us to handle linkonce symbols correctly, and to deal with duplicate bitcode symbols gracefully. Previously, both scenarios would result in an assertion failure inside the LTO code, complaining that multiple Prevailing definitions are not allowed. While at it, I also added basic logic around visibility. We don't do anything useful with it yet, but we do check that its value is valid. LLD-ELF appears to use it only to set FinalDefinitionInLinkageUnit for LTO, which I think is just a performance optimization. From my local experimentation, the linker itself doesn't seem to do anything differently when encountering linkonce / linkonce_odr / weak / weak_odr. So I've only written a test for one of them. LLD-ELF has more, but they seem to mostly be testing the intermediate bitcode output of their LTO backend...? I'm far from an expert here though, so I might very well be missing things. Reviewed By: #lld-macho, MaskRay, smeenai Differential Revision: https://reviews.llvm.org/D94342 | 5 年前 | |
[lld-macho] Demangle symbol names in duplicate-symbol error when -demangle is specified Differential Revision: https://reviews.llvm.org/D127110 | 3 年前 | |
[lld-macho][reland] Initial support for EH Frames This reverts commit 942f4e3a7cc9a9f8b2654817cff12907d1276031. The additional change required to avoid the assertion errors seen previously is: --- a/lld/MachO/ICF.cpp +++ b/lld/MachO/ICF.cpp @@ -443,7 +443,9 @@ void macho::foldIdenticalSections() { /*relocVA=*/0); isec->data = copy; } - } else { + } else if (!isEhFrameSection(isec)) { + // EH frames are gathered as hashables from unwindEntry above; give a + // unique ID to everything else. isec->icfEqClass[0] = ++icfUniqueID; } } Differential Revision: https://reviews.llvm.org/D123435 | 3 年前 | |
[lld/mac] Warn that writing zippered outputs isn't implemented A "zippered" dylib contains several LC_BUILD_VERSION load commands, usually one each for "normal" macOS and one for macCatalyst. These are usually created by passing something like -shared -target arm64-apple-macos -darwin-target-variant arm64-apple-ios13.1-macabi to clang, which turns it into -platform_version macos 12.0.0 12.3 -platform_version "mac catalyst" 14.0.0 15.4 for the linker. ld64.lld can read these files fine, but it can't write them. Before this change, it would just silently use the last -platform_version flag and ignore the rest. This change adds a warning that writing zippered dylibs isn't implemented yet instead. Sadly, parts of ld64.lld's test suite relied on the previous "silently use last flag" semantics for its test suite: %lld always expanded to ld64.lld -platform_version macos 10.15 11.0 and tests that wanted a different value passed a 2nd -platform_version flag later on. But this now produces a warning if the platform passed to -platform_version is not macos. There weren't very many cases of this, so move these to use %no-arg-lld and manually pass -arch. Differential Revision: https://reviews.llvm.org/D124106 | 4 年前 | |
[lld/mac] Warn that writing zippered outputs isn't implemented A "zippered" dylib contains several LC_BUILD_VERSION load commands, usually one each for "normal" macOS and one for macCatalyst. These are usually created by passing something like -shared -target arm64-apple-macos -darwin-target-variant arm64-apple-ios13.1-macabi to clang, which turns it into -platform_version macos 12.0.0 12.3 -platform_version "mac catalyst" 14.0.0 15.4 for the linker. ld64.lld can read these files fine, but it can't write them. Before this change, it would just silently use the last -platform_version flag and ignore the rest. This change adds a warning that writing zippered dylibs isn't implemented yet instead. Sadly, parts of ld64.lld's test suite relied on the previous "silently use last flag" semantics for its test suite: %lld always expanded to ld64.lld -platform_version macos 10.15 11.0 and tests that wanted a different value passed a 2nd -platform_version flag later on. But this now produces a warning if the platform passed to -platform_version is not macos. There weren't very many cases of this, so move these to use %no-arg-lld and manually pass -arch. Differential Revision: https://reviews.llvm.org/D124106 | 4 年前 | |
[lld-macho] Always include custom syslibroot when running tests This greatly reduces the amount of boilerplate in our tests. Reviewed By: #lld-macho, compnerd Differential Revision: https://reviews.llvm.org/D87960 | 5 年前 | |
[lld-macho] Always include custom syslibroot when running tests This greatly reduces the amount of boilerplate in our tests. Reviewed By: #lld-macho, compnerd Differential Revision: https://reviews.llvm.org/D87960 | 5 年前 | |
[lld-macho] Always include custom syslibroot when running tests This greatly reduces the amount of boilerplate in our tests. Reviewed By: #lld-macho, compnerd Differential Revision: https://reviews.llvm.org/D87960 | 5 年前 | |
[lld-macho] Initial support for Linker Optimization Hints Linker optimization hints mark a sequence of instructions used for synthesizing an address, like ADRP+ADD. If the referenced symbol ends up close enough, it can be replaced by a faster sequence of instructions like ADR+NOP. This commit adds support for 2 of the 7 defined ARM64 optimization hints: - LOH_ARM64_ADRP_ADD, which transforms a pair of ADRP+ADD into ADR+NOP if the referenced address is within +/- 1 MiB - LOH_ARM64_ADRP_ADRP, which transforms two ADRP instructions into ADR+NOP if they reference the same page These two kinds already cover more than 50% of all LOHs in chromium_framework. Differential Review: https://reviews.llvm.org/D128093 | 3 年前 | |
[lld-macho] Handle filename being passed in -lto_object_path Clang passes a filename rather than a directory in -lto_object_path when using FullLTO. Previously, it was always treated it as a directory, so lld would crash when it attempted to create temporary files inside it. Fixes #54805 Differential Revision: https://reviews.llvm.org/D129705 | 3 年前 | |
[lld-macho] Have tests default to targeting macos 10.15 D101114 enforced proper version checks, which exposed a variety of version mismatch issues in our tests. We previously changed the test inputs to target 10.0, which was the simpler thing to do, but we should really just have our lit.local.cfg default to targeting 10.15, which is what is done here. We're not likely to ever have proper support for the older versions anyway, as that would require more work for unclear benefit; for instance, llvm-mc seems to generate a different compact unwind format for older macOS versions, which would cause our compact-unwind.s test to fail. Targeting 10.15 by default causes the following behavioral changes: * __mh_execute_header is now a section symbol instead of an absolute symbol * LC_BUILD_VERSION gets emitted instead of LC_VERSION_MIN_MACOSX. The former is 32 bytes in size whereas the latter is 16 bytes, so a bunch of hardcoded address offsets in our tests had to be updated. * >= 10.6 executables are PIE by default Note that this diff was stacked atop of a local revert of most of the test changes in rG8c17a875150f8e736e8f9061ddf084397f45f4c5, to make review easier. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D101119 | 5 年前 | |
[lld-macho] Have tests default to targeting macos 10.15 D101114 enforced proper version checks, which exposed a variety of version mismatch issues in our tests. We previously changed the test inputs to target 10.0, which was the simpler thing to do, but we should really just have our lit.local.cfg default to targeting 10.15, which is what is done here. We're not likely to ever have proper support for the older versions anyway, as that would require more work for unclear benefit; for instance, llvm-mc seems to generate a different compact unwind format for older macOS versions, which would cause our compact-unwind.s test to fail. Targeting 10.15 by default causes the following behavioral changes: * __mh_execute_header is now a section symbol instead of an absolute symbol * LC_BUILD_VERSION gets emitted instead of LC_VERSION_MIN_MACOSX. The former is 32 bytes in size whereas the latter is 16 bytes, so a bunch of hardcoded address offsets in our tests had to be updated. * >= 10.6 executables are PIE by default Note that this diff was stacked atop of a local revert of most of the test changes in rG8c17a875150f8e736e8f9061ddf084397f45f4c5, to make review easier. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D101119 | 5 年前 | |
[lld-macho] Fix crash on invalid framework tbd Previously these would crash because file is null in the case there is an invalid tbd file. Differential Revision: https://reviews.llvm.org/D124271 | 4 年前 | |
[lld] Add test suite mode for running LLD main twice LLD_IN_TEST determines how many times each port's main function is run in each LLD process, and setting LLD_IN_TEST=2 (or higher) is useful for checking if we're cleaning up and resetting global state correctly. Add a test suite parameter to enable this easily. There's work in progress to remove global state (e.g. D108850), but this seems useful in the interim. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D112898 | 4 年前 | |
[lld-macho] Always include custom syslibroot when running tests This greatly reduces the amount of boilerplate in our tests. Reviewed By: #lld-macho, compnerd Differential Revision: https://reviews.llvm.org/D87960 | 5 年前 | |
[test] Use host platform specific error message substitution in lit tests On z/OS, the following error message is not matched correctly in lit tests. EDC5129I No such file or directory. This patch uses a lit config substitution to check for platform specific error messages. Reviewed By: muiez, jhenderson Differential Revision: https://reviews.llvm.org/D95246 | 5 年前 | |
[lld-macho] Always include custom syslibroot when running tests This greatly reduces the amount of boilerplate in our tests. Reviewed By: #lld-macho, compnerd Differential Revision: https://reviews.llvm.org/D87960 | 5 年前 | |
[lld-macho] Initial groundwork for -bitcode_bundle This diff creates an empty XAR file and copies it into __LLVM,__bundle. Follow-up work will actually populate the contents of that XAR. Reviewed By: #lld-macho, gkm Differential Revision: https://reviews.llvm.org/D100650 | 5 年前 | |
[lld-macho] Always include custom syslibroot when running tests This greatly reduces the amount of boilerplate in our tests. Reviewed By: #lld-macho, compnerd Differential Revision: https://reviews.llvm.org/D87960 | 5 年前 | |
[lld-macho] Basic support for linkage and visibility attributes in LTO When parsing bitcode, convert LTO Symbols to LLD Symbols in order to perform resolution. The "winning" symbol will then be marked as Prevailing at LTO compilation time. This is similar to what the other LLD ports do. This change allows us to handle linkonce symbols correctly, and to deal with duplicate bitcode symbols gracefully. Previously, both scenarios would result in an assertion failure inside the LTO code, complaining that multiple Prevailing definitions are not allowed. While at it, I also added basic logic around visibility. We don't do anything useful with it yet, but we do check that its value is valid. LLD-ELF appears to use it only to set FinalDefinitionInLinkageUnit for LTO, which I think is just a performance optimization. From my local experimentation, the linker itself doesn't seem to do anything differently when encountering linkonce / linkonce_odr / weak / weak_odr. So I've only written a test for one of them. LLD-ELF has more, but they seem to mostly be testing the intermediate bitcode output of their LTO backend...? I'm far from an expert here though, so I might very well be missing things. Reviewed By: #lld-macho, MaskRay, smeenai Differential Revision: https://reviews.llvm.org/D94342 | 5 年前 | |
[lld-macho] Fix symbol name returned from InputSection::getLocation This commit fixes the issue that getLocation always printed the name of the first symbol in the section. For clarity, upper_bound is used instead of a linear search for finding the closest symbol name. Note that this change does not affect performance: this function is only called when printing errors and symbols typically contains a single symbol because of .subsections_via_symbols. Differential Revision: https://reviews.llvm.org/D127670 | 3 年前 | |
[lld] Add test suite mode for running LLD main twice LLD_IN_TEST determines how many times each port's main function is run in each LLD process, and setting LLD_IN_TEST=2 (or higher) is useful for checking if we're cleaning up and resetting global state correctly. Add a test suite parameter to enable this easily. There's work in progress to remove global state (e.g. D108850), but this seems useful in the interim. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D112898 | 4 年前 | |
[lld-macho][nfc] Centralize usages of ld64.lld in tests We have a mix of substituted lld ( %lld) and hard-coded lld (ld64.lld) commands. When testing with different versions of LLD, this would require going into every place where lld is hard-coded and changing that. If we centralize it, this'll only require us to modify it in only one place and will make it easy to run the same test suite. Plus, this will make it be consistent with how we write other tests. Reviewed By: #lld-macho, int3, oontvoo Differential Revision: https://reviews.llvm.org/D119394 | 4 年前 | |
Reland "[lld-macho] Show source information for undefined references" The error used to look like this: ld64.lld: error: undefined symbol: _foo >>> referenced by /path/to/bar.o:(symbol _baz+0x4) If DWARF line information is available, we now show where in the source the references are coming from: ld64.lld: error: unreferenced symbol: _foo >>> referenced by: bar.cpp:42 (/path/to/bar.cpp:42) >>> /path/to/bar.o:(symbol _baz+0x4) The reland is identical to the first time this landed. The fix was in D128294. This reverts commit 0cc7ad417585b3185c32e395cc5e6cf082a347af. Differential Revision: https://reviews.llvm.org/D128184 | 3 年前 | |
Reland "[lld-macho] Group undefined symbol diagnostics by symbol". This reverts commit 36e7c9a450db5e22af1ec21412d918ceb2313942. This relands d61341768cf0cff7c with the fix described in https://reviews.llvm.org/D127753#3587390 | 3 年前 | |
[lld-macho] Demangle location name in undefined symbol diagnostics If the -demangle flag is passed to lld, symbol names will now be demangled in the "referenced by:" message in addition to the referenced symbol's name, which was already demangled before this change. Differential Revision: https://reviews.llvm.org/D130490 | 3 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 |