This repository has been archived by the owner on Jul 16, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arm64: relocatable: Tweak linker flags to yield a smaller Image with LLD
Currently, there is a regression of 689 KiB in Image.gz's size when the kernel is linked with LLD. This is reduced to 213 KiB when we use -pie rather than -shared when invoking the linker. Unfortunately, ld.bfd dislikes this change and regresses in size by 163 KiB with -pie as compared to using -shared. To address this problem, we add checks so that -pie is used with LLD and -shared is used with ld.bfd. That way, both linkers are able to perform their best. List of Image.gz sizes: ld.bfd -shared: 10,066,988 bytes ld.bfd -pie: 10,230,316 bytes LLD -shared: 10,796,872 bytes LLD -pie: 10,280,168 bytes Test: kernel compiles and boots with both ld.bfd and LLD Signed-off-by: Danny Lin <danny@kdrag0n.dev> [@0ctobot: Simplify checks so that ld.gold remains unaffected] Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
- Loading branch information