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

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 12:05:04 PDT 2016


Ed, do you know if the uses of -Ttext is FreeBSD are trying to set the
address of the text segment or just control the the lowest address in
the binary (i.e., set the address of the first segment)?

Cheers,
Rafael


On 8 July 2016 at 15:01, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
> On 8 July 2016 at 14:33, Petr Hosek via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>> 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.
>
> I see, so what you base is an option to set the smallest used virtual address.
>
>
>> 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.
>
> Rui, is there something like that for COFF? image-base is a COFF term, no?
>
> Another option name would be -Tbase, or -Tfirst_segment since the
> other options are -Txyz.
>
> Taking a look a the patch itself.
>
> Cheers,
> Rafael


More information about the llvm-commits mailing list