| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
[lld][macho] Error out gracefully when offset is outside literal section (#164660) We typically shouldn't get this, but when we do (e.g. in #139439) we should error out gracefully instead of crashing. Note that we are stricter than ld64 here; ld64 appears to be able to handle section offsets that point outside literal sections if the end result is a valid pointer to another section in the input object file. Supporting this would probably be a pain given our current design, and it seems like enough of an edge case that it's onot worth it. | 8 个月前 | |
[lld] Fix invalid Python escape sequences (#94033) | 1 年前 | |
[lld-macho][nfc] Clean up tests * Remove unnecessary rm -rf %ts * Have lc-linker-option.ll use the right comment marker | 5 年前 | |
[lld-macho] Do not error out on dead stripped duplicate symbols Builds that error out on duplicate symbols can still succeed if the symbols will be dead stripped. Currently, this is the current behavior in ld64. https://github.com/apple-oss-distributions/ld64/blob/main/src/ld/Resolver.cpp#L2018. In order to provide an easier to path for adoption, introduce a new flag that will retain compatibility with ld64's behavior (similar to --deduplicate-literals). This is turned off by default since we do not encourage this behavior in the linker. Reviewed By: #lld-macho, thakis, int3 Differential Revision: https://reviews.llvm.org/D134794 | 3 年前 | |
[lld-macho][nfc] Extend abs-symbol.s to test for local absolute symbols Addresses an old TODO. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D100082 | 5 年前 | |
[lld-macho] Support -add_ast_path Swift builds seem to use it. All it requires is emitting the corresponding paths as STABS. Fixes llvm.org/PR49385. Reviewed By: clayborg Differential Revision: https://reviews.llvm.org/D100076 | 5 年前 | |
[lld-macho][test] Add -lSystem to all lld invocations This is a requirement from ld64, so this mirrors that expectation. Most of these changes were just offsets from adding the library, or adding dyld_stub_binder which is always added when linking ld64. This also adds %no-lsystem-lld for the few cases where we're explicitly testing things without that. Fixes: https://github.com/llvm/llvm-project/issues/54184 Differential Revision: https://reviews.llvm.org/D135193 | 3 年前 | |
[lld-macho]Use install_name as Identifier for code-sign, if available. Detail: LD64 uses the name provided via -[dylib]install_name as "Identifier", when available. For compatiblity, LLD should do that too. Differential Revision: https://reviews.llvm.org/D155508 | 2 年前 | |
[lld-macho] Mark aliased symbols as noDeadStrip This matches ld64 behavior Differential Revision: https://reviews.llvm.org/D135082 | 3 年前 | |
[llvm][Object] set SF_Hidden flag for MachO files Reviewed By: pete, ributzka Differential Revision: https://reviews.llvm.org/D139862 | 3 年前 | |
| 1 年前 | ||
[lld/mac] Fix application-extension.s failure after 8e8701abca3d4 The test accidentally tested something else that makes lld fail with a different (correct-looking) error that wasn't the one the test tries to test for. (The test case before this change makes ld64 hang in an infinite loop.) | 4 年前 | |
[lld/mac] Implement -arch_multiple This is the other flag clang passes when calling clang with two -arch flags (which means with this, clang -arch x86_64 -arch arm64 -fuse-ld=lld ... now no longer prints any warnings \o/). Since clang calls the linker several times in that setup, it's not clear to the user from which invocation the errors are. The flag's help text is Specifies that the linker should augment error and warning messages with the architecture name. In ld64, the only effect of the flag is that undefined symbols are prefaced with Undefined symbols for architecture x86_64: instead of the usual "Undefined symbols:". So for now, let's add this only to undefined symbol errors too. That's probably the most common linker diagnostic. Another idea would be to prefix errors and warnings with "ld64.lld(x86_64):" instead of the usual "ld64.lld:", but I'm not sure if people would misunderstand that as a comment about the arch of ld itself. But open to suggestions on what effect this flag should have :) And we don't have to get it perfect now, we can iterate on it. Differential Revision: https://reviews.llvm.org/D105450 | 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] Support archives without index (#132942) This is a ~port of https://reviews.llvm.org/D117284. Like in that change, archives without indices are treated as a collection of lazy object files (as in --start-lib/--end-lib) Porting the ELF follow-up to convert *all* archives to the lazy object code path (https://reviews.llvm.org/D119074) is a natural next step, but we would need to ensure the assertions about memory use hold for Mach-O. NB: without an index, we can't do the part of the -ObjC scan where we check for Objective-C symbols directly. We *can* still check for __obcj sections so I wonder how much of a problem this actually is, since I'm not sure how the "symbols but no sections" case can appear in the wild. | 1 年前 | |
[lld-macho] Support archives without index (#132942) This is a ~port of https://reviews.llvm.org/D117284. Like in that change, archives without indices are treated as a collection of lazy object files (as in --start-lib/--end-lib) Porting the ELF follow-up to convert *all* archives to the lazy object code path (https://reviews.llvm.org/D119074) is a natural next step, but we would need to ensure the assertions about memory use hold for Mach-O. NB: without an index, we can't do the part of the -ObjC scan where we check for Objective-C symbols directly. We *can* still check for __obcj sections so I wonder how much of a problem this actually is, since I'm not sure how the "symbols but no sections" case can appear in the wild. | 1 年前 | |
[lld-macho][nfc] Rename some tests for consistency Now all the tests that cover symbol resolution / precedence have "resolution" in their filename. I also added a couple of extra comments. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D120938 | 4 年前 | |
[lld-macho] Implement -noall_load This flag is the default, so in ld64 it is not implemented, but it can be useful to negate previous -all_load arguments. Specifically if your build system has some global linker flags, that you may want to negate for specific links. We use something like this today to make sure some C++ symbols are automatically discovered for all links, which passing -all_load hides. Differential Revision: https://reviews.llvm.org/D117629 | 4 年前 | |
[lld-macho][test] Add -lSystem to all lld invocations This is a requirement from ld64, so this mirrors that expectation. Most of these changes were just offsets from adding the library, or adding dyld_stub_binder which is always added when linking ld64. This also adds %no-lsystem-lld for the few cases where we're explicitly testing things without that. Fixes: https://github.com/llvm/llvm-project/issues/54184 Differential Revision: https://reviews.llvm.org/D135193 | 3 年前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
Reapply "[lld] enable fixup chains by default (#79894)" (#99255) This reverts commit f55b79f59a77b4be586d649e9ced9f8667265011. The known issues with chained fixups have been addressed by #98913, #98305, #97156 and #95171. Compared to the original commit, support for xrOS (which postdates chained fixups' introduction) was added and an unnecessary test change was removed. ---------- Original commit message: Enable chained fixups in lld when all platform and version criteria are met. This is an attempt at simplifying the logic used in ld 907: https://github.com/apple-oss-distributions/ld64/blob/93d74eafc37c0558b4ffb88a8bc15c17bed44a20/src/ld/Options.cpp#L5458-L5549 Some changes were made to simplify the logic: - only enable chained fixups for macOS from 13.0 to avoid the arch check - only enable chained fixups for iphonesimulator from 16.0 to avoid the arch check - don't enable chained fixups for not specifically listed platforms - don't enable chained fixups for arm64_32 | 1 年前 | |
[lld-macho] Handle user-provided dtrace symbols to avoid linking failure This fixes https://github.com/llvm/llvm-project/issues/56238. ld64.lld currently does not generate __dof section in Mach-O, and -no_dtrace_dof option is on by default. However when there are user-defined dtrace symbols, ld64.lld will treat them as undefined symbols, which causes the linking to fail because lld cannot find their definitions. This patch allows ld64.lld to rewrite the instructions calling dtrace symbols to instructions like nop as what ld64 does; therefore, when encountered with user-provided dtrace probes, the linking can still succeed. I'm not sure whether support for dtrace is expected in lld, so for now I didn't add codes to make lld emit __dof section like ld64, and only made it possible to link with dtrace symbols provided. If this feature is needed, I can add that part in Dtrace.cpp & Dtrace.h. Reviewed By: int3, #lld-macho Differential Revision: https://reviews.llvm.org/D129062 | 3 年前 | |
[lld-macho] dead-strip objc stubs (#79726) This supports dead-strip for objc stubs. | 2 年前 | |
[lld-macho][arm64] implement -objc_stubs_small (#78665) This patch implements -objc_stubs_small targeting arm64, aiming to align with ld64's behavior. 1. -objc_stubs_fast: As previously implemented, this always uses the Global Offset Table (GOT) to invoke objc_msgSend. The alignment of the objc stub is 32 bytes. 2. -objc_stubs_small: This behavior depends on whether objc_msgSend is defined. If it is, it directly jumps to objc_msgSend. If not, it creates another stub to indirectly jump to objc_msgSend, minimizing the size. The alignment of the objc stub in this case is 4 bytes. | 2 年前 | |
[lld-macho] Fix for objc_msgSend stubs (#78557) This commit corrects the address computation for objc_msgSend stubs. Previously, the address computation was incidentally correct due to objc_msgSend often being the first entry in the got section, resulting in a 0 index. This commit ensures accurate address computation regardless of the objc_msgSend stub's position in the got section. | 2 年前 | |
[lld-macho] Fix code section ordering in output binary (#134010) In OutputSegment.cpp, we need to ensure a specific order for certain sections. The current sorting logic incorrectly prioritizes code sections over explicitly defined section orders. This is problematic because the __objc_stubs section is both a code section *and* has a specific ordering requirement. The current logic would incorrectly prioritize its code section status, causing it to be sorted *before* the __stubs section. This incorrect ordering breaks the branch extension algorithm, ultimately leading to linker failures due to relocation errors. We also modify the lld/test/MachO/arm64-objc-stubs.s test to ensure correct section ordering. | 1 年前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
[lld-macho] Mark local personality functions as INDIRECT_SYMBOL_LOCAL (#95171) This expands on the fix in 4e572db. The issue is pretty similar: we might put symbols in the GOT which don't need run-time binding, locally defined personality symbols in this case. We should set their indirect symbol table entries to INDIRECT_SYMBOL_LOCAL to help strip remove these local names from the symbol table. Checking if the symbol is private-extern doesn't cover all cases; it can also be a non-weak extern function too, for instance; use the needsBinding() helper to determine it. This was the case for the personality function in statically linked Rust executables. The extra non-LOCAL symbols triggered a bug in Apple's strip implementation. As the indirect value for the personality function was not set to the flag, but the symbol didn't require binding, it tried to make the symbol local, overwriting the GOT entry with the function's address in the process. This normally wouldn't be a problem, but if chained fixups are used, the fixup also encodes the offset to the next fixup, and it effectively zeroed this offset out, causing the remaining relocations on the page to not be performed by dyld. This caused the crash in https://issues.chromium.org/issues/325410295 The change in tests is a bit ugly, as a lot of symbol information is now removed by turning more symbols LOCAL. | 2 年前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
Reapply "[lld] enable fixup chains by default (#79894)" (#99255) This reverts commit f55b79f59a77b4be586d649e9ced9f8667265011. The known issues with chained fixups have been addressed by #98913, #98305, #97156 and #95171. Compared to the original commit, support for xrOS (which postdates chained fixups' introduction) was added and an unnecessary test change was removed. ---------- Original commit message: Enable chained fixups in lld when all platform and version criteria are met. This is an attempt at simplifying the logic used in ld 907: https://github.com/apple-oss-distributions/ld64/blob/93d74eafc37c0558b4ffb88a8bc15c17bed44a20/src/ld/Options.cpp#L5458-L5549 Some changes were made to simplify the logic: - only enable chained fixups for macOS from 13.0 to avoid the arch check - only enable chained fixups for iphonesimulator from 16.0 to avoid the arch check - don't enable chained fixups for not specifically listed platforms - don't enable chained fixups for arm64_32 | 1 年前 | |
[lld-macho] Account for alignment in thunk insertion algorithm We previously neglected this, leading us to underestimate the maximum possible branch address offset. Fixing this should allow us to reduce slop to more reasonable levels. I've lowered it to 256 for now, though I suspect we could go lower. Fixes https://github.com/llvm/llvm-project/issues/59259. Reviewed By: serge-sans-paille Differential Revision: https://reviews.llvm.org/D144029 | 3 年前 | |
[lld/mac] Give range extension thunks for local symbols local visibility When two local symbols (think: file-scope static functions, or functions in unnamed namespaces) with the same name in two different translation units both needed thunks, ld64.lld previously created external thunks for both of them. These thunks ended up with the same name, leading to a duplicate symbol error for the thunk symbols. Instead, give thunks for local symbols local visibility. (Hitting this requires a jump to a local symbol from over 128 MiB away. It's unlikely that a single .o file is 128 MiB large, but with ICF you can end up with a situation where the local symbol is ICF'd with a symbol in a separate translation unit. And that can introduce a large enough jump to require a thunk.) Fixes PR54599. Differential Revision: https://reviews.llvm.org/D122624 | 4 年前 | |
[lld/mac] Tweak a few comments Addresses review feedback I had missed on https://reviews.llvm.org/D122624 No behavior change. Differential Revision: https://reviews.llvm.org/D122904 | 4 年前 | |
[lld-macho] Fix branch extension logic compatibility with __objc_stubs (#137913) Enhance branch extension logic to handle __objc_stubs identically to __stubs The branch extension algorithm currently has specific handling for the __stubs section: 1. It ensures all __stubs content is directly reachable via branches from the text section. 2. It calculates the latest text section address that might require thunks to reach the end of __stubs. The __objc_stubs section requires precisely the same handling due to its similar nature, but this was not implemented. This commit generalizes the existing logic so it applies consistently to both the __stubs and __objc_stubs sections, ensuring correct reachability and thunk placement for both. Without this change it's possible to get relocation errors during linking in scenarios where the __objc_stubs section is large enough. | 1 年前 | |
[lld-macho][test] Add -lSystem to all lld invocations This is a requirement from ld64, so this mirrors that expectation. Most of these changes were just offsets from adding the library, or adding dyld_stub_binder which is always added when linking ld64. This also adds %no-lsystem-lld for the few cases where we're explicitly testing things without that. Fixes: https://github.com/llvm/llvm-project/issues/54184 Differential Revision: https://reviews.llvm.org/D135193 | 3 年前 | |
[lld][MachO] Allow separate --irpgo-profile flag (#121354) | 1 年前 | |
| 1 年前 | ||
[lld][macho] Ignore cstrings in bp orderer (#165757) | 8 个月前 | |
[lld-macho] Ensure segments are laid out contiguously codesign/libstuff checks that the __LLVM segment is directly before __LINKEDIT by checking that fileOff + fileSize == next segment fileOff. Previously, there would be gaps between the segments due to the fact that their fileOffs are page-aligned but their fileSizes aren't. In order to satisfy codesign, we page-align fileOff *before* calculating fileSize. (I don't think codesign checks for the relative ordering of other segments, so in theory we could do this just for __LLVM, but ld64 seems to do it for all segments.) Note that we *don't* round up the fileSize of the __LINKEDIT segment. Since it's the last segment, it doesn't need to worry about contiguity; in addition, codesign checks that the last (hidden) section in __LINKEDIT covers the last byte of the segment, so if we rounded up __LINKEDIT's size we would have to do the same for its last section, which is a bother. While at it, I also addressed a FIXME in the linkedit-contiguity.s test to cover more __LINKEDIT sections. Reviewed By: #lld-macho, thakis, alexshap Differential Revision: https://reviews.llvm.org/D100848 | 5 年前 | |
[lld-macho] Set the SG_READ_ONLY flag on __DATA_CONST This flag instructs dyld to make the segment read-only after fixups have been performed. I'm not sure why this flag is needed, as on macOS 13 beta at least, __DATA_CONST is read-only even without this flag; but ld64 sets it as well. Differential Revision: https://reviews.llvm.org/D133010 | 3 年前 | |
[lld-macho] Don't reference entry symbol for non-executables This would cause us to pull in symbols (and code) that should be unused. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D102137 | 5 年前 | |
[lld-macho] Implement symbol string deduplication (#123874) The symbol string table does not have deduplication. Here we add code to deduplicate the symbol string table. This has a rather large size impact (20-30%) on unstripped binaries (typically debug binaries) but no size impact on stripped binaries(typically release binaries). We enable deduplication by default and add a flag to disable it ( -no-deduplicate-symbol-strings). | 1 年前 | |
[lld] Update cgdata-* tests to not use subshells Subshells are not supported in the lit internal shell. We can remove them by constructing sed commands directly inside of a separate file. Towards #102700. Reviewers: ilovepi, MaskRay, petrhosek, mysterymath, cmtice, kyulee-com Reviewed By: MaskRay, cmtice, petrhosek Pull Request: https://github.com/llvm/llvm-project/pull/156533 | 10 个月前 | |
[lld] Update cgdata-* tests to not use subshells Subshells are not supported in the lit internal shell. We can remove them by constructing sed commands directly inside of a separate file. Towards #102700. Reviewers: ilovepi, MaskRay, petrhosek, mysterymath, cmtice, kyulee-com Reviewed By: MaskRay, cmtice, petrhosek Pull Request: https://github.com/llvm/llvm-project/pull/156533 | 10 个月前 | |
[lld-macho][nfc] Avoid using absolute addresses in cgprofile-icf.s If we fix https://github.com/llvm/llvm-project/issues/54184, the dyld_stub_binder symbol will get included in every output dylib. This would cause the addresses of the other symbols to shift, breaking the test as it currently stands. Let's make the test more flexible. Reviewed By: lgrey Differential Revision: https://reviews.llvm.org/D120940 | 4 年前 | |
[lld-macho] Port CallGraphSort from COFF/ELF Depends on D112160 This adds the new options --call-graph-profile-sort (default), --no-call-graph-profile-sort and --print-symbol-order=. If call graph profile sorting is enabled, reads __LLVM,__cg_profile sections from object files and uses the resulting graph to put callees and callers close to each other in the final binary via the C3 clustering heuristic. Differential Revision: https://reviews.llvm.org/D112164 | 4 年前 | |
[lld-macho] Allow order files and call graph sorting to be used together If both an order file and a call graph profile are present, the edges of the call graph which use symbols present in the order file are not used. All of the symbols in the order file will appear at the beginning of the section just as they do currently. In other words, the highest priority derived from the call graph will be below the lowest priority derived from the order file. Practically, this change renames CallGraphSort.{h,cpp} to SectionPriorities.{h,cpp}, and most order file and call graph profile related code is moved into the new file to reduce duplication. Differential Revision: https://reviews.llvm.org/D117354 | 4 年前 | |
[lld-macho] Port CallGraphSort from COFF/ELF Depends on D112160 This adds the new options --call-graph-profile-sort (default), --no-call-graph-profile-sort and --print-symbol-order=. If call graph profile sorting is enabled, reads __LLVM,__cg_profile sections from object files and uses the resulting graph to put callees and callers close to each other in the final binary via the C3 clustering heuristic. Differential Revision: https://reviews.llvm.org/D112164 | 4 年前 | |
[lld-macho] Add support for emitting chained fixups This commit adds support for chained fixups, which were introduced in Apple's late 2020 OS releases. This format replaces the dyld opcodes used for supplying rebase and binding information, and encodes most of that data directly in the memory location that will have the fixup applied. This reduces binary size and is a requirement for page-in linking, which will be available starting with macOS 13. A high-level overview of the format and my implementation can be found in SyntheticSections.h. This feature is currently gated behind the -fixup_chains flag, and will be enabled by default for supported targets in a later commit. Like in ld64, lazy binding is disabled when chained fixups are in use, and the -init_offsets transformation is performed by default. Differential Revision: https://reviews.llvm.org/D132560 | 3 年前 | |
[lld-macho] Add support for emitting chained fixups This commit adds support for chained fixups, which were introduced in Apple's late 2020 OS releases. This format replaces the dyld opcodes used for supplying rebase and binding information, and encodes most of that data directly in the memory location that will have the fixup applied. This reduces binary size and is a requirement for page-in linking, which will be available starting with macOS 13. A high-level overview of the format and my implementation can be found in SyntheticSections.h. This feature is currently gated behind the -fixup_chains flag, and will be enabled by default for supported targets in a later commit. Like in ld64, lazy binding is disabled when chained fixups are in use, and the -init_offsets transformation is performed by default. Differential Revision: https://reviews.llvm.org/D132560 | 3 年前 | |
[lld] Remove shell requirements from tests These tests all pass inside the lit internal shell. A couple were marked as requiring a shell to exclude them on Windows. Update those tests to explicitly carve out Windows rather than any configuration that does not provide the shell feature. Towards #102700. Reviewers: petrhosek, cmtice, mysterymath, MaskRay, ilovepi Reviewed By: cmtice Pull Request: https://github.com/llvm/llvm-project/pull/156510 | 10 个月前 | |
[lld-macho][nfc] Simplify common-symbol-coalescing test | 4 年前 | |
[lld-macho][nfc] Fix test to reflect that symbol attributes don't matter within an archive We had a comment that claimed that defined symbols had priority over common symbols if they occurred in the same archive. In fact, they appear to have equal precedence. Our implementation already does this, so I'm just updating the test comment. Also added a few other test comments along the way for readability. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D106595 | 4 年前 | |
[lld-macho] Mark local personality functions as INDIRECT_SYMBOL_LOCAL (#95171) This expands on the fix in 4e572db. The issue is pretty similar: we might put symbols in the GOT which don't need run-time binding, locally defined personality symbols in this case. We should set their indirect symbol table entries to INDIRECT_SYMBOL_LOCAL to help strip remove these local names from the symbol table. Checking if the symbol is private-extern doesn't cover all cases; it can also be a non-weak extern function too, for instance; use the needsBinding() helper to determine it. This was the case for the personality function in statically linked Rust executables. The extra non-LOCAL symbols triggered a bug in Apple's strip implementation. As the indirect value for the personality function was not set to the flag, but the symbol didn't require binding, it tried to make the symbol local, overwriting the GOT entry with the function's address in the process. This normally wouldn't be a problem, but if chained fixups are used, the fixup also encodes the offset to the next fixup, and it effectively zeroed this offset out, causing the remaining relocations on the page to not be performed by dyld. This caused the crash in https://issues.chromium.org/issues/325410295 The change in tests is a bit ugly, as a lot of symbol information is now removed by turning more symbols LOCAL. | 2 年前 | |
[lld-macho] Fix bug in CUE folding that resulted in wrong unwind table. PR/59070 Differential Revision: https://reviews.llvm.org/D138320 | 3 年前 | |
Reland "D144999 [MC][MachO]Only emits compact-unwind format for "canonical" personality symbols. For the rest, use DWARFs." Reasons for rolling forward: - the crash reported from Chromium was fixed in D151824 (not related to this patch at all) - since D152824 was committed, it should now be safe to roll this forward. New change: - add an additional _ in name check This reverts commit 4980eead4d0b4666d53dad07afb091375b3a13a0. | 3 年前 | |
Reland "D144999 [MC][MachO]Only emits compact-unwind format for "canonical" personality symbols. For the rest, use DWARFs." Reasons for rolling forward: - the crash reported from Chromium was fixed in D151824 (not related to this patch at all) - since D152824 was committed, it should now be safe to roll this forward. New change: - add an additional _ in name check This reverts commit 4980eead4d0b4666d53dad07afb091375b3a13a0. | 3 年前 | |
Reland "D144999 [MC][MachO]Only emits compact-unwind format for "canonical" personality symbols. For the rest, use DWARFs." Reasons for rolling forward: - the crash reported from Chromium was fixed in D151824 (not related to this patch at all) - since D152824 was committed, it should now be safe to roll this forward. New change: - add an additional _ in name check This reverts commit 4980eead4d0b4666d53dad07afb091375b3a13a0. | 3 年前 | |
[lld-macho] Fix symbol relocs handling for LSDAs Similar to D113702, but for the LSDAs. Clang seems to emit all LSDA relocs as section relocs, but ld -r can turn those relocs into symbol ones. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D113721 | 4 年前 | |
[lld-macho] Mark local personality functions as INDIRECT_SYMBOL_LOCAL (#95171) This expands on the fix in 4e572db. The issue is pretty similar: we might put symbols in the GOT which don't need run-time binding, locally defined personality symbols in this case. We should set their indirect symbol table entries to INDIRECT_SYMBOL_LOCAL to help strip remove these local names from the symbol table. Checking if the symbol is private-extern doesn't cover all cases; it can also be a non-weak extern function too, for instance; use the needsBinding() helper to determine it. This was the case for the personality function in statically linked Rust executables. The extra non-LOCAL symbols triggered a bug in Apple's strip implementation. As the indirect value for the personality function was not set to the flag, but the symbol didn't require binding, it tried to make the symbol local, overwriting the GOT entry with the function's address in the process. This normally wouldn't be a problem, but if chained fixups are used, the fixup also encodes the offset to the next fixup, and it effectively zeroed this offset out, causing the remaining relocations on the page to not be performed by dyld. This caused the crash in https://issues.chromium.org/issues/325410295 The change in tests is a bit ugly, as a lot of symbol information is now removed by turning more symbols LOCAL. | 2 年前 | |
[lld] add context-sensitive PGO options for MachO Enable support for CSPGO for lld MachO targets. Since lld MachO does not support -plugin-opt=, we need to create the --cs-profile-generate and --cs-profile-path= options and propagate them in Darwin.cpp. These flags are not supported by ld64. Also outline code into getLastCSProfileGenerateArg() to share between CommonArgs.cpp and Darwin.cpp. CSPGO is already implemented for ELF (https://reviews.llvm.org/D56675) and COFF (https://reviews.llvm.org/D98763). Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D151589 | 3 年前 | |
[lld] add context-sensitive PGO options for MachO Enable support for CSPGO for lld MachO targets. Since lld MachO does not support -plugin-opt=, we need to create the --cs-profile-generate and --cs-profile-path= options and propagate them in Darwin.cpp. These flags are not supported by ld64. Also outline code into getLastCSProfileGenerateArg() to share between CommonArgs.cpp and Darwin.cpp. CSPGO is already implemented for ELF (https://reviews.llvm.org/D56675) and COFF (https://reviews.llvm.org/D98763). Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D151589 | 3 年前 | |
[lld-macho] Flip string deduplication default Previously by default, when not using --ifc=, lld would not deduplicate string literals. This reveals reliance on undefined behavior where string literal addresses are compared instead of using string equality checks. While ideally you would be able to easily identify and eliminate the reliance on this UB, this can be difficult, especially for third party code, and increases the friction and risk of users migrating to lld. This flips the default to deduplicate strings unless --no-deduplicate-strings is passed, matching ld64's behavior. Differential Revision: https://reviews.llvm.org/D140517 | 3 年前 | |
[lld-macho] Flip string deduplication default Previously by default, when not using --ifc=, lld would not deduplicate string literals. This reveals reliance on undefined behavior where string literal addresses are compared instead of using string equality checks. While ideally you would be able to easily identify and eliminate the reliance on this UB, this can be difficult, especially for third party code, and increases the friction and risk of users migrating to lld. This flips the default to deduplicate strings unless --no-deduplicate-strings is passed, matching ld64's behavior. Differential Revision: https://reviews.llvm.org/D140517 | 3 年前 | |
[lld][MachO] Tail merge strings (#161262) Add the flag --tail-merge-strings to enable tail merging of cstrings. For example, if we have strings mystring\0 and ring\0, we could place mystring\0 at address 0x1000 and ring\0 at address 0x1004 and have them share the same underlying data. It turns out that many ObjC method names can be tail merged. For example, error: and doFoo:error:. On a large iOS binary, we saw nearly a 15% size improvement in the __TEXT__objc_methname section and negligible impact on link time. $ bloaty --domain=vm merged.o.stripped -- base.o.stripped VM SIZE -------------- +95% +5.85Ki [__TEXT] -2.4% -239Ki __TEXT,__cstring -14.5% -710Ki __TEXT,__objc_methname -1.0% -944Ki TOTAL Tail merging for MachO was originally removed in https://github.com/llvm/llvm-project/commit/7c269db779ff3950bac2e25ea78b14b4e2b8b247. The previous implementation used StringTableBuilder, but that was removed in https://github.com/llvm/llvm-project/commit/4308f031cd0c679c539914608134b9c8046743b3 to ensure deduplicated strings are aligned correctly. This implementation ensures that tail merged strings are also aligned correctly. Special thanks to nocchijiang for pointing this out in https://github.com/llvm/llvm-project/pull/158720#issuecomment-3310416030. Depends on https://github.com/llvm/llvm-project/pull/161253. | 9 个月前 | |
[lld][MachO] Tail merge strings (#161262) Add the flag --tail-merge-strings to enable tail merging of cstrings. For example, if we have strings mystring\0 and ring\0, we could place mystring\0 at address 0x1000 and ring\0 at address 0x1004 and have them share the same underlying data. It turns out that many ObjC method names can be tail merged. For example, error: and doFoo:error:. On a large iOS binary, we saw nearly a 15% size improvement in the __TEXT__objc_methname section and negligible impact on link time. $ bloaty --domain=vm merged.o.stripped -- base.o.stripped VM SIZE -------------- +95% +5.85Ki [__TEXT] -2.4% -239Ki __TEXT,__cstring -14.5% -710Ki __TEXT,__objc_methname -1.0% -944Ki TOTAL Tail merging for MachO was originally removed in https://github.com/llvm/llvm-project/commit/7c269db779ff3950bac2e25ea78b14b4e2b8b247. The previous implementation used StringTableBuilder, but that was removed in https://github.com/llvm/llvm-project/commit/4308f031cd0c679c539914608134b9c8046743b3 to ensure deduplicated strings are aligned correctly. This implementation ensures that tail merged strings are also aligned correctly. Special thanks to nocchijiang for pointing this out in https://github.com/llvm/llvm-project/pull/158720#issuecomment-3310416030. Depends on https://github.com/llvm/llvm-project/pull/161253. | 9 个月前 | |
[lld] Fix requires in cstring test (#160172) Fix a test added in https://github.com/llvm/llvm-project/pull/158720. I had accidentally required arm64 when the test was using x86_64. | 10 个月前 | |
[lld-macho] Sort data-in-code entries Previously, we would add entries to DataInCodeSection in the order they appeared in input files. Because of this, entries would not be sorted if sections were reordered due to e.g. -order_file or call graph profile sorting. ld64 always keeps data-in-code information sorted. This commit also fixes an incorrect assertion. The original assertion from D103006 used to check that data-in-code entries are sorted in the input objects -- likely because we use binary search on that data. In D115556, the assertion was moved into collectDataInCodeEntries, but the checked variable's name was not changed, so it ended up checking the final contents of the DataInCodeSection. We no longer crash when building LLVM with PGO using an asserts build of LLD as the linker. Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1265937 Numbers for linking the Chromium Framework reproducer from #48001, which has 6829 data-in-code entries: x before + after N Min Max Median Avg Stddev x 20 2.1076453 2.3059683 2.1132485 2.1350302 0.049905767 + 20 2.1069031 2.3915262 2.14465 2.1728429 0.084065898 No difference proven at 95.0% confidence Differential Revision: https://reviews.llvm.org/D133581 | 3 年前 | |
[lld/MachO] Fix assert on unsorted data-in-code entries (#81758) When the data-in-code entries are in separate sections, they are not guaranteed to be sorted. In particular, 68b1cc36f3df marked some libc++ string functions as noinline, which leads to global ctors involving strings now producing data-in-code sections in __TEXT,__StaticInit, which is why this now happens in practice. Since data-in-code entries are relatively rare and small, just sort them. No observed performance impact. See also crbug.com/41487860 | 2 年前 | |
[lld-macho] Preserve alignment for non-deduplicated cstrings Fixes PR50637. Downstream bug: https://crbug.com/1218958 Currently, we split __cstring along symbol boundaries with .subsections_via_symbols when not deduplicating, and along null bytes when deduplicating. This change splits along null bytes unconditionally, and preserves original alignment in the non- deduplicated case. Removing subsections-section-relocs.s because with this change, __cstring is never reordered based on the order file. Differential Revision: https://reviews.llvm.org/D104919 | 5 年前 | |
[lld/mac] Add a test for -reexport_library + -dead_strip_dylibs Our behavior here already matched ld64, now we have a test for it. (ld64 even strips the library here if you also pass -needed_library bar.dylib. That seems wrong to me, and lld honors needed_library in that case.) Differential Revision: https://reviews.llvm.org/D103812 | 5 年前 | |
[lld-macho] Omit __llvm_addrsig metadata from the output (#98913) This section contains metadata that's only relevant for Identical Code Folding at link time, we should not include it in the output. We still treat it like a regular section during input file parsing (e.g. create a ConcatInputSection for it), as we want its relocations to be parsed. But it should not be passed to addInputSection, as that's what assigns it to an OutputSection and adds it to the inputSections vector which specifies the inputs to dead-stripping and relocation scanning. This fixes a "__DATA,__llvm_addrsig, offset 0: fixups overlap" error when using --icf=safe alongside -fixup_chains. This occurs because all __llvm_addrsig sections are 8 bytes large, and the relocations which signify functions whose addresses are taken are all at offset 0. This makes the fix in 5fa24ac2 ("Category Merger: add support for addrsig references") obsolete, as we no longer try to resolve symbols referenced in __llvm_addrsig when writing the output file. When we do iterate its relocations in markAddrSigSymbols, we do not try to resolve their addresses. | 2 年前 | |
[nfc][lld-macho] Follow up fixes to bd9e46815d73e4236c207bad8b5c54e7188154d7 Need -DAG in the first expect statement too | 4 年前 | |
[lld-macho][nfc] Clean up tests * Remove unnecessary rm -rf %ts * Have lc-linker-option.ll use the right comment marker | 5 年前 | |
[lld-macho][test] Remove ld64.lld: prefix in a diagnostic The convention is not to check the prefix before error: . This gives flexibility if we need to rename ld64.lld to something else, (e.g. a while ago we used ld64.lld.darwinnew). | 4 年前 | |
[lld-macho] Fix assertion when two symbols at same addr have unwind info If there are multiple symbols at the same address, our unwind info implementation assumes that we always register unwind entries to a single canonical symbol. This assumption was violated by the registerEhFrame code. Fixes #56570. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D130208 | 3 年前 | |
[MachO] Use error instead of fatal for missing -arch fatal should only be used for malformed inputs according to ErrorHandler.h; error is more appropriate for missing arguments, accompanied by a check to bail out early in case of the error. Some tests need to be adjusted accordingly. Makes lld/test/MachO/arch.s pass with LLD_IN_TEST=2. Reviewed By: #lld-macho, int3 Differential Revision: https://reviews.llvm.org/D112879 | 4 年前 | |
[llvm-objdump] Print memory operand addresses as regular comments The patch reuses the common code to print memory operand addresses as instruction comments. This helps to align the comments and enables using target-specific comment markers when evaluateMemoryOperandAddress() is implemented for them. Differential Revision: https://reviews.llvm.org/D104861 | 5 年前 | |
[ADT] [lld-macho] Check for end iterator deref in filter_iterator_base If ld64.lld was supplied an object file that had a __debug_abbrev or __debug_str section, but didn't have any compile unit DIEs in __debug_info, it would dereference an iterator pointing to the empty array of DIEs. This underlying issue started causing segmentation faults when parsing for __debug_info was addded in D128184. That commit was reverted, and this one fixes the invalid dereference to allow relanding it. This commit adds an assertion to filter_iterator_base's dereference operators to catch bugs like this one. Ran check-llvm, check-clang and check-lld. Differential Revision: https://reviews.llvm.org/D128294 | 4 年前 | |
[lld-macho] Support -dyld_env This arg is undocumented but from looking at the code + experiment, it's used to add additional DYLD_ENVIRONMENT load commands to the output. Differential Revision: https://reviews.llvm.org/D134058 | 3 年前 | |
Reapply "[lld] enable fixup chains by default (#79894)" (#99255) This reverts commit f55b79f59a77b4be586d649e9ced9f8667265011. The known issues with chained fixups have been addressed by #98913, #98305, #97156 and #95171. Compared to the original commit, support for xrOS (which postdates chained fixups' introduction) was added and an unnecessary test change was removed. ---------- Original commit message: Enable chained fixups in lld when all platform and version criteria are met. This is an attempt at simplifying the logic used in ld 907: https://github.com/apple-oss-distributions/ld64/blob/93d74eafc37c0558b4ffb88a8bc15c17bed44a20/src/ld/Options.cpp#L5458-L5549 Some changes were made to simplify the logic: - only enable chained fixups for macOS from 13.0 to avoid the arch check - only enable chained fixups for iphonesimulator from 16.0 to avoid the arch check - don't enable chained fixups for not specifically listed platforms - don't enable chained fixups for arm64_32 | 1 年前 | |
[yaml2obj][MachO] Rename PayloadString to Content The new name is conciser and matches yaml2obj ELF & DWARF. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D106759 | 4 年前 | |
[mac/lld] simplify code using PackedVersion instead of VersionTuple PackedVersion already does the correct range checks. No behavior change. Differential Revision: https://reviews.llvm.org/D93338 | 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/mac] Make tbd files in one test valid No behavior change, but ld64 can't load .tbd files without the trailing ..., so include them to make it easier to run tests with l64 too. | 4 年前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
[MachO] Fix dead-stripping __eh_frame This section is marked S_ATTR_LIVE_SUPPORT in input files, which meant that on arm64, we were unnecessarily preserving FDEs if we e.g. had multiple weak definitions for a function. Worse, we would actually produce an invalid __eh_frame section in that case, because the CIE associated with the unnecessary FDE would still get dead-stripped and we'd end up with a dangling FDE. We set up associations from functions to their FDEs, so dead-stripping will just work naturally, and we can clear S_ATTR_LIVE_SUPPORT from our input __eh_frame sections to fix dead-stripping. Reviewed By: #lld-macho, int3 Differential Revision: https://reviews.llvm.org/D132489 | 3 年前 | |
Reland "D144999 [MC][MachO]Only emits compact-unwind format for "canonical" personality symbols. For the rest, use DWARFs." Reasons for rolling forward: - the crash reported from Chromium was fixed in D151824 (not related to this patch at all) - since D152824 was committed, it should now be safe to roll this forward. New change: - add an additional _ in name check This reverts commit 4980eead4d0b4666d53dad07afb091375b3a13a0. | 3 年前 | |
[lld-macho] Support EH frame pointer encodings that use sdata4 Previously we only supporting using the system pointer size (aka the absptr encoding) because llvm-mc's CFI directives always generate EH frames with that encoding. But libffi uses 4-byte-encoded, hand-rolled EH frames, so this patch adds support for it. Fixes #56576. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D130804 | 3 年前 | |
Reland "D144999 [MC][MachO]Only emits compact-unwind format for "canonical" personality symbols. For the rest, use DWARFs." Reasons for rolling forward: - the crash reported from Chromium was fixed in D151824 (not related to this patch at all) - since D152824 was committed, it should now be safe to roll this forward. New change: - add an additional _ in name check This reverts commit 4980eead4d0b4666d53dad07afb091375b3a13a0. | 3 年前 | |
[lld/mac] add aarch64 to requirements of encryption-info.s test | 5 年前 | |
[lld-macho] Treat undefined symbols uniformly In particular, we should apply the -undefined behavior to all such symbols, include those that are specified via the command line (i.e. -e, -u, and -exported_symbol). ld64 supports this too. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D102143 | 5 年前 | |
[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] Test with exported_symbol and exported_symbols_list together (#127243) | 1 年前 | |
[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] Improve invalid fat binary warning This nearly mirrors ld64's error for this case: ld: warning: ignoring file path/to/file, file is universal (armv7,arm64) but does not contain the x86_64 architecture: path/to/file Differential Revision: https://reviews.llvm.org/D141729 | 3 年前 | |
[lld-macho] Add support for -w This flag suppresses warnings produced by the linker. In ld64 this has an interesting interaction with -fatal_warnings, it silences the warnings but the link still fails. Instead of doing that here we still print the warning and eagerly fail the link in case both are passed, this seems more reasonable so users can understand why the link fails. Differential Revision: https://reviews.llvm.org/D127564 | 4 年前 | |
[lld-macho,test] Avoid writing to CWD Don't write to filelist in the current working directory, whigh might be read-only in some testing environmens. | 1 年前 | |
[lld/mac] Implement -final_output This is one of two flags clang passes to the linker when giving calling clang with multiple -arch flags. I think it'd make sense to also use finalOutput instead of outputFile in CodeSignatureSection() and when replacing @executable_path, but ld64 doesn't do that, so I'll at least put those in separate commits. Differential Revision: https://reviews.llvm.org/D105449 | 4 年前 | |
[MachO] Fix test on llvm-x86_64-debian-dylib builder Make the --implicit-check-not account for the file extension as well. This will still fail if we ever have a builder with .dylib in its name, and we probably want a more robust solution, but this addresses the immediate issue. Fixes https://github.com/llvm/llvm-project/issues/75850 Fixes https://github.com/llvm/llvm-project/issues/75910 | 2 年前 | |
[lld-macho] Add support for emitting chained fixups This commit adds support for chained fixups, which were introduced in Apple's late 2020 OS releases. This format replaces the dyld opcodes used for supplying rebase and binding information, and encodes most of that data directly in the memory location that will have the fixup applied. This reduces binary size and is a requirement for page-in linking, which will be available starting with macOS 13. A high-level overview of the format and my implementation can be found in SyntheticSections.h. This feature is currently gated behind the -fixup_chains flag, and will be enabled by default for supported targets in a later commit. Like in ld64, lazy binding is disabled when chained fixups are in use, and the -init_offsets transformation is performed by default. Differential Revision: https://reviews.llvm.org/D132560 | 3 年前 | |
[lld-macho]Ensure canonicalization happen even for "skipped" referent sections. Details: See bug report: https://github.com/llvm/llvm-project/issues/63039 Differential Revision: https://reviews.llvm.org/D151824 | 3 年前 | |
[lld-macho] Simplify archive loading logic This is a follow-on to {D129556}. I've refactored the code such that addFile() no longer needs to take an extra parameter. Additionally, the "do we force-load or not" policy logic is now fully contained within addFile, instead of being split between addFile and parseLCLinkerOptions. This also allows us to move the ForceLoad (now LoadType) enum out of the header file. Additionally, we can now correctly report loads induced by LC_LINKER_OPTION in our -why_load output. I've also added another test to check that CLI library non-force-loads take precedence over LC_LINKER_OPTION + -force_load_swift_libs. (The existing logic is correct, just untested.) Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D130137 | 3 年前 | |
[lld-macho]Rework error-checking in peeking at first-member in archive to avoid segfault. Details: calling getMemoryBufferRef() on an empty archive can trigger segfault so the code should check before calling this. this seems like a bug in the Archive API but that can be fixed separately. P.S: follow up to D156468 Differential Revision: https://reviews.llvm.org/D157300 | 2 年前 | |
[lld] Remove shell requirements from tests These tests all pass inside the lit internal shell. A couple were marked as requiring a shell to exclude them on Windows. Update those tests to explicitly carve out Windows rather than any configuration that does not provide the shell feature. Towards #102700. Reviewers: petrhosek, cmtice, mysterymath, MaskRay, ilovepi Reviewed By: cmtice Pull Request: https://github.com/llvm/llvm-project/pull/156510 | 10 个月前 | |
[test][lld-macho] Improve LC_FUNCTION_STARTS test coverage Previously functions that aren't included in the symtab were also excluded from the function starts. Symbols missing from function starts degrades the debugger experience in the case you don't have debug info for them. Differential Revision: https://reviews.llvm.org/D114275 | 4 年前 | |
[lld][macho] Fix segfault while processing malformed object file. (#167025) Ran into a use case where we had a MachO object file with a section symbol which did not have a section associated with it segfaults during linking. This patch aims to handle such cases gracefully and avoid the linker from crashing. --------- Co-authored-by: Ellis Hoag <ellis.sparky.hoag@gmail.com> | 8 个月前 | |
[lld][macho] Fix segfault while processing malformed object file. (#167025) Ran into a use case where we had a MachO object file with a section symbol which did not have a section associated with it segfaults during linking. This patch aims to handle such cases gracefully and avoid the linker from crashing. --------- Co-authored-by: Ellis Hoag <ellis.sparky.hoag@gmail.com> | 8 个月前 | |
[lld-macho] Remove partially supported 32-bit ARM arch We never really supported 32-bit ARM arch entirely, and partial support was added for very specific features. Regardless, it fails to even link the most basic applications that at this point, it might be better to move this arch as unsupported. Given that Apple will be moving towards arm64 long term, I don't see any reason for anyone to invest time in supporting this either, and for those who still need it should use apple's ld64 linker. Fixes #62691 Reviewed By: #lld-macho, int3 Differential Revision: https://reviews.llvm.org/D150544 | 3 年前 | |
[lld-macho][test] Add -lSystem to all lld invocations This is a requirement from ld64, so this mirrors that expectation. Most of these changes were just offsets from adding the library, or adding dyld_stub_binder which is always added when linking ld64. This also adds %no-lsystem-lld for the few cases where we're explicitly testing things without that. Fixes: https://github.com/llvm/llvm-project/issues/54184 Differential Revision: https://reviews.llvm.org/D135193 | 3 年前 | |
[lld/mac] Don't assert when ICFing arm64 code WordLiteralSection dedupes literals by content. WordLiteralInputSection::getOffset() used to read a literal at the passed-in offset and look up this value in the deduping map to find the offset of the deduped value. But it's possible that (e.g.) a 16-byte literal's value is accessed 4 bytes in. To get the offset at that address, we have to get the deduped value at offset 0 and then apply the offset 4 to the result. (See also WordLiteralSection::finalizeContents() which fills in those maps.) Only a problem on arm64 because in x86_64 the offset is part of the instruction instead of a separate ARM64_RELOC_ADDEND relocation. (See bug for more details.) Fixes PR51999. Differential Revision: https://reviews.llvm.org/D112584 | 4 年前 | |
[lld-macho] Fix ICF crash when comparing symbol relocs Previously, when encountering a symbol reloc located in a literal section, we would look up the contents of the literal at the symbol value + addend offset within the literal section. However, it seems that this offset is not guaranteed to be valid. Instead, we should use just the symbol value to retrieve the literal's contents, and compare the addend values separately. ld64 seems to do this. Reviewed By: #lld-macho, thevinster Differential Revision: https://reviews.llvm.org/D124223 | 4 年前 | |
Reland "D144999 [MC][MachO]Only emits compact-unwind format for "canonical" personality symbols. For the rest, use DWARFs." Reasons for rolling forward: - the crash reported from Chromium was fixed in D151824 (not related to this patch at all) - since D152824 was committed, it should now be safe to roll this forward. New change: - add an additional _ in name check This reverts commit 4980eead4d0b4666d53dad07afb091375b3a13a0. | 3 年前 | |
[lld] Implement safe icf for MachO This change implements --icf=safe for MachO based on addrsig section that is implemented in D123751. Reviewed By: int3, #lld-macho Differential Revision: https://reviews.llvm.org/D123752 | 4 年前 | |
[Clang][AArch64] Remove redundant tune args to the backend (#146896) This change removes unnecessary tune args to the AArch64 backend. The AArch64 backend automatically handles tune-cpu and adds the necessar y features based on the models from TableGen. It follows this fix: https://github.com/llvm/llvm-project/pull/146260 where updating a subtarget feature didn't fail the frontend test because both the toolchain and the test suffered from a coordinated error. | 1 年前 | |
[Clang][AArch64] Remove redundant tune args to the backend (#146896) This change removes unnecessary tune args to the AArch64 backend. The AArch64 backend automatically handles tune-cpu and adds the necessar y features based on the models from TableGen. It follows this fix: https://github.com/llvm/llvm-project/pull/146260 where updating a subtarget feature didn't fail the frontend test because both the toolchain and the test suffered from a coordinated error. | 1 年前 | |
[lld-macho] Omit __llvm_addrsig metadata from the output (#98913) This section contains metadata that's only relevant for Identical Code Folding at link time, we should not include it in the output. We still treat it like a regular section during input file parsing (e.g. create a ConcatInputSection for it), as we want its relocations to be parsed. But it should not be passed to addInputSection, as that's what assigns it to an OutputSection and adds it to the inputSections vector which specifies the inputs to dead-stripping and relocation scanning. This fixes a "__DATA,__llvm_addrsig, offset 0: fixups overlap" error when using --icf=safe alongside -fixup_chains. This occurs because all __llvm_addrsig sections are 8 bytes large, and the relocations which signify functions whose addresses are taken are all at offset 0. This makes the fix in 5fa24ac2 ("Category Merger: add support for addrsig references") obsolete, as we no longer try to resolve symbols referenced in __llvm_addrsig when writing the output file. When we do iterate its relocations in markAddrSigSymbols, we do not try to resolve their addresses. | 2 年前 | |
[lld-macho][nfc] Clean up trailing spaces and tabs | 4 年前 | |
[lld-macho] Deduplicate CFStrings during ICF __cfstring has embedded addends that foil ICF's hashing / equality checks. (We can ignore embedded addends when doing ICF because the same information gets recorded in our Reloc structs.) Therefore, in order to properly dedup CFStrings, we create a mutable copy of the CFString and zero out the embedded addends before performing any hashing / equality checks. (We did in fact have a partial implementation of CFString deduplication already. However, it only worked when the cstrings they point to are at identical offsets in their object files.) I anticipate this approach can be extended to other similar statically-allocated struct sections in the future. In addition, we previously treated all references with differing addends as unequal. This is not true when the references are to literals: different addends may point to the same literal in the output binary. In particular, __cfstring has such references to __cstring. I've adjusted ICF's equalsConstant logic accordingly, and I've added a few more tests to make sure the addend-comparison code path is adequately covered. Fixes https://github.com/llvm/llvm-project/issues/51281. Reviewed By: #lld-macho, Roger Differential Revision: https://reviews.llvm.org/D120137 | 4 年前 | |
Reland "D144999 [MC][MachO]Only emits compact-unwind format for "canonical" personality symbols. For the rest, use DWARFs." Reasons for rolling forward: - the crash reported from Chromium was fixed in D151824 (not related to this patch at all) - since D152824 was committed, it should now be safe to roll this forward. New change: - add an additional _ in name check This reverts commit 4980eead4d0b4666d53dad07afb091375b3a13a0. | 3 年前 | |
[lld-macho][nfc]Add REQUIRES arch in test to fix breakages in D156468 | 2 年前 | |
[lld] Remove shell requirements from tests These tests all pass inside the lit internal shell. A couple were marked as requiring a shell to exclude them on Windows. Update those tests to explicitly carve out Windows rather than any configuration that does not provide the shell feature. Towards #102700. Reviewers: petrhosek, cmtice, mysterymath, MaskRay, ilovepi Reviewed By: cmtice Pull Request: https://github.com/llvm/llvm-project/pull/156510 | 10 个月前 | |
[lld/mac] Make framework symlinks in tests more realistic In a framework Foo.framework, Foo.framework/Foo is usually a relative symbolic link to Foo.framework/Versions/Current/Foo, and Foo.framework/Versions/Current is usually a relative symbolic link to A. Our tests used absolute symbolic links. Now they use relative symbolic links. No behavior change, just makes the tests more representative of the real world. (implicit-dylib.s omits the "Current" folder too, but I'm not changing that here.) Differential Revision: https://reviews.llvm.org/D103998 | 5 年前 | |
[lld/mac] Mark private externs with GOT relocs as LOCAL in indirect symbtab prepareSymbolRelocation() in Writer.cpp adds both symbols that need binding and symbols relocated with a pointer relocation to the got. Pointer relocations are emitted for non-movq GOTPCREL(%rip) loads. (movqs become GOT_LOADs so that the linker knows they can be relaxed to leaqs, while others, such as addq, become just GOT -- a pointer relocation -- since they can't be relaxed in that way). For example, this C file produces a private_extern GOT relocation when compiled with -O2 with clang: extern const char kString[]; const char* g(int a) { return kString + a; } Linkers need to put pointer-relocated symbols into the GOT, but ld64 marks them as LOCAL in the indirect symbol table. This matters, since strip -x looks at the indirect symbol table when deciding what to strip. The indirect symtab emitting code was assuming that only symbols that need binding are in the GOT, but pointer relocations where there too. Hence, the code needs to explicitly check if a symbol is a private extern. Fixes https://crbug.com/1242638, which has some more information in comments 14 and 15. With this patch, the output of nm -U on Chromium Framework after stripping now contains just two symbols when using lld, just like with ld64. Differential Revision: https://reviews.llvm.org/D111852 | 4 年前 | |
[lld-macho] Remove symbols to __mod_init_func with -init_offsets (#97156) When -fixup_chains/-init_offsets is used, a different section, __init_offsets is synthesized from __mod_init_func. If there are any symbols defined inside __mod_init_func, they are added to the symbol table unconditionally while processing the input files. Later, when querying these symbols' addresses (when constructing the symtab or exports trie), we crash with a null deref, as there is no output section assigned to them. Just making the symbols point to __init_offsets is a bad idea, as the new section stores 32-bit integers instead of 64-bit pointers; accessing the symbols would not do what the programmer intended. We should entirely omit them from the output. This is what ld64 and ld-prime do. This patch uses the same mechanism as dead-stripping to mark these symbols as not needed in the output. There might be nicer fixes than the workaround, this is discussed in #97155. Fixes https://github.com/llvm/llvm-project/pull/79894#issuecomment-1944092892 Fixes #94716 | 2 年前 | |
[lld,test] Fix few FileCheck annotation typos (#92238) | 2 年前 | |
[lld][MachO] Support for -interposable (#131813) As discussed in https://github.com/llvm/llvm-project/issues/53680, add support for ld64's -interposable flag on Apple platforms to lld. | 1 年前 | |
[lld] Adds support for xros. (#83031) | 2 年前 | |
[lld-macho] Accept dylibs with LC_DYLD_EXPORTS_TRIE This load command specifies the offset and size of the exports trie. This information used to be a field in LC_DYLD_INFO, but in newer libraries, it has a dedicated load command: LC_DYLD_EXPORTS_TRIE. The format of the trie is the same for both load commands, so the code for parsing it can be shared. LLD does not generate this yet; it is mainly useful when chained fixups are in use, as the other members of LC_DYLD_INFO are unused then, so the smaller LC_DYLD_EXPORTS_TRIE can be output instead. LLDB gained support for this in D107673. Fixes #54550 Differential Revision: https://reviews.llvm.org/D129430 | 3 年前 | |
[lld-macho] Postprocess LC Linker Option LLD resolves symbols regardless of LTO modes early when reading and parsing input files in order. The object files built from LTO passes are appended later. Because LLD eagerly resolves the LC linker options while parsing a new object file (and its chain of dependent libraries), the prior decision on pending prevailing symbols (belonging to some bitcode files) can change to ones in those native libraries that are just loaded. This patch delays processing LC linker options until all the native object files are added after LTO is done, similar to LD64. This way we preserve the decision on prevailing symbols LLD made, regardless of LTO modes. - When parsing a new object file in parseLinkerOptions(), it just parses LC linker options in the header, and saves those contents to unprocessedLCLinkerOptions. - After LTO is finished, resolveLCLinkerOptions() is called to recursively load dependent libraries, starting with initial linker options collected in unprocessedLCLinkerOptions (which also updates during recursions) Reviewed By: #lld-macho, int3 Differential Revision: https://reviews.llvm.org/D157716 | 2 年前 | |
[lld-macho] Postprocess LC Linker Option LLD resolves symbols regardless of LTO modes early when reading and parsing input files in order. The object files built from LTO passes are appended later. Because LLD eagerly resolves the LC linker options while parsing a new object file (and its chain of dependent libraries), the prior decision on pending prevailing symbols (belonging to some bitcode files) can change to ones in those native libraries that are just loaded. This patch delays processing LC linker options until all the native object files are added after LTO is done, similar to LD64. This way we preserve the decision on prevailing symbols LLD made, regardless of LTO modes. - When parsing a new object file in parseLinkerOptions(), it just parses LC linker options in the header, and saves those contents to unprocessedLCLinkerOptions. - After LTO is finished, resolveLCLinkerOptions() is called to recursively load dependent libraries, starting with initial linker options collected in unprocessedLCLinkerOptions (which also updates during recursions) Reviewed By: #lld-macho, int3 Differential Revision: https://reviews.llvm.org/D157716 | 2 年前 | |
[lld-macho] Postprocess LC Linker Option LLD resolves symbols regardless of LTO modes early when reading and parsing input files in order. The object files built from LTO passes are appended later. Because LLD eagerly resolves the LC linker options while parsing a new object file (and its chain of dependent libraries), the prior decision on pending prevailing symbols (belonging to some bitcode files) can change to ones in those native libraries that are just loaded. This patch delays processing LC linker options until all the native object files are added after LTO is done, similar to LD64. This way we preserve the decision on prevailing symbols LLD made, regardless of LTO modes. - When parsing a new object file in parseLinkerOptions(), it just parses LC linker options in the header, and saves those contents to unprocessedLCLinkerOptions. - After LTO is finished, resolveLCLinkerOptions() is called to recursively load dependent libraries, starting with initial linker options collected in unprocessedLCLinkerOptions (which also updates during recursions) Reviewed By: #lld-macho, int3 Differential Revision: https://reviews.llvm.org/D157716 | 2 年前 | |
| 2 年前 | ||
[lld-macho] Standardize error messages Errors / warnings that originate from a particular file should be of the form $file: $message. Reviewed By: #lld-macho, keith Differential Revision: https://reviews.llvm.org/D140634 | 3 年前 | |
[lld] Remove shell requirements from tests These tests all pass inside the lit internal shell. A couple were marked as requiring a shell to exclude them on Windows. Update those tests to explicitly carve out Windows rather than any configuration that does not provide the shell feature. Towards #102700. Reviewers: petrhosek, cmtice, mysterymath, MaskRay, ilovepi Reviewed By: cmtice Pull Request: https://github.com/llvm/llvm-project/pull/156510 | 10 个月前 | |
[lld/mac] Implement support for searching dylibs with @loader_path/ in install name Differential Revision: https://reviews.llvm.org/D103779 | 5 年前 | |
[lld-macho] Ignore duplicate -rpath entries (#99289) Starting with Xcode 16 (dyld-1122), Apple's binary utilities, e.g. dyld_info (but not dyld itself), will refuse to load binaries built against the macOS 15 SDK or newer that contain the same LC_RPATH entry multiple times: https://github.com/apple-oss-distributions/dyld/blob/rel/dyld-1122/mach_o/Policy.cpp#L246-L249 ld-prime deduplicates entries (regardless of the deployment target), we now do the same. We also match ld-prime's and ld64's behavior by warning on duplicate -rpath arguments. This can be disabled by the LLD-specific --no-warn-duplicate-rpath flag. | 2 年前 | |
[lld-macho] Add support for .so file discovery While not the recommended extension on macOS .so is supported by ld64. This mirrors that behavior. Related report: https://github.com/bazelbuild/bazel/issues/18464 Differential Revision: https://reviews.llvm.org/D151147 | 3 年前 | |
[lld-macho] Ensure that chained fixups data comes first in __LINKEDIT libstuff-based tools (e.g. codesign and strip) require __chainfixups to be the first section in __LINKEDIT, and print a "file not in an order that can be processed" error message if that is not the case. Differential Revision: https://reviews.llvm.org/D137492 | 3 年前 | |
[NFC][Py Reformat] Reformat python files in the rest of the dirs This is an ongoing series of commits that are reformatting our Python code. This catches the last of the python files to reformat. Since they where so few I bunched them together. Reformatting is done with black. If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run git checkout --ours <yourfile> and then reformat it with black. If you run into any problems, post to discourse about it and we will try to help. RFC Thread below: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Reviewed By: jhenderson, #libc, Mordante, sivachandra Differential Revision: https://reviews.llvm.org/D150784 | 3 年前 | |
[lld-macho] Flip string deduplication default Previously by default, when not using --ifc=, lld would not deduplicate string literals. This reveals reliance on undefined behavior where string literal addresses are compared instead of using string equality checks. While ideally you would be able to easily identify and eliminate the reliance on this UB, this can be difficult, especially for third party code, and increases the friction and risk of users migrating to lld. This flips the default to deduplicate strings unless --no-deduplicate-strings is passed, matching ld64's behavior. Differential Revision: https://reviews.llvm.org/D140517 | 3 年前 | |
[lld/mac] Change load command order to be more like ld64 No meaningful behavior change. Makes diffing otool -l output a bit easier. Differential Revision: https://reviews.llvm.org/D106219 | 4 年前 | |
[mac/lld] Run tests with -fatal_warnings by default This helps us catch cases where we add support for a flag but forget to remove HelpHidden from Options.td. More explicit alternative to D92455 Differential Revision: https://reviews.llvm.org/D92575 | 5 年前 | |
Reland "[lld-macho] Implement -load_hidden" This flag was introduced in ld64-609. It instructs the linker to link to a static library while treating its symbols as if they had hidden visibility. This is useful when building a dylib that links to static libraries but we don't want the symbols from those to be exported. Closes #51505 This reland adds bitcode file handling, so we won't get any compile errors due to BitcodeFile::forceHidden being unused. Differential Revision: https://reviews.llvm.org/D130473 | 3 年前 | |
[lld-macho] Implement -hidden-l Similarly to -load_hidden, this flag instructs the linker to not export symbols from the specified archive. While that flag takes a path, -hidden-l looks for the specified library name in the search path. The test changes are needed because -hidden-lfoo resolves to libfoo.a, not foo.a. Differential Revision: https://reviews.llvm.org/D130529 | 3 年前 | |
[lld-macho] Coalesce local symbol aliases along with their aliased weak def This supersedes {D139069}. In some ways we are now closer to ld64's behavior: we previously only did this coalescing for private-label symbols, but now we do it for all locals, just like ld64. However, we no longer generate weak binds when a local alias to a weak symbol is referenced. This is merely for implementation simplicity; it's not clear to me that any real-world programs depend on us emulating this behavior. The problem with the previous approach is that we ended up with duplicate references to the same symbol instance in our InputFiles, which translated into duplicate symbols in our output. While we could work around that problem by performing a dedup step before emitting the symbol table, it seems cleaner to not generate duplicate references in the first place. Numbers for chromium_framework on my 16 Core Intel Mac Pro: base diff difference (95% CI) sys_time 2.243 ± 0.093 2.231 ± 0.066 [ -2.5% .. +1.4%] user_time 6.529 ± 0.087 6.080 ± 0.050 [ -7.5% .. -6.3%] wall_time 6.928 ± 0.175 6.474 ± 0.112 [ -7.7% .. -5.4%] samples 26 31 Yep, that's a massive win... because it turns out that {D140606} and {D139069} caused a regression (of about the same size.) I just didn't think to measure them back then. I'm guessing all the extra symbols we have been emitting did not help perf at all... Reviewed By: lgrey Differential Revision: https://reviews.llvm.org/D145455 | 3 年前 | |
[lld][MachO] Add support for LC_DATA_IN_CODE Add first bits for emitting LC_DATA_IN_CODE. Test plan: make check-lld-macho Differential revision: https://reviews.llvm.org/D103006 | 5 年前 | |
[lld-macho] Handle non-extern symbols marked as private extern Previously, we asserted that such a case was invalid, but in fact ld -r can emit such symbols if the input contained a (true) private extern, or if it contained a symbol started with "L". Non-extern symbols marked as private extern are essentially equivalent to regular TU-scoped symbols, so no new functionality is needed. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D104502 | 5 年前 | |
[lld-macho][test] Hyphenate lit's check-prefixes For consistency. | 3 年前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
[lld-macho] Simplify linker optimization hint processing This commit removes the relocTargets vector, and instead makes the code reconstruct the referent addresses from the relocated instructions. This will allow us to move applyOptimizationHints from ConcatInputSection::writeTo to a separate pass that parses and applies LOHs in one step, on a per-file basis. This will improve performance, as parsing is currently done serially in ObjFile::parse. I opted to remove the sanity check that ensures that all relocations within a LOH point to the same symbol. This completely eliminates the need to search through relocations. It is my understanding that mismatched relocation targets should not be present in valid object files, so it's unlikely that the removal will lead to mislinks. Differential Revision: https://reviews.llvm.org/D133274 | 3 年前 | |
[lld-macho] Parallelize linker optimization hint processing This commit moves the parsing of linker optimization hints into ARM64::applyOptimizationHints. This lets us avoid allocating memory for holding the parsed information, and moves work out of ObjFile::parse, which is not parallelized at the moment. This change reduces the overhead of processing LOHs to 25-30 ms when linking Chromium Framework on my M1 machine; previously it took close to 100 ms. There's no statistically significant change in runtime for a --threads=1 link. Performance figures with all 8 cores utilized: N Min Max Median Avg Stddev x 20 3.8027232 3.8760762 3.8505335 3.8454145 0.026352574 + 20 3.7019017 3.8660538 3.7546209 3.7620371 0.032680043 Difference at 95.0% confidence -0.0833775 +/- 0.019 -2.16823% +/- 0.494094% (Student's t, pooled s = 0.0296854) Differential Revision: https://reviews.llvm.org/D133439 | 3 年前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
[lld-macho] Handle LOH_ARM64_ADRP_LDR_GOT optimization hints This hint instructs the linker to perform the AdrpLdr or AdrpAdd transformation depending on whether the GOT load has been relaxed to load a local symbol's address. Differential Revision: https://reviews.llvm.org/D129059 | 4 年前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
[lld-macho] Enable Linker Optimization Hints pass for arm64_32 (#148964) The backend emits .loh directives for arm64_32 as well. Our pass already handles 32-bit pointer loads correctly (there was an extraneous sanity check for 8-byte pointer sizes, I removed that here), so we can enable them for all arm64 subtargets, including our upcoming arm64e support. | 1 年前 | |
[lld-macho] Fix LOH parsing segfault advanceSubsection() didn't account for the possibility that a section could have no subsections. Reviewed By: #lld-macho, thakis, BertalanD Differential Revision: https://reviews.llvm.org/D130288 | 3 年前 | |
lld: Convert tests to opaque pointers | 3 年前 | |
[lld-macho] Tweak the names we give to archive members In particular, make it foo.a(foo.o)$ARCHIVE_OFFSET. The goal is to make it more similar to both ld64 implementation, which uses the foo.a(foo.o)$MODULE_ID format. We dump some of these names in LTO code, so matching ld64's format is helpful. This format is also more similar to LLD-ELF's, which is foo.a(foo.o at $ARCHIVE_OFFSET). Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D148828 | 3 年前 | |
[lld] Make cache-warning* tests work with internal shell These tests were using subexpressions to change the cache size. Change them up to write out the necessary commands to a response file and then load that on the lld command line. Towards #102700. Reviewers: ilovepi, cmtice, mysterymath, MaskRay, petrhosek Reviewed By: MaskRay Pull Request: https://github.com/llvm/llvm-project/pull/156537 | 10 个月前 | |
[COFF, Mach-O] Include -mllvm options in thinlto cache key Like D134013, but for COFF and Mach-O. Also expand the ELF test a bit. I at first didn't realize that getValue() for -mllvm -foo=bar would return -foo=bar instead of just bar, and so I wrote the test to check if we indeed get this wrong. We don't, but having the test for it seems nice, so I'm including it. Differential Revision: https://reviews.llvm.org/D137971 | 3 年前 | |
[LLD] Add --lto-CGO[0-3] option Allow controlling the CodeGenOpt::Level independent of the LTO optimization level in LLD via new options for the COFF, ELF, MachO, and wasm frontends to lld. Most are spelled as --lto-CGO[0-3], but COFF is spelled as -opt:lldltocgo=[0-3]. See D57422 for discussion surrounding the issue of how to set the CG opt level. The ultimate goal is to let each function control its CG opt level, but until then the current default means it is impossible to specify a CG opt level lower than 2 while using LTO. This option gives the user a means to control it for as long as it is not handled on a per-function basis. Reviewed By: MaskRay, #lld-macho, int3 Differential Revision: https://reviews.llvm.org/D141970 | 3 年前 | |
lld: Convert tests to opaque pointers | 3 年前 | |
[lld-macho] Support common symbols in bitcode (but differently from ld64) ld64 seems to handle common symbols in bitcode rather bizarrely. They follow entirely different precedence rules from their non-bitcode counterparts. I initially tried to emulate ld64 in D106597, but I'm not sure the extra complexity is worth it, especially given that common symbols are not, well, very common. This diff accords common bitcode symbols the same precedence as regular common symbols, just as we treat all other pairs of bitcode and non-bitcode symbol types. The tests document ld64's behavior in detail, just in case we want to revisit this. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D107027 | 4 年前 | |
lld: Convert tests to opaque pointers | 3 年前 | |
[MC] Honour alignment directive fill value for non-intel (#100136) As reported in https://llvm.org/PR30955, .balign with a fill-value of 0 did not actually align using zeroes, on non-x86 targets. This is because the check of whether to use the code alignment routines or whether to just use the fill value was checking whether the fill value was equal to TextAlignFillValue, which has not been changed from its default of 0 on most targets (it has been changed for x86). However, most targets do not set the fill value because it doesn't entirely make sense -- i.e. on AArch64 there's no reasonable byte value to use for alignment, as instructions are word-sized and have to be well-aligned. I think the check at the end AsmParser::parseDirectiveAlign is suspicious even on x86 - if you use .balign <align>, 0x90 in a code section, you don't end up with a block of 0x90 repeated, you end up with a block of NOPs of various widths. This functionality is never tested. The fix here is to modify the check to ignore the default text align fill value when choosing to do code alignment or not. Fixes #30303 | 1 年前 | |
[lld-macho] Stabilize iteration order of config->exportedSymbols.literals Otherwise lto-explicit-exports.ll might fail due to #96282. | 2 年前 | |
[lld-macho] Set FinalDefinitionInLinkageUnit on most LTO externs Since Mach-O has a two-level namespace (unlike ELF), we can usually set this property to true. (I believe this setting is only available in the new LTO backend, so I can't really use ld64 / libLTO's behavior as a reference here... I'm just doing what I think is correct.) See {D119294} for the work done to calculate the interposable used in this diff. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D119506 | 4 年前 | |
[ThinLTO] Fix internalization decisions for weak/linkonce ODR This fixes a runtime error that occurred due to incorrect internalization of linkonce_odr functions where function pointer equality was broken. This was hit because the prevailing copy was in a native object, so the IR copies were not exported, and the existing code internalized all of the IR copies. It could be fixed by guarding this internalization on whether the defs are (local_)unnamed_addr, meaning that their address is not significant (which we have in the summary currently for linkonce_odr via the CanAutoHide flag). Or we can propagate reference attributes as we do when determining whether a global variable is read or write-only (reference edges are annotated with whether they are read-only, write-only, or neither, and taking the address of a function would result in a reference edge to the function that is not read or write-only). However, this exposed a larger issue with the internalization handling. Looking at test cases, it appears the intent is to internalize when there is a single definition of a linkonce/weak ODR symbol (that isn't exported). This makes sense in the case of functions, because the inliner can apply its last call to static heuristic when appropriate. In the case where there is no prevailing copy in IR, internalizing all of the IR copies of a linkonce_odr, even if legal, just increases binary size. In that case it is better to fall back to the normal handling of converting all non-prevailing copies to available_externally so that they are eliminated after inlining. In the case of variables, the existing code was attempting to internalize the non-exported linkonce/weak ODR variables if they were read or write-only. While this is legal (we propagate reference attributes to determine this information), we don't even need to internalize these here as there is later separate handling that internalizes read and write-only variables when we process the module at the start of the ThinLTO backend (processGlobalForThinLTO). Instead, we can also internalize any non-exported variable when there is only one (IR) definition, which is prevailing. And in that case, we don't need to require that it is read or write-only, since we are guaranteed that all uses must use that single definition. In the new LTO API, if there are multiple defs of a linkonce or weak ODR it will be marked exported, but it isn't clear that this will always be true for the legacy LTO API. Therefore, require that there is only a single (non-local) def, and that it is prevailing. The test cases changes are both to reflect the change in the handling of linkonce_odr IR copies where the prevailing def is not in IR (the main correctness bug fix here), and to reflect the more aggressive internalization of variables when there is only a single def, it is in IR, and not exported. I've also added some additional testing via the new LTO API. Differential Revision: https://reviews.llvm.org/D151965 | 3 年前 | |
[lld-macho] Set FinalDefinitionInLinkageUnit on most LTO externs Since Mach-O has a two-level namespace (unlike ELF), we can usually set this property to true. (I believe this setting is only available in the new LTO backend, so I can't really use ld64 / libLTO's behavior as a reference here... I'm just doing what I think is correct.) See {D119294} for the work done to calculate the interposable used in this diff. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D119506 | 4 年前 | |
[lld-macho][nfc] Rename %no_fatal_warnings_lld in tests ... to use hyphens instead of underscores, making it consistent with our other substitutions like %no-arg-lld and %lld-watchos. Reviewed By: keith Differential Revision: https://reviews.llvm.org/D119513 | 4 年前 | |
[lld/mac] Give several LTO tests an "lto-" prefix Differential Revision: https://reviews.llvm.org/D105476 | 4 年前 | |
[lld][test] Remove unsafe-fp-math uses (NFC) (#164598) | 9 个月前 | |
[LTO] Improve diagnostics handling when parsing module-level inline assembly (#75726) Non-LTO compiles set the buffer name to "<inline asm>" ( AsmPrinter::addInlineAsmDiagBuffer) and pass diagnostics to ClangDiagnosticHandler (through the MCContext handler in MachineModuleInfoWrapperPass::doInitialization) to ensure that the exit code is 1 in the presence of errors. In contrast, LTO compiles spuriously succeed even if error messages are printed. % cat a.c void _start() {} asm("unknown instruction"); % clang -c a.c <inline asm>:1:1: error: invalid instruction mnemonic 'unknown' 1 | unknown instruction | ^ 1 error generated. % clang -c -flto a.c; echo $? # -flto=thin is the same error: invalid instruction mnemonic 'unknown' unknown instruction ^~~~~~~ error: invalid instruction mnemonic 'unknown' unknown instruction ^~~~~~~ 0 CollectAsmSymbols parses inline assembly and is transitively called by both ModuleSummaryIndexAnalysis::run and WriteBitcodeToFile, leading to duplicate diagnostics. This patch updates CollectAsmSymbols to be similar to non-LTO compiles. % clang -c -flto=thin a.c; echo $? <inline asm>:1:1: error: invalid instruction mnemonic 'unknown' 1 | unknown instruction | ^ 1 errors generated. 1 The HasErrors check does not prevent duplicate warnings but assembler warnings are very uncommon. | 2 年前 | |
[lld/mac] Give several LTO tests an "lto-" prefix Differential Revision: https://reviews.llvm.org/D105476 | 4 年前 | |
[lld-macho] Fix segfault when handling LTO + object file weak defs which occurs when there are EH frames present in the object file's weak def. Reviewed By: abrachet Differential Revision: https://reviews.llvm.org/D130409 | 3 年前 | |
[lld] Remove transitional legacy pass manager flags Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D142571 | 3 年前 | |
[llvm-lit] Fix LLD Test when using lit internal shell (#102063) Resolved the issue in MachO/lto-object-path.ll test where 'ZERO_AR_DATE=0' was not recognized as a command. Changed the test command to set the environment variable correctly using 'env'. This allows that the environment variable is set properly, allowing the test to pass. | 1 年前 | |
[lld/mac] Add test for --lto-O This belongs to fe08e9c4871, I (thakis) forgot to git add it back then. Differential Revision: https://reviews.llvm.org/D105223 | 4 年前 | |
[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][nfc] Add test for resolution of bitcode symbols We lacked a test for bitcode symbol precedence. We assumed that they followed the same rules as their regular symbol counterparts, but never had a test to verify that we were matching ld64's behavior. It turns out that we were largely correct, though we deviate from ld64 when there are bitcode and non-bitcode symbols of the same name. The test added in this diff both verifies our behavior and documents the differences. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D106596 | 4 年前 | |
[lld/mac] Don't lose "weak ref" bit when doing LTO Fixes #52778. Probably fixes Chromium crashing on startup on macOS 10.15 (and older) systems when building with LTO, but I haven't verified that yet. Differential Revision: https://reviews.llvm.org/D115949 | 4 年前 | |
[LLD][MachO] Enable plugin support for LTO (#115690) Add new CLI options for feature parity with ELF w.r.t pass plugins. Most of the changes are ported directly from https://github.com/llvm/llvm-project/commit/0c86198b279a98c8550fde318b59ed3ca0ca5045. With this change, it is now possible to load and run external pass plugins during the LTO phase. | 1 年前 | |
[lld-macho] Print archive names in linker map If a symbol is pulled in from an archive, we should include the archive name in the map file output. This is what ld64 does. Note that we aren't using toString(InputFile*) here because it includes the install name for dylibs in its output, and ld64's map file does not contain those. Reviewed By: #lld-macho, smeenai Differential Revision: https://reviews.llvm.org/D145623 | 3 年前 | |
[lld-macho] Don't include zero-size private label symbols in map file This is also what ld64 does. This will make it easier to compare their respective map files. Reviewed By: #lld-macho, thevinster Differential Revision: https://reviews.llvm.org/D145654 | 3 年前 | |
[lld-macho][nfc] Rename %no_fatal_warnings_lld in tests ... to use hyphens instead of underscores, making it consistent with our other substitutions like %no-arg-lld and %lld-watchos. Reviewed By: keith Differential Revision: https://reviews.llvm.org/D119513 | 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][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] Add --lto-debug-pass-manager option Add support for printing the passes run for LTO. Both ELF and COFF have --lto-debug-pass-manager (-ltodebugpassmanager) to print the compiler passes run during LTO. This is useful to check that a certain compiler pass is run in a test, e.g., https://reviews.llvm.org/D151589 Reviewed By: #lld-macho, MaskRay, int3 Differential Revision: https://reviews.llvm.org/D151746 | 3 年前 | |
[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] Reject -no_pie for unsupported archs ld64 rejects -no_pie when targeting arm64, this mirrors that behavior. Newer versions of ld64 also reject it based on minimum OS versions, but that logic isn't in an open source dump yet so it isn't implemented here. Fixes https://github.com/llvm/llvm-project/issues/59115 Differential Revision: https://reviews.llvm.org/D138884 | 3 年前 | |
[lld-macho] If export_size is zero, export_off must be zero Otherwise tools like codesign_allocate will choke. We were already handling this correctly for the other DYLD_INFO sections. Doing this correctly is a bit subtle: we don't know if export_size will be zero until we have run ExportSection::finalizeContents(). However, we must still add the ExportSection to the __LINKEDIT segment in order that it gets sorted during sortSectionsAndSegments(). Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D112589 | 4 年前 | |
fix typos to cycle bots | 4 年前 | |
[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 | 4 年前 | |
[LLD, MachO] Default objc_relative_method_lists on MacOS10.16+/iOS14+ (#104519) This patch makes -objc_relative_method_lists default on MacOS 10.16+/iOS 14+. Manual override still work if command line argument is provided. To test this change, many explict arguments are removed from the test files. Some explict -objc_no_objc_relative_method_lists are also added for tests that don't support this yet. This commit tries to revive #101360, which exposes a bug that breaks CI. #104081 has fixed that bug. | 1 年前 | |
[LLD, MachO] Default objc_relative_method_lists on MacOS10.16+/iOS14+ (#104519) This patch makes -objc_relative_method_lists default on MacOS 10.16+/iOS 14+. Manual override still work if command line argument is provided. To test this change, many explict arguments are removed from the test files. Some explict -objc_no_objc_relative_method_lists are also added for tests that don't support this yet. This commit tries to revive #101360, which exposes a bug that breaks CI. #104081 has fixed that bug. | 1 年前 | |
[lld] Remove usage of %T in lld/test (#126133) %T is not unique and deprecated [[1](https://llvm.org/docs/CommandGuide/lit.html#substitutions)]. This patch replaces all %T in lld/test with %t.dir (mkdir if necessary) --------- Signed-off-by: Peter Rong <PeterRong@meta.com> | 1 年前 | |
Revert "[lld] Make lld tests use lit internal shell by default" This reverts commit 714f6b03bc89bff766ae628092cd059fd8aa0aa1. This caused some build failures. https://lab.llvm.org/buildbot/#/builders/23/builds/13543 Reverting for now until I have a chance to investigate. | 10 个月前 | |
[lld-macho] Category Merging: Detect correct class language for classes with aliased symbols (#97454) Currently we rely on detecting the source language of a class by the name of the symbol pointing to it. This generally works, but there are scenarios where Swift generates both an ObjC name and a Swift name for the symbol - by aliasing the ObjC name to the Swift name, as follows: .globl _OBJC_CLASS_$__TtC11MyTestClass11MyTestClass .private_extern _OBJC_CLASS_$__TtC11MyTestClass11MyTestClass .set _OBJC_CLASS_$__TtC11MyTestClass11MyTestClass, _$s11MyTestClassAACN So to correctly detect the source language in all cases, we need to handle scenarios where both an ObjC symbol and a Swift symbol is defined for a class - in this case the symbol is always a Swift class. | 2 年前 | |
[LLD, MachO] Default objc_relative_method_lists on MacOS10.16+/iOS14+ (#104519) This patch makes -objc_relative_method_lists default on MacOS 10.16+/iOS 14+. Manual override still work if command line argument is provided. To test this change, many explict arguments are removed from the test files. Some explict -objc_no_objc_relative_method_lists are also added for tests that don't support this yet. This commit tries to revive #101360, which exposes a bug that breaks CI. #104081 has fixed that bug. | 1 年前 | |
[lld-macho][test] Simplify classrefs test I wasn't previously aware of the llvm-otool -o flag; that gives us output that's a lot easier to parse. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D141024 | 3 年前 | |
[lld-macho][re-land] Warn on method name collisions from category definitions This implements ld64's checks for duplicate method names in categories & classes. In addition, this sets us up for implementing Obj-C category merging. This diff handles the most of the parsing work; what's left is rewriting those category / class structures. Numbers for chromium_framework: base diff difference (95% CI) sys_time 2.182 ± 0.027 2.200 ± 0.047 [ -0.2% .. +1.8%] user_time 6.451 ± 0.034 6.479 ± 0.062 [ -0.0% .. +0.9%] wall_time 6.841 ± 0.048 6.885 ± 0.105 [ -0.1% .. +1.4%] samples 33 22 Fixes https://github.com/llvm/llvm-project/issues/54912. Issues seen with the previous land will be fixed in the next commit. Reviewed By: #lld-macho, thevinster, oontvoo Differential Revision: https://reviews.llvm.org/D142916 | 3 年前 | |
[lld,test] Fix few FileCheck annotation typos (#92238) | 2 年前 | |
[lld-macho] Make relative method lists work on x86-64 (#103905) Local data is referenced in Objective-C metadata via section + offset relocations on x86-64 rather than via symbols. Without this change, we would crash on incorrect casts of the referents to Defined. A basic test based on the existing objc-relative-method-lists-simple.s adopted to x86-64 is added. | 1 年前 | |
[LLD, MachO] Default objc_relative_method_lists on MacOS10.16+/iOS14+ (#104519) This patch makes -objc_relative_method_lists default on MacOS 10.16+/iOS 14+. Manual override still work if command line argument is provided. To test this change, many explict arguments are removed from the test files. Some explict -objc_no_objc_relative_method_lists are also added for tests that don't support this yet. This commit tries to revive #101360, which exposes a bug that breaks CI. #104081 has fixed that bug. | 1 年前 | |
Reapply "[lld] enable fixup chains by default (#79894)" (#99255) This reverts commit f55b79f59a77b4be586d649e9ced9f8667265011. The known issues with chained fixups have been addressed by #98913, #98305, #97156 and #95171. Compared to the original commit, support for xrOS (which postdates chained fixups' introduction) was added and an unnecessary test change was removed. ---------- Original commit message: Enable chained fixups in lld when all platform and version criteria are met. This is an attempt at simplifying the logic used in ld 907: https://github.com/apple-oss-distributions/ld64/blob/93d74eafc37c0558b4ffb88a8bc15c17bed44a20/src/ld/Options.cpp#L5458-L5549 Some changes were made to simplify the logic: - only enable chained fixups for macOS from 13.0 to avoid the arch check - only enable chained fixups for iphonesimulator from 16.0 to avoid the arch check - don't enable chained fixups for not specifically listed platforms - don't enable chained fixups for arm64_32 | 1 年前 | |
[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] Fix -ObjC load behavior with LTO for section names with whitespace (#146654) This is a fix additional to #92162 In some cases, section names contain a whitespace between the segment name and the actual section name (e.g. __TEXT, __swift5_proto). It is confirmed by source code of the Swift compiler This fix allows LTO to work correctly with the -ObjC flag in that rare case when only a section with a whitespace in the name is present in the linked bitcode module, but there are no sections containing __TEXT,__swift --------- Co-authored-by: Ураков Александр Сергеевич <a.urakov@tbank.ru> Co-authored-by: Ellis Hoag <ellis.sparky.hoag@gmail.com> | 1 年前 | |
[lld][MachO] Tail merge strings (#161262) Add the flag --tail-merge-strings to enable tail merging of cstrings. For example, if we have strings mystring\0 and ring\0, we could place mystring\0 at address 0x1000 and ring\0 at address 0x1004 and have them share the same underlying data. It turns out that many ObjC method names can be tail merged. For example, error: and doFoo:error:. On a large iOS binary, we saw nearly a 15% size improvement in the __TEXT__objc_methname section and negligible impact on link time. $ bloaty --domain=vm merged.o.stripped -- base.o.stripped VM SIZE -------------- +95% +5.85Ki [__TEXT] -2.4% -239Ki __TEXT,__cstring -14.5% -710Ki __TEXT,__objc_methname -1.0% -944Ki TOTAL Tail merging for MachO was originally removed in https://github.com/llvm/llvm-project/commit/7c269db779ff3950bac2e25ea78b14b4e2b8b247. The previous implementation used StringTableBuilder, but that was removed in https://github.com/llvm/llvm-project/commit/4308f031cd0c679c539914608134b9c8046743b3 to ensure deduplicated strings are aligned correctly. This implementation ensures that tail merged strings are also aligned correctly. Special thanks to nocchijiang for pointing this out in https://github.com/llvm/llvm-project/pull/158720#issuecomment-3310416030. Depends on https://github.com/llvm/llvm-project/pull/161253. | 9 个月前 | |
[lld][MachO] Read cstring order for non deduped sections (#161879) https://github.com/llvm/llvm-project/pull/140307 added support for cstring hashes in the orderfile to layout cstrings in a specific order, but only when --deduplicate-strings is used. This PR supports cstring ordering when --no-deduplicate-strings is used. 1. Create cStringPriorities, separate from priorities, to hold only priorities for cstring pieces. This allows us to lookup by hash directly, instead of first converting to a string. It also fixes a contrived bug where we want to order a symbol named CSTR;12345 rather than a cstring. 2. Rather than calling buildCStringPriorities() which always constructs and returns a vector, we use forEachStringPiece() to efficiently iterate over cstring pieces without creating a new vector if no cstring is ordered. 3. Create SymbolPriorityEntry::{get,set}Priority() helper functions to simplify code. | 8 个月前 | |
[lld][macho] fix test failure by adding # REQUIRES: aarch64 (#142649) fix the test failures caused by https://github.com/llvm/llvm-project/pull/140670 https://lab.llvm.org/buildbot/#/builders/144/builds/26745 FAIL: lld::order-file-strip-hashes.s [view all 14 lines](https://lab.llvm.org/buildbot/#/builders/144/builds/26745/steps/6/logs/FAIL__lld__order-file-strip-hashes_s) ******************** TEST 'lld :: MachO/order-file-strip-hashes.s' FAILED ******************** Exit Code: 1 Command Output (stderr): -- rm -rf /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/lld/test/MachO/Output/order-file-strip-hashes.s.tmp && split-file /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/lld/test/MachO/order-file-strip-hashes.s /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/lld/test/MachO/Output/order-file-strip-hashes.s.tmp # RUN: at line 1 + rm -rf /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/lld/test/MachO/Output/order-file-strip-hashes.s.tmp + split-file /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/lld/test/MachO/order-file-strip-hashes.s /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/lld/test/MachO/Output/order-file-strip-hashes.s.tmp /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/llvm-mc -filetype=obj -triple=arm64-apple-darwin /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/lld/test/MachO/Output/order-file-strip-hashes.s.tmp/a.s -o /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/lld/test/MachO/Output/order-file-strip-hashes.s.tmp/a.o # RUN: at line 2 + /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/llvm-mc -filetype=obj -triple=arm64-apple-darwin /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/lld/test/MachO/Output/order-file-strip-hashes.s.tmp/a.s -o /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/lld/test/MachO/Output/order-file-strip-hashes.s.tmp/a.o /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/llvm-mc: error: unable to get target for 'arm64-apple-darwin', see --version and --triple. Co-authored-by: Sharon Xu <sharonxu@fb.com> | 1 年前 | |
[lld/mac] Don't crash on absolute symbols in order files Absolute symbols have a nullptr isec. buildInputSectionPriorities() would defer isec, causing crashes. Ordering absolute symbols doesn't make sense, so just ignore them. This seems to match ld64. Differential Revision: https://reviews.llvm.org/D106628 | 4 年前 | |
[lld-macho][nfc] Rename %no_fatal_warnings_lld in tests ... to use hyphens instead of underscores, making it consistent with our other substitutions like %no-arg-lld and %lld-watchos. Reviewed By: keith Differential Revision: https://reviews.llvm.org/D119513 | 4 年前 | |
[InstrProf] No linkage prefixes in IRPGO names (#76994) Change the format of IRPGO counter names to [<filepath>;]<mangled-name> which is computed by GlobalValue::getGlobalIdentifier() to fix #74565. In fe051934cbb0aaf25d960d7d45305135635d650b (https://reviews.llvm.org/D156569) the format of IRPGO counter names was changed to be [<filepath>;]<linkage-name> where <linkage-name> is basically F.getName() with some prefix, e.g., _ or l_ on Mach-O (yes, it is confusing that <linkage-name> is computed with Mangler().getNameWithPrefix() while <mangled-name> is just F.getName()). We discovered in #74565 that this causes some missed import issues on some targets and #74008 is a partial fix. Since <mangled-name> may not match the <linkage-name> on some targets like Mach-O, we will need to post-process the output of llvm-profdata order before passing to the linker via -order_file. Profiles generated after fe051934cbb0aaf25d960d7d45305135635d650b will become stale after this diff, but I think this is acceptable since that patch landed after the LLVM 18 cut which hasn't been released yet. | 2 年前 | |
[lld] Adds support for xros. (#83031) | 2 年前 | |
[lld-macho][NFC] Purge stale test-output trees prior to split-file Enforce standard practice Differential Revision: https://reviews.llvm.org/D102112 | 5 年前 | |
[lld] Reject --read-workers when lld is built without thread support (#163925) Also expand the #ifdef to remove unused code in this configuration. As suggested in https://github.com/llvm/llvm-project/pull/147134#issuecomment-3328612158. I have also: * Expanded the error message to explain why it's not allowed. * Added a test for the error. * Marked the original test as unsupported when threads are disabled. Fixes issues we have had on Armv8 with threading disabled where this test would crash every so often. This change will hopefully be superseded by #157917, but that has been in review a long time and I want to make the bot stable again. I could just disable the test, but I'd like lld to function properly in general in the meantime too. Co-authored-by: John Holdsworth <github@johnholdsworth.com> | 9 个月前 | |
[lld][MachO] Disable read-workers.s test eveywhere The ASAN bot failed on my previous fix for builds without threading support: https://lab.llvm.org/buildbot/#/builders/24/builds/13751 However that build does have threading enabled, so I do not think my change is the cause. I think the cause is what #157917 will address: > The new PR moves to use madvise() instead of the ad-hoc page referencing code I wrote which should avoid SIGSEGVs if the buffer is deallocated. While that is being reviewed, do not run this test anywhere. Though the failure I saw was with ASAN, I think it could happen anywhere. | 9 个月前 | |
[lld-macho] Optimize rebase opcode generation This commit reduces the size of the emitted rebase sections by generating the REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB and REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB opcodes. With this change, chromium_framework's rebase section is a 40% smaller 197 kilobytes, down from the previous 320 kB. That is 6 kB smaller than what ld64 produces for the same input. Performance figures from my M1 Mac mini: x before + after N Min Max Median Avg Stddev x 10 4.2269349 4.3300061 4.2689675 4.2690016 0.031151669 + 10 4.219331 4.2914009 4.2398136 4.2448277 0.023817308 No difference proven at 95.0% confidence Differential Revision: https://reviews.llvm.org/D130180 | 3 年前 | |
[lld-macho] Implement -no_implicit_dylibs Dylibs that are "public" -- i.e. top-level system libraries -- are considered implicitly linked when another library re-exports them. That is, we should load them & bind directly to their symbols instead of via their re-exporting umbrella library. This diff implements that behavior by default, as well as an opt-out flag. In theory, this is just a performance optimization, but in practice it seems that it's needed for correctness. Fixes llvm.org/PR48395. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D93000 | 5 年前 | |
| 1 年前 | ||
[lld] Remove shell requirements from tests These tests all pass inside the lit internal shell. A couple were marked as requiring a shell to exclude them on Windows. Update those tests to explicitly carve out Windows rather than any configuration that does not provide the shell feature. Towards #102700. Reviewers: petrhosek, cmtice, mysterymath, MaskRay, ilovepi Reviewed By: cmtice Pull Request: https://github.com/llvm/llvm-project/pull/156510 | 10 个月前 | |
[lld] Remove shell requirements from tests These tests all pass inside the lit internal shell. A couple were marked as requiring a shell to exclude them on Windows. Update those tests to explicitly carve out Windows rather than any configuration that does not provide the shell feature. Towards #102700. Reviewers: petrhosek, cmtice, mysterymath, MaskRay, ilovepi Reviewed By: cmtice Pull Request: https://github.com/llvm/llvm-project/pull/156510 | 10 个月前 | |
fix typos to cycle bots | 4 年前 | |
[MachO] Remove redundant .section directive See https://reviews.llvm.org/D153382#inline-1483291 | 3 年前 | |
[lld][MachO] Fix typo in rename.s | 4 年前 | |
[lld-macho,test] Adjust reproduce-thin-archive-objc.s When cd %t is used, it's conventional to move it above and omit -o /dev/null. We don't check the string before warning: since (a) the string is not very useful and (b) downstream might customize ctx->e.logName (argv[0]). count 0 is better than --allow-empty. In addition, without 2>&1 the previous test was effective. | 2 年前 | |
[lld-macho] Save all thin archive members in repro tarball (#97169) Previously, we only saved those members of thin archives into a repro file that were actually used during linking. However, -ObjC handling requires us to inspect all members, even those that don't end up being loaded. We weren't handling missing members correctly and crashed with an "unhandled Error" failure in LLVM_ENABLE_ABI_BREAKING_CHECKS builds. To fix this, we now eagerly load all object files and warn when encountering missing members (in the instances where it wasn't a hard error before). To avoid having to patch out the checks when dealing with older repro files, the --no-warn-thin-archive-missing-members flag is added as an escape hatch. | 2 年前 | |
[lld] Remove shell requirements from tests These tests all pass inside the lit internal shell. A couple were marked as requiring a shell to exclude them on Windows. Update those tests to explicitly carve out Windows rather than any configuration that does not provide the shell feature. Towards #102700. Reviewers: petrhosek, cmtice, mysterymath, MaskRay, ilovepi Reviewed By: cmtice Pull Request: https://github.com/llvm/llvm-project/pull/156510 | 10 个月前 | |
Reland "[lld-macho] Implement -load_hidden" This flag was introduced in ld64-609. It instructs the linker to link to a static library while treating its symbols as if they had hidden visibility. This is useful when building a dylib that links to static libraries but we don't want the symbols from those to be exported. Closes #51505 This reland adds bitcode file handling, so we won't get any compile errors due to BitcodeFile::forceHidden being unused. Differential Revision: https://reviews.llvm.org/D130473 | 3 年前 | |
[mac/lld] Add support for response files ld64 learned about them in Xcode 12, so we should too. Differential Revision: https://reviews.llvm.org/D92149 | 5 年前 | |
[lld-macho] Ignore duplicate -rpath entries (#99289) Starting with Xcode 16 (dyld-1122), Apple's binary utilities, e.g. dyld_info (but not dyld itself), will refuse to load binaries built against the macOS 15 SDK or newer that contain the same LC_RPATH entry multiple times: https://github.com/apple-oss-distributions/dyld/blob/rel/dyld-1122/mach_o/Policy.cpp#L246-L249 ld-prime deduplicates entries (regardless of the deployment target), we now do the same. We also match ld-prime's and ld64's behavior by warning on duplicate -rpath arguments. This can be disabled by the LLD-specific --no-warn-duplicate-rpath flag. | 2 年前 | |
[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 年前 | |
[lld-macho][test] Add -lSystem to all lld invocations This is a requirement from ld64, so this mirrors that expectation. Most of these changes were just offsets from adding the library, or adding dyld_stub_binder which is always added when linking ld64. This also adds %no-lsystem-lld for the few cases where we're explicitly testing things without that. Fixes: https://github.com/llvm/llvm-project/issues/54184 Differential Revision: https://reviews.llvm.org/D135193 | 3 年前 | |
[lld/mac] Implement -sectalign clang sometimes passes this flag along (see D68351), so we should implement it. Differential Revision: https://reviews.llvm.org/D102247 | 5 年前 | |
[lld-macho] Add support for -add_empty_section This is a ld64 option equivalent to -sectcreate seg sect /dev/null that's useful for creating sections like the RESTRICT section. Differential Revision: https://reviews.llvm.org/D117749 | 4 年前 | |
[lld-macho] Ensure segments are laid out contiguously codesign/libstuff checks that the __LLVM segment is directly before __LINKEDIT by checking that fileOff + fileSize == next segment fileOff. Previously, there would be gaps between the segments due to the fact that their fileOffs are page-aligned but their fileSizes aren't. In order to satisfy codesign, we page-align fileOff *before* calculating fileSize. (I don't think codesign checks for the relative ordering of other segments, so in theory we could do this just for __LLVM, but ld64 seems to do it for all segments.) Note that we *don't* round up the fileSize of the __LINKEDIT segment. Since it's the last segment, it doesn't need to worry about contiguity; in addition, codesign checks that the last (hidden) section in __LINKEDIT covers the last byte of the segment, so if we rounded up __LINKEDIT's size we would have to do the same for its last section, which is a bother. While at it, I also addressed a FIXME in the linkedit-contiguity.s test to cover more __LINKEDIT sections. Reviewed By: #lld-macho, thakis, alexshap Differential Revision: https://reviews.llvm.org/D100848 | 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-macho] Fix thunks for non-__text TEXT sections (#99052) This supersedes https://github.com/llvm/llvm-project/pull/87818 and fixes https://github.com/llvm/llvm-project/issues/52767 When calculating arm64 thunks, we make a few assumptions that may not hold when considering code sections outside of __text: 1. That a section needs thunks only if its size is larger than the branch range. 2. That any calls into __stubs are necessarily forward jumps (that is, the section with the jump is ordered before __stubs) Sections like this exist in the wild, most prominently the __lcxx_overrides section introduced in https://github.com/llvm/llvm-project/pull/69498 This change: - Ensures that if one section in __TEXT gets thunks, all of them do. - Makes all code sections in __TEXT contiguous (and guaranteed to be placed before __stubs) | 1 年前 | |
[lld-macho] Ensure segments are laid out contiguously codesign/libstuff checks that the __LLVM segment is directly before __LINKEDIT by checking that fileOff + fileSize == next segment fileOff. Previously, there would be gaps between the segments due to the fact that their fileOffs are page-aligned but their fileSizes aren't. In order to satisfy codesign, we page-align fileOff *before* calculating fileSize. (I don't think codesign checks for the relative ordering of other segments, so in theory we could do this just for __LLVM, but ld64 seems to do it for all segments.) Note that we *don't* round up the fileSize of the __LINKEDIT segment. Since it's the last segment, it doesn't need to worry about contiguity; in addition, codesign checks that the last (hidden) section in __LINKEDIT covers the last byte of the segment, so if we rounded up __LINKEDIT's size we would have to do the same for its last section, which is a bother. While at it, I also addressed a FIXME in the linkedit-contiguity.s test to cover more __LINKEDIT sections. Reviewed By: #lld-macho, thakis, alexshap Differential Revision: https://reviews.llvm.org/D100848 | 5 年前 | |
[lld/mac] Allow -segprot having stricter initprot than maxprot on mac (#107269) ...including for catalyst. The usecase for this is to put certain security-critical variables into a special segment/section that's mapped as read-only most of the time, and that temporary gets remapped as writeable when these variables are written to be the program. This protects against them being written to by heap spraying attacks. This special section should be mapped as read-only at program start, so using -segprot MY_PROTECTED_MEMORY_THINGER rw r to mark that segment as rw maxprot and r initprot is exactly what we want. lld has so far rejected mismatching initprot and maxprot. ld64 doesn't reject this, but silently writes initprot into both fields (!) It looks like this might not be fully intentional, see https://crbug.com/41495919#comment5 and http://crbug.com/41495919#comment8. In any case, when postprocessing ld64's output to have different values for initprot and maxprot, the dynamic loader seems to do the right thing (see also the previous two links). The same technique also works on Windows, using both link.exe and lld-link.exe using /SECTION:myprotsect,R. So, since this is useful, allow it when targeting macOS, and make it do what you'd expect. Since loader support for this on iOS is less clear, keep disallowing it there for now. See the PR for the program I used to check that this seems to work. (I only checked on arm64 macOS 14.5 so far; will run this on many more systems on bots once this is merged and rolled in.) | 1 年前 | |
[lld-macho] Ignore -no_warn_duplicate_libraries flag (#86303) This is a new ld64 flag (along with -warn_duplicate_libraries), where the warning is enabled by default, and it can be useful to ignore since it can be hard to dedup library flags across large builds. This doesn't ignore the enabling version since if someone manually passed that and lld didn't respect it, we probably want the user to know that. | 2 年前 | |
[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 年前 | |
[lld-macho][nfc] Clean up trailing spaces and tabs | 4 年前 | |
[lld-macho] Standardize error messages Errors / warnings that originate from a particular file should be of the form $file: $message. Reviewed By: #lld-macho, keith Differential Revision: https://reviews.llvm.org/D140634 | 3 年前 | |
[lld-macho] Standardize error messages Errors / warnings that originate from a particular file should be of the form $file: $message. Reviewed By: #lld-macho, keith Differential Revision: https://reviews.llvm.org/D140634 | 3 年前 | |
Re-apply "Revert "[DebugInfo] Add error checking around data extraction in DWARFAbbreviationDeclaration::extract"" This reverts commit 11d61c079d4b4927efea42a38a27d4586887b764 to re-apply 6836a47b7e6b57927664ec6ec750ae37bb951129 with modifications. Specifically, the errors in DWARFAbbreviationDeclaration::extract needed to be moved as they are returned to ensure the right Error constructor is selected. | 3 年前 | |
[lld-macho] Add flag --keep-icf-stabs to LLD for MachO (#93137) This change adds the --keep-icf-stabs which, when specified, preserves symbols that were folded by ICF in the binary's stabs entries. This allows dsymutil to process debug information for the folded symbols. | 2 年前 | |
[lld] Update tests redirecting multiple commands to FileCheck This patch updates two LLD tests that were redirecting multiple commands to the same FileCheck invocation to not use this strategy. This construction is not supported by lit's internal shell and given its rarirty, it does not make sense to add support. The workaround is to dump the contents of multiple commands into a file and then run FileCheck on that. Towards #102700. Reviewers: petrhosek, mysterymath, cmtice, ilovepi, carlocab, MaskRay Reviewed By: carlocab, cmtice Pull Request: https://github.com/llvm/llvm-project/pull/156526 | 10 个月前 | |
[InstrProf] Remove -forder-file-instrumentation (#130192) | 1 年前 | |
[MachO LLD] Respect -all_load with --start-lib --end-lib style archives (#93993) The -all_load flag is intended to force the linker to load all lazy members, but doesn't do so if the archive is specified with --start-lib, --end-lib flags. The -all_load flag is global, that is it can be placed anywhere in the linker invocation, and it affects the load behavior of all conventional archives listed. Unlike ELF's --whole-archive, the user need not necessarily have access to the entire linker invocation to reasonably make use of the flag. The user can supply -all_load to a build system without inspecting the rest of the linker invocation. To make the behavior of --start-lib style archives consistent with regular archives, this patch makes it so that -all_load also applies in this case. | 2 年前 | |
[llvm-objdump] Print memory operand addresses as regular comments The patch reuses the common code to print memory operand addresses as instruction comments. This helps to align the comments and enables using target-specific comment markers when evaluateMemoryOperandAddress() is implemented for them. Differential Revision: https://reviews.llvm.org/D104861 | 5 年前 | |
[lld-macho] Don't double emit reexported libraries (#132275) When a library is specified with both -l and -reexport_libraries, lld will emit two load commands for it, in contrast with ld64. In an upcoming version of macOS, this fails dyld validation; see https://crbug.com/404905688 --------- Co-authored-by: Mark Rowe <markrowe@chromium.org>> | 1 年前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
[lld-macho] Stricter Bitcode Symbol Resolution LLD resolves symbols before performing LTO compilation, assuming that the symbols in question are resolved by the resulting object files from LTO. However, there is a scenario where the prevailing symbols might be resolved incorrectly due to specific assembly symbols not appearing in the symbol table of the bitcode. This patch deals with such a scenario by generating an error instead of silently allowing a mis-linkage. If a prevailing symbol is resolved through post-loaded archives via LC linker options, a warning will now be issued. Reviewed By: #lld-macho, thevinster Differential Revision: https://reviews.llvm.org/D158003 | 2 年前 | |
[lld-macho] Stricter Bitcode Symbol Resolution LLD resolves symbols before performing LTO compilation, assuming that the symbols in question are resolved by the resulting object files from LTO. However, there is a scenario where the prevailing symbols might be resolved incorrectly due to specific assembly symbols not appearing in the symbol table of the bitcode. This patch deals with such a scenario by generating an error instead of silently allowing a mis-linkage. If a prevailing symbol is resolved through post-loaded archives via LC linker options, a warning will now be issued. Reviewed By: #lld-macho, thevinster Differential Revision: https://reviews.llvm.org/D158003 | 2 年前 | |
[lld-macho][nfc] Rename some tests for consistency Now all the tests that cover symbol resolution / precedence have "resolution" in their filename. I also added a couple of extra comments. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D120938 | 4 年前 | |
[lld][macho]Fix test to sort symbol table before dumping Details: The test previously expected a specific order of those symbols, which is not guaranteed (could change simply due to hashing changes, etc). So we change it to explicitly sort the symbols before checking contents. PR/53026 Differential Revision: https://reviews.llvm.org/D116813 | 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 年前 | |
[lld-macho][nfc] Clean up tests * Remove unnecessary rm -rf %ts * Have lc-linker-option.ll use the right comment marker | 5 年前 | |
[lld-macho][nfc] Rename some tests "stub" is a bit too overloaded... we were using it to refer to TAPI files, but it's also the name for the PLT trampolines in Mach-O. Going ahead, let's just use "TAPI" or ".tbd" to refer to TAPI stuff. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D99807 | 5 年前 | |
[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] Remove duplicate minimum version info At some point PlatformInfo's Target changed types to a type that also has minimum deployment target info. This caused ambiguity if you tried to get the target triple from the Target, as the actual minimum version info was being stored separately. This bulk of this change is changing the parsing of these values to support this. Differential Revision: https://reviews.llvm.org/D145263 | 3 年前 | |
[lld] Remove shell requirements from tests These tests all pass inside the lit internal shell. A couple were marked as requiring a shell to exclude them on Windows. Update those tests to explicitly carve out Windows rather than any configuration that does not provide the shell feature. Towards #102700. Reviewers: petrhosek, cmtice, mysterymath, MaskRay, ilovepi Reviewed By: cmtice Pull Request: https://github.com/llvm/llvm-project/pull/156510 | 10 个月前 | |
[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 年前 | |
Make WriteIndexesThinBackend multi threaded (#109847) We've noticed that for large builds executing thin-link can take on the order of 10s of minutes. We are only using a single thread to write the sharded indices and import files for each input bitcode file. While we need to ensure the index file produced lists modules in a deterministic order, that doesn't prevent us from executing the rest of the work in parallel. In this change we use a thread pool to execute as much of the backend's work as possible in parallel. In local testing on a machine with 80 cores, this change makes a thin-link for ~100,000 input files run in ~2 minutes. Without this change it takes upwards of 10 minutes. --------- Co-authored-by: Nuri Amari <nuriamari@fb.com> | 1 年前 | |
Reapply: Use an abbrev to reduce size of VALUE_GUID records in ThinLTO summaries (#106165) This retries #90692 which was reverted previously due to issues with lld-available being set, even if the copy of lld is not built from source. This does not change any code compared to #90692 to address the lld-available issue. The main change w.r.t, lld-available is xfailing tests in PR #99056 (until a longer term fix is available). | 1 年前 | |
[lld] Support separate native object file path in --thinlto-prefix-replace Currently, the --thinlto-prefix-replace="oldpath;newpath" option is used during distributed ThinLTO thin links to specify the mapping of the input bitcode object files' directory tree (oldpath) to the directory tree (newpath) used for both: 1) the output files of the thin link itself (the .thinlto.bc index files and the optional .imports files) 2) the specified object file paths written to the response file given in the --thinlto-index-only=${response} option, which is used by the final native link and must match the paths of the native object files that will be produced by ThinLTO backend compiles. This patch expands the --thinlto-prefix-replace option to allow a separate directory tree mapping to be specified for the object file paths written to the response file (number 2 above). This is important to support builds and build systems where the same output directory may not be written by multiple build actions (e.g. the thin link and the ThinLTO backend compiles). The new format is: --thinlto-prefix-replace="origpath;outpath[;objpath]" This replaces the origpath directory tree of the thin link input files with outpath when writing the thin link index and imports outputs (number 1 above). If objpath is specified it replaces origpath of the input files with objpath when writing the response file (number 2 above), otherwise it falls back to the old behavior of using outpath for this as well. Reviewed By: tejohnson, MaskRay Differential Revision: https://reviews.llvm.org/D144596 | 3 年前 | |
[lld/mac] Add support for distributed ThinLTO Adds support for the following flags: * --thinlto-index-only, --thinlto-index-only= * --thinlto-emit-imports-files * --thinlto-emit-index-files * --thinlto-object-suffix-replace= * --thinlto-prefix-replace= See https://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html for some words on --thinlto-index-only. I don't really need the other flags, but they were in the vicinity and _someone_ might need them, so I figured I'd add them too. -object_path_lto now sets c.AlwaysEmitRegularLTOObj as in the other ports, which means it can now only point to a filename for non-thin LTO. I think that was the intent of D129705 anyways, so update test/MachO/lto-object-path.ll to use a non-thin bitcode file for that test. Differential Revision: https://reviews.llvm.org/D138451 | 3 年前 | |
Reapply: Use an abbrev to reduce size of VALUE_GUID records in ThinLTO summaries (#106165) This retries #90692 which was reverted previously due to issues with lld-available being set, even if the copy of lld is not built from source. This does not change any code compared to #90692 to address the lld-available issue. The main change w.r.t, lld-available is xfailing tests in PR #99056 (until a longer term fix is available). | 1 年前 | |
[lld-macho] Support --thinlto-jobs The test is loosely based off LLD-ELF's thinlto.ll. However, I found that test questionable because the the -save_temps behavior it checks for is identical regardless of whether we are running in single- or multi-threaded mode. I tried writing a test based on --time-trace but couldn't get it to run deterministically... so I've opted to just skip checking that behavior for now. Reviewed By: #lld-macho, gkm Differential Revision: https://reviews.llvm.org/D99356 | 5 年前 | |
[lld/mac] Add support for distributed ThinLTO Adds support for the following flags: * --thinlto-index-only, --thinlto-index-only= * --thinlto-emit-imports-files * --thinlto-emit-index-files * --thinlto-object-suffix-replace= * --thinlto-prefix-replace= See https://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html for some words on --thinlto-index-only. I don't really need the other flags, but they were in the vicinity and _someone_ might need them, so I figured I'd add them too. -object_path_lto now sets c.AlwaysEmitRegularLTOObj as in the other ports, which means it can now only point to a filename for non-thin LTO. I think that was the intent of D129705 anyways, so update test/MachO/lto-object-path.ll to use a non-thin bitcode file for that test. Differential Revision: https://reviews.llvm.org/D138451 | 3 年前 | |
[lld/mac] Add support for distributed ThinLTO Adds support for the following flags: * --thinlto-index-only, --thinlto-index-only= * --thinlto-emit-imports-files * --thinlto-emit-index-files * --thinlto-object-suffix-replace= * --thinlto-prefix-replace= See https://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html for some words on --thinlto-index-only. I don't really need the other flags, but they were in the vicinity and _someone_ might need them, so I figured I'd add them too. -object_path_lto now sets c.AlwaysEmitRegularLTOObj as in the other ports, which means it can now only point to a filename for non-thin LTO. I think that was the intent of D129705 anyways, so update test/MachO/lto-object-path.ll to use a non-thin bitcode file for that test. Differential Revision: https://reviews.llvm.org/D138451 | 3 年前 | |
[lld/mac] Add support for distributed ThinLTO Adds support for the following flags: * --thinlto-index-only, --thinlto-index-only= * --thinlto-emit-imports-files * --thinlto-emit-index-files * --thinlto-object-suffix-replace= * --thinlto-prefix-replace= See https://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html for some words on --thinlto-index-only. I don't really need the other flags, but they were in the vicinity and _someone_ might need them, so I figured I'd add them too. -object_path_lto now sets c.AlwaysEmitRegularLTOObj as in the other ports, which means it can now only point to a filename for non-thin LTO. I think that was the intent of D129705 anyways, so update test/MachO/lto-object-path.ll to use a non-thin bitcode file for that test. Differential Revision: https://reviews.llvm.org/D138451 | 3 年前 | |
[IR] Change representation of getelementptr inrange (#84341) As part of the migration to ptradd (https://discourse.llvm.org/t/rfc-replacing-getelementptr-with-ptradd/68699), we need to change the representation of the inrange attribute, which is used for vtable splitting. Currently, inrange is specified as follows: getelementptr inbounds ({ [4 x ptr], [4 x ptr] }, ptr @vt, i64 0, inrange i32 1, i64 2) The inrange is placed on a GEP index, and all accesses must be "in range" of that index. The new representation is as follows: getelementptr inbounds inrange(-16, 16) ({ [4 x ptr], [4 x ptr] }, ptr @vt, i64 0, i32 1, i64 2) This specifies which offsets are "in range" of the GEP result. The new representation will continue working when canonicalizing to ptradd representation: getelementptr inbounds inrange(-16, 16) (i8, ptr @vt, i64 48) The inrange offsets are relative to the return value of the GEP. An alternative design could make them relative to the source pointer instead. The result-relative format was chosen on the off-chance that we want to extend support to non-constant GEPs in the future, in which case this variant is more expressive. This implementation "upgrades" the old inrange representation in bitcode by simply dropping it. This is a very niche feature, and I don't think trying to upgrade it is worthwhile. Let me know if you disagree. | 2 年前 | |
[lld-macho] Add time tracing for LTO The test is similar to the one used for LLD-ELF. Differential Revision: https://reviews.llvm.org/D99318 | 5 年前 | |
[lld-macho] Add support for --threads Code and test are largely identical to the LLD-ELF equivalents. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D99312 | 5 年前 | |
[lld, ELF and mac] Add --time-trace=<file>, remove --time-trace-file=<file> --time-trace=foo has the same behavior as --time-trace --time-trace-file=<file> had previously. Also, for mac, make --time-trace-granularity *not* imply --time-trace, to match behavior of the ELF port. Differential Revision: https://reviews.llvm.org/D128451 | 4 年前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
[lld-macho] Fix alignment of TLV data sections References from thread-local variable sections are treated as offsets relative to the start of the thread-local data memory area, which is initialized via copying all the TLV data sections (which are all contiguous). If later data sections require a greater alignment than earlier ones, the offsets of data within those sections won't be guaranteed to aligned unless we normalize alignments. We therefore use the largest alignment for all TLV data sections. Reviewed By: #lld-macho, int3 Differential Revision: https://reviews.llvm.org/D116263 | 4 年前 | |
[lld/mac] Abort link immediately on invalid -undefined argument I tried -undefined suppress without -flat_namespace. lld printed '-undefined suppress' only valid with '-flat_namespace' followed by many many screenfuls of error messages about undefined symbols, making the original diag hard to see. This is probably the common case when using -undefined, so let's just abort the link immediately when there's an invalid -undefined arg. Differential Revision: https://reviews.llvm.org/D139559 | 3 年前 | |
[lld-macho][test] Simplify --allow-empty with count 0 | 5 年前 | |
[lld-macho][nfc] Rename %no_fatal_warnings_lld in tests ... to use hyphens instead of underscores, making it consistent with our other substitutions like %no-arg-lld and %lld-watchos. Reviewed By: keith Differential Revision: https://reviews.llvm.org/D119513 | 4 年前 | |
[lld/mac] Add test for bug fixed in reland 82ca390062d115 Differential Revision: https://reviews.llvm.org/D135889 | 3 年前 | |
Reland "[lld/mac] Port typo correction for undefined symbols from ELF port" The only difference in the reland is that the loop at the top of getAlternativeSpelling() now calls dyn_cast_or_null() instead of dyn_cast() -- a file's symbols list can contain null entries. The test for this might be slightly involved, so I'll land it in a follow-up, to make the reland similar to the original commit. Originally reviewed at: Differential Revision: https://reviews.llvm.org/D135038 This reverts commit 317b5582b813c51d1fb6723fd44b227b7f274bc7. | 3 年前 | |
Reland "[lld/mac] Port typo correction for undefined symbols from ELF port" The only difference in the reland is that the loop at the top of getAlternativeSpelling() now calls dyn_cast_or_null() instead of dyn_cast() -- a file's symbols list can contain null entries. The test for this might be slightly involved, so I'll land it in a follow-up, to make the reland similar to the original commit. Originally reviewed at: Differential Revision: https://reviews.llvm.org/D135038 This reverts commit 317b5582b813c51d1fb6723fd44b227b7f274bc7. | 3 年前 | |
[lld-macho][nfc] Add REQUIRES: x86 to test I didn't realize that llvm-objdump's features were arch-specific. This should fix the non-x86 buildbots. | 4 年前 | |
[lld-macho] Implement -no_uuid Since UUID generation in lld is fast this is rarely used but it can be helpful to avoid temporary issues like https://github.com/llvm/llvm-project/issues/63961 Differential Revision: https://reviews.llvm.org/D155735 | 2 年前 | |
[lld][MachO] Add --disable_verify flag (#132105) The --disable_verify flag is implemented for ELF and is used to disable LLVM module verification. https://github.com/llvm/llvm-project/blob/93afd8f9ac69d08bd743ef668c59403362c05d7a/lld/ELF/Options.td#L661 This allows us to quickly suppress verification errors. | 1 年前 | |
[lld:MachO] Allow independent override of weak symbols aliased via .set (#167825) Currently, if multiple external weak symbols are defined at the same address in an object file (e.g., by using the .set assembler directive to alias them to a single weak variable), ld64.lld treats them as a single unit. When any one of these symbols is overridden by a strong definition, all of the original weak symbols resolve to the strong definition. This patch changes the behavior in transplantSymbolsAtOffset. When a weak symbol is being replaced by a strong one, only non-external (local) symbols at the same offset are moved to the new symbol's section. Other *external* symbols are no longer transplanted. This allows each external weak symbol to be overridden independently. This behavior is consistent with Apple's ld-classic, but diverges from ld-prime in one case, as noted on https://github.com/llvm/llvm-project/issues/167262 (this discrepancy has recently been reported to Apple). ### Backward Compatibility This change alters linker behavior for a specific scenario. The creation of multiple external weak symbols aliased to the same address via assembler directives is primarily an advanced technique. It's unlikely that existing builds rely on the current behavior of all aliases being overridden together. If there are concerns, this could be put behind a linker option, but the new default seems more correct, less surprising, and is consistent with ld-classic. ### Testing The new lit test test/MachO/weak-alias-override.s verifies this behavior using llvm-nm. Fixes #167262 | 8 个月前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
[lld-macho] Prevent assertions for aliases to weak_def_can_be_hidden symbols In https://reviews.llvm.org/D137982 we found that on Mach-O private aliases could trigger an assert in lld when the aliasee was a weak_def_can_be_hidden symbol. This appears to be incorrect, and should be allowed in Mach-O. Disallowing this behavior is also inconsistent with how ld64 handles a private alias to weak_def_can_be_hidden symbols. This patch removes the assert and tests that LLD handles such aliases gracefully. Reviewed By: #lld-macho, int3 Differential Revision: https://reviews.llvm.org/D141082 | 3 年前 | |
[lld-macho] Add --start-lib --end-lib In ld.lld, when an ObjFile/BitcodeFile is read in --start-lib state, the file is given archive semantics. --end-lib closes the previous --start-lib. A build system can use this feature as an alternative to archives. This patch ports the feature to lld-macho. --start-lib and --end-lib are positional, unlike usual ld64 options. I think the slight drawback does not matter as (a) reusing option names make build systems convenient (b) --start-lib a.o b.o --end-lib conveys more information than an alternative design: -objlib a.o -objlib b.o because --start-lib makes it clear which objects are in the same conceptual archive. This provides flexibility (c) -objlib/-filelist interaction may be weird. Close https://github.com/llvm/llvm-project/issues/52931 Reviewed By: #lld-macho, Jez Ng, oontvoo Differential Revision: https://reviews.llvm.org/D116913 | 4 年前 | |
[llvm][Object] set SF_Hidden flag for MachO files Reviewed By: pete, ributzka Differential Revision: https://reviews.llvm.org/D139862 | 3 年前 | |
[lld] Fix REQUIRES line in new test Noticed by chapuni: https://github.com/llvm/llvm-project/pull/67445#pullrequestreview-1645422024 Fixes a test failure if X86 isn't in LLVM_TARGETS_TO_BUILD. | 2 年前 | |
[lld/mac] Resolve defined symbols before undefined symbols Ports https://reviews.llvm.org/D95985 to the MachO port. Happens to fix PR51135; see that bug for details. Also makes lld's behavior match ld64 for the included test case. Differential Revision: https://reviews.llvm.org/D106293 | 4 年前 | |
[lld/mac] Remove unused -L%t flags from tests No behavior change. Differential Revision: https://reviews.llvm.org/D101623 | 5 年前 | |
[lld/mac] Remove unused -L%t flags from tests No behavior change. Differential Revision: https://reviews.llvm.org/D101623 | 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-macho][NFC] Purge stale test-output trees prior to split-file Enforce standard practice Differential Revision: https://reviews.llvm.org/D102112 | 5 年前 | |
[lld-macho][nfc] Clean up trailing spaces and tabs | 4 年前 | |
[lld/mac] slightly improve weak-private-extern.s test - __got is in --bind output, so print that too (makes the test a bit stronger) - WEAK_DEFINES, BINDS_TO_WEAK are in the mach-o header, so --private-header is enough, no need for --all-headers (makes the test a bit easier to work with when it fails) Differential Revision: https://reviews.llvm.org/D101065 | 5 年前 | |
[lld-macho] Add support for emitting chained fixups This commit adds support for chained fixups, which were introduced in Apple's late 2020 OS releases. This format replaces the dyld opcodes used for supplying rebase and binding information, and encodes most of that data directly in the memory location that will have the fixup applied. This reduces binary size and is a requirement for page-in linking, which will be available starting with macOS 13. A high-level overview of the format and my implementation can be found in SyntheticSections.h. This feature is currently gated behind the -fixup_chains flag, and will be enabled by default for supported targets in a later commit. Like in ld64, lazy binding is disabled when chained fixups are in use, and the -init_offsets transformation is performed by default. Differential Revision: https://reviews.llvm.org/D132560 | 3 年前 | |
[lld-macho] Implement -why_live (without perf overhead) This was based off @thakis' draft in {D103517}. I employed templates to ensure the support for -why_live wouldn't slow down the regular non-why-live code path. No stat sig perf difference on my 3.2 GHz 16-Core Intel Xeon W: base diff difference (95% CI) sys_time 1.195 ± 0.015 1.199 ± 0.022 [ -0.4% .. +1.0%] user_time 3.716 ± 0.022 3.701 ± 0.025 [ -0.7% .. -0.1%] wall_time 4.606 ± 0.034 4.597 ± 0.046 [ -0.6% .. +0.2%] samples 44 37 Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D120377 | 4 年前 | |
[lld-macho][nfc] Clean up tests * Remove unnecessary rm -rf %ts * Have lc-linker-option.ll use the right comment marker | 5 年前 | |
[lld-macho][test] Rename dtrace test (NFC) This matches the convention used elsewhere Differential Revision: https://reviews.llvm.org/D131456 | 3 年前 | |
[lld-macho] icf objc stubs (#79730) This supports icf for objc stubs. | 2 年前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
[llvm-objdump] Print memory operand addresses as regular comments The patch reuses the common code to print memory operand addresses as instruction comments. This helps to align the comments and enables using target-specific comment markers when evaluateMemoryOperandAddress() is implemented for them. Differential Revision: https://reviews.llvm.org/D104861 | 5 年前 | |
[lld-macho] Make everything PIE by default Modern versions of macOS (>= 10.7) and in general all modern Mach-O target archs want PIEs by default. ld64 defaults to PIE for iOS >= 4.3, as well as for all versions of watchOS and simulators. Basically all the platforms LLD is likely to target want PIE. So instead of cluttering LLD's code with legacy version checks, I think it's simpler to just default to PIE for everything. Note that -no_pie still works, so users can still opt out of it. Reviewed By: #lld-macho, thakis, MaskRay Differential Revision: https://reviews.llvm.org/D101513 | 5 年前 | |
[lld][macho] Support 1-byte branch relocs for x86_64 (#164439) | 9 个月前 | |
[llvm-objdump] Add --no-print-imm-hex to tests depending on it. This prepares for an upcoming change to make --print-imm-hex the default behavior of llvm-objdump. These tests were updated in a semi-automatic fashion. See D136972 for details. | 3 年前 | |
[lld-macho] Remove duplicate minimum version info At some point PlatformInfo's Target changed types to a type that also has minimum deployment target info. This caused ambiguity if you tried to get the target triple from the Target, as the actual minimum version info was being stored separately. This bulk of this change is changing the parsing of these values to support this. Differential Revision: https://reviews.llvm.org/D145263 | 3 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 10 个月前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 10 个月前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 10 个月前 | ||
| 4 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 10 个月前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 10 个月前 | ||
| 5 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 10 个月前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 9 个月前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 5 年前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 10 个月前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 10 个月前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 9 个月前 | ||
| 3 年前 | ||
| 3 年前 |