This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC PATCH] aarch64: ld: fix relaxations for ilp32 mode
- From: Yury Norov <ynorov at caviumnetworks dot com>
- To: Jiong Wang <jiong dot wang at foss dot arm dot com>
- Cc: <binutils at sourceware dot org>
- Date: Tue, 17 Jan 2017 14:18:19 +0530
- Subject: Re: [RFC PATCH] aarch64: ld: fix relaxations for ilp32 mode
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Yuri dot Norov at caviumnetworks dot com;
- References: <1484390890-20010-1-git-send-email-ynorov@caviumnetworks.com> <464a3e84-29c8-d746-9f8c-915f582ab5ad@foss.arm.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Mon, Jan 16, 2017 at 10:13:43AM +0000, Jiong Wang wrote:
> On 14/01/17 10:48, Yury Norov wrote:
> >Hi all,
> >
> >This patch continues the work of replacing 64-bit registers, offsets etc with
> >32-bit ones in elfNN_aarch64_tls_relax(). It doesn't fix any test I have tried,
> >but it's generally correct, and I think that it should be applied.
> >
> >I also added new tests for ilp32 mode, and the problem is that some fail. So I'd
> >like to ask for help here.
> >Namely, 3 new tests are failed. tls-relax-large-desc-ie-ilp32 and
> >tls-relax-large-desc-le-ilp32 fail due to error "cannot represent
> >BFD_RELOC_AARCH64_TLSDESC_OFF_G1 relocation in this object file format", and
> >test tls-desc-ie-ilp32 fails due to weird "undefined reference to `v2".
> >
> >If my understanding is correct, this error is because GAS cannot translate
> >assembler commands to machine codes properly. If so, it may happen with some real
> >program one day.
> >
> >It may also be my misunderstanding on how gas/ld work.
>
> The "undefined reference to v2" is caused by missing of "-shared" in your linker command.
Thank you, it works. My fail.
> BFD_RELOC_AARCH64_TLSDESC_OFF_G1 and the several other relocations in the
> error message are designed to be used by large code model only, so they are
> not expected to be generated under ILP32.
Hmm... Frankly, I don't understand how to proceed with that. The
simplest way is to drop that couple of tests and resend the patch.
But for me there's a problem here. If some asm file will contain the
instruction sequence like in those tests, compilation will fail. It
may come, say, from C inline asm, or whatsoever...
Maybe we should wrap that relocations with "#if ARCH_SIZE == 64 ... #endif"
like it has been done for BFD_RELOC_AARCH64_TLSG_MOW_G1 and
BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC?
BTW, is there some nice guide to linker internals, particularly to
relocations?
Yury