-
-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ELF] Make symbol resolution deterministic
Previously, our parallel symbol resolution algorithm was not deterministic in edge cases. As an example, consider the following two source files: foo.c: inline void fn1() { ... } bar.c: inline void fn1() { ... } void fn2() { ... } Let's say you compile these files and put them into an archive file. If mold decided to pull out `foo.o` first for `fn1` and then `bar.o` for `fn2`, then both `foo.o` and `bar.o` are included into a result. However, if mold pulled out `bar.o` first, then there's no chance for `foo.o` to be pulled out, so only `foo.o` would be included into a result. The algorithm implemented in this commit should be deterministic. We do not override symbols when we mark live objects.
- Loading branch information
Showing
4 changed files
with
113 additions
and
185 deletions.
There are no files selected for viewing
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
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
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
Oops, something went wrong.