forked from rui314/mold
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pull] main from rui314:main #317
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The interaction between these flags are unnecessarily complicated, but it looks like `--undefined=ignore-in-object-files` needs to share the same internal flag as `-z defs` so that they override each other. Fixes #1270
Fix corrupted .riscv.attributes ISA string extension name can contain digits
Use $CXX instead of $CC to detect whether C++ programs could be built statically. Add function test_cxxflags for convenience. Fix test error in an environment where C++ programs cannot be built statically, with error like: mold: fatal: library not found: c++ Signed-off-by: Yao Zi <ziyao@disroot.org>
get_self_path() is used by `mold -run`, which is not available on macOS or Windows.
Support lto on mingw
It is not clearly defined when undefined weak symbols are resolved. It looks like there are two possible approaches: 1. Promote all weak undefined symbols to dynamic ones so that they'll have another chance to be resolved at load-time, or 2. Promote weak undefined symbols to dynamic ones only when there are definitions in other DSOs at link-time. (1) provides the maximum flexibility. For example, consider a main program that has a weak undefined symbol `foo` and there's no DSO that defines it at link-time. In (1), `foo` gets promoted to a dynamic symbol, so that one of its depending DSO is upgraded to define `foo`, the main executable's `foo` is resolved to that symbol at load-time. On the other hand, in (2), `foo` would have already been converted to an absolute symbol at address zero at link-time, so you need to rebuild the main executable to use the new definition of `foo` in the shared library. However, (1) is not compatible with copy relocations. This is because we need to know the size of the symbol when creating a copy relocation, but that information is not available unless we have a definition. It's also not compatible with canonical PLTs because canonical PLTs have non-zero addresses and therefore weak undefined symbols would always be resolved to non-zero addresses. As a workaround, GNU ld promotes weak undefs to dynamic symbols only when they don't need copy relocations or canonical PLTs. In other words, weak undef's behavior is different between -fPIC and -fno-PIC. In the former case, they become dynamic symbols, and vice versa. I don't think that workaround is a good one. So, mold took the second approach. There is, however, another thing to consider. What if we can find a defined symbol in a DSO that is specified as `-as-needed`? Previously, mold did not mark the library as "needed" and converted the weak undef into an absolute symbol. However, libstdc++ assumes that if weak undef symbol `__pthread_key_create` is not resolved, it assumes that multi-threading is not used in the executable, which resulted in a mis-detection with mold. Therefore, this patch changes the mold's behavior so that it makes weak undefs to keep DSOs "needed". Fixes #1286
I don't know why, but the previous regular expression didn't match with a line consisting just with "skipped".
Relax pcalau12i/addi.d to pcaddi
This should unbreak our buildbots.
It looks like emitting PCADDU18I + JIRL instead of just BL for function calls is a way to go, so we don't want to bother to maintain range extension thunks for the psABI. Since no other linkers support range extension thunks for LoongArch other than us, removing the support should be OK.
RISC-V uses these sections for small data/rodata/bss.
…r pcaddi (#1322) [LoongArch] support relaxation of pcalau12i/ld.d to pcalau12i/addi.d
It's not clear whether or not the option would be added to the GNU linker, so I"ll make this a hidden option for now. #1308
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )