[PATCH] D22116: [ELF] Support for setting the base address

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 11:33:51 PDT 2016


phosek added a comment.

There are two issues here. The first is correctness, and you're right that for lld `-Trodata-segment` as an option for setting the start address would be better since lld puts rodata segment at the beginning. The other is compatibility, as large number of existing build scripts use `-Ttext-segment` as an option for setting the start address, irrespective of which linker is being used.

In our use case, we would like to have an option to set the start address in lld. Would it be fine with you if I rename the option to `-image-base`? This option is already supported by BFD ld, even though it's only used for PE targets, and OS X ld also has a similar option `-image_base`. Alternatively we could use a completely different name.

In the future, if it's needed by other users for backwards compatibility, we cam decide whether this option should be an alias for `-Trodata-segment` or `-Ttext-segment`, or other option.


http://reviews.llvm.org/D22116





More information about the llvm-commits mailing list