This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: AARCH64 text start address: why so low?
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Matt Thomas <matt at 3am-software dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, binutils <binutils at sourceware dot org>
- Date: Tue, 21 Jan 2014 08:58:00 +0000
- Subject: Re: AARCH64 text start address: why so low?
- Authentication-results: sourceware.org; auth=none
- References: <209F1186-6425-4EB3-9DDE-7B7DCEAA8CE4 at 3am-software dot com> <CA+=Sn1kZ+qefjbUFWbMQBjzXG4=+rMeugawxpmtTrTkz9pUucA at mail dot gmail dot com> <CA+=Sn1n4pdVNYt1uPywRM+dYQ9By6PqPMd-ZDKnu5dmQcvs=Pw at mail dot gmail dot com> <02122130-BB33-47C4-ABEE-60219A716721 at 3am-software dot com>
Matt Thomas <matt@3am-software.com> writes:
> On Jan 20, 2014, at 7:51 PM, Andrew Pinski <pinskia@gmail.com> wrote:
>> On Mon, Jan 20, 2014 at 7:50 PM, Andrew Pinski <pinskia@gmail.com> wrote:
>>> On Mon, Jan 20, 2014 at 7:46 PM, Matt Thomas <matt@3am-software.com> wrote:
>>>>
>>>> As I was looking at the aarch64 text start address for Linux, I
>>>> wondered why it defaulted to 4MB (well within the first 4GB) instead
>>>> of (like alpha, mips64 elf, sparc64, hppa64, etc.) defaulting to a
>>>> starting address at or above 4GB.
>>>
>>> Because that is the default one for all elf files. x86_64 is the
>>> same as aarch64 here.
>>>
>>>>
>>>> Given there is a minimum of 39 address bits (512GB) of address space,
>>>> skipping first 4 GB shouldn't be a problem.
>>>
>>> I think it matters due to how the different code models work. The
>>> default code model is small which means fit in the lower 4 GB. This
>>> is just like x86_64's code models.
>>
>>
>> And just like MIPS64 msym32 code model which we had this same
>> discussion as we are having now for changing MIPS64 default load
>> address too.
Yeah. FWIW I'd still like to change the n64 default so that -msym32
"just works", but I held off because of Matt and Maciej's objections.
> I primarily thought -msym32 was for kernels, not userland. I did wonder
> about a -msym32 equivalent for aarch64.
No, -msym32 is also very useful for userland executables. It means that
locally-binding variables can be accessed using %hi/%lo rather than going
via the GOT.
And the PLT/copy-reloc extension builds on that by allowing the compiler
to assume that all variables bind locally, so that we only need the GOT
for TLS.
Thanks,
Richard