[PATCH] D38238: [ELF] Add constant for querying the image base in linker scripts

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 02:34:34 PDT 2017


jhenderson added a comment.

In https://reviews.llvm.org/D38238#882941, @ruiu wrote:

> But I feel like I don't actually understand the problem you are working for. The -image-base option is a lld-specific option, so your program depends on lld. But you are worried that its linker script may not work with lld. That seems like a bit odd situation. Why can't you just update your linker script?


We have an existing linker, which uses linker scripts by default, and has options that as part of their mechanism change the base address. To avoid having different scripts (one for each different possible base address), we use something similar to the script extension suggested in this review. Our LLD port uses the --image-base mechanism (although not the switch directly) to achieve the change in base address, but we still plan to use linker scripts, so need to have something to avoid needing multiple different scripts. Having considered it, I think that the alternative change you propose should work for us as well. I will try experimenting with that.


https://reviews.llvm.org/D38238





More information about the llvm-commits mailing list