Re: [PATCH v2 6/9] aarch64: Use symbols without offset to prevent relocation issues

2024-09-19 Thread Richard Sandiford
Richard Sandiford writes: > Evgeny Karpov writes: >> + { >> + rtx const_int = imm; >> + const_int = XEXP (const_int, 0); >> + XEXP (const_int, 1) = GEN_INT(const_offset % (1 << 20)); > > CONST_INTs are shared objects, so we can

Re: [PATCH v2 6/9] aarch64: Use symbols without offset to prevent relocation issues

2024-09-19 Thread Richard Sandiford
Evgeny Karpov writes: > The current binutils implementation does not support offset up to 4GB in > IMAGE_REL_ARM64_PAGEBASE_REL21 relocation and is limited to 1MB. > This is related to differences in ELF and COFF relocation records. > There are ways to fix this. This work on relocation change will

Re: [PATCH v2 6/9] aarch64: Use symbols without offset to prevent relocation issues

2024-09-19 Thread Martin Storsjö
On Thu, 19 Sep 2024, Richard Sandiford wrote: Martin Storsjö writes: On Thu, 12 Sep 2024, Evgeny Karpov wrote: The current binutils implementation does not support offset up to 4GB in IMAGE_REL_ARM64_PAGEBASE_REL21 relocation and is limited to 1MB. This is related to differences in ELF and C

Re: [PATCH v2 6/9] aarch64: Use symbols without offset to prevent relocation issues

2024-09-19 Thread Richard Sandiford
Martin Storsjö writes: > On Thu, 12 Sep 2024, Evgeny Karpov wrote: > >> The current binutils implementation does not support offset up to 4GB in >> IMAGE_REL_ARM64_PAGEBASE_REL21 relocation and is limited to 1MB. >> This is related to differences in ELF and COFF relocation records. > > Yes, I agre

Re: [PATCH v2 6/9] aarch64: Use symbols without offset to prevent relocation issues

2024-09-12 Thread Martin Storsjö
On Thu, 12 Sep 2024, Evgeny Karpov wrote: Thursday, September 12, 2024 Martin Storsjö wrote: This looks very reasonable - I presume this will make sure that you only use the other code form if the offset actually is larger than 1 MB. For the case when the offset actually is larger than 1 MB,

Re: [PATCH v2 6/9] aarch64: Use symbols without offset to prevent relocation issues

2024-09-12 Thread Martin Storsjö
On Thu, 12 Sep 2024, Evgeny Karpov wrote: The current binutils implementation does not support offset up to 4GB in IMAGE_REL_ARM64_PAGEBASE_REL21 relocation and is limited to 1MB. This is related to differences in ELF and COFF relocation records. Yes, I agree. But I would not consider this a

Re: [PATCH v2 6/9] aarch64: Use symbols without offset to prevent relocation issues

2024-09-06 Thread Martin Storsjö
On Fri, 6 Sep 2024, Evgeny Karpov wrote: Friday, September 6, 2024 Martin Storsjö wrote: Sorry, but no. You can't just redefine how relocations in your object file format works, just because you feel like it. This patch changes how symbol with offset will be emitted. It will change: adrp

Re: [PATCH v2 6/9] aarch64: Use symbols without offset to prevent relocation issues

2024-09-06 Thread Martin Storsjö
On Fri, 6 Sep 2024, Evgeny Karpov wrote: aarch64.cc has been updated to prevent emitting "symbol + offset" for SYMBOL_SMALL_ABSOLUTE for the PECOFF target. "symbol + offset" cannot be used in relocations for aarch64-w64-mingw32 due to relocation requirements. Instead, it will adjust the address