-
-
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] Do not create copy relocations if dynamic relocations suffice
We used to create copy relocations if we are creating a non-PIC executable and there's a direct reference to imported data. That works for most programs but not for GHC (Glasgow Haskell Compiler). GHC places function machine code and its supplimental data next to each other in the .text section. If we create a copy relocation for such function, the resulting executable won't work because (1) copy-relocated data is not executable and (2) it may separate the function code from its supplemental data. In this patch, I made a change so that mold creates dynamic relocations instead of copy relocations if possible.
- Loading branch information
Showing
3 changed files
with
64 additions
and
18 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