[PATCH 2/2] z80-elf: support complex relocation symbols

H. Peter Anvin hpa@zytor.com
Sun Oct 26 19:37:38 GMT 2025


On 2025-10-26 08:02, Maciej W. Rozycki wrote:
> 
>  Possibly, though as usually with BFD I suspect there's a catch; also I 
> guess a lot of complication in the MIPS backend comes from the use of said 
> odd n64 encoding (triple relocs in a single Elf64_Rela entry).
> 

I have done it as a prototype, it is trivial, at least for i386. No problems
at all.

It is literally a matter of moving the zeroing of a variable out of a loop.

> >  And yet we don't have generic support for this stuff and moreover as new
> psABIs are invented people come up with zillions of complex relocation 
> operations while they could be composed with a bunch of basic ones, by 
> separating input and output data processing from each other.
> 
>  NB any target that has fields to relocate narrower than the width of 
> address ought to use the RELA format really.  Doing otherwise is asking 
> for trouble.  In reality this means REL is almost always suitable for 
> dynamic relocations only and for some targets possibly not even for that.
> 

Yes, and it has never been a problem on i386. This is an attempt at new usage,
and as I have already proposed, I think the right way to do it is by enabling
expression symbols instead.

Note that expression symbols are ALREADY enabled unconditionally in BFD and
the linker. It is only gas that has a compile-time on/off switch.

	-hpa



More information about the Binutils mailing list