This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Multiple relocation in ELF


Paul Koning <pkoning@equallogic.com> writes:

> >>>>> "Ian" == Ian Lance Taylor <iant@google.com> writes:
> 
>  Ian> Note that you can always do a jump table using a PC relative
>  Ian> relocation against a single symbol, plus an addend.  However, I
>  Ian> agree that in some cases it can be useful to be able to have a
>  Ian> relocation which represents the difference between two symbols.
>  Ian> I do question whether it is ever useful to have a relocation
>  Ian> which represents the sum of two symbols.
> 
> I don't have examples readily at hand.  However, what was then called
> "complex relocation" was supported, AND was used in real world
> software, in DEC assemblers going back all the way to Macro-11 back in
> 1974 or so.  In other words, ELF apparently has trouble representing
> things that other binary formats have handled for 30 years.

That is certainly true.  The IEEE object file format, for example, can
represent any arbitrary expression when computing relocations.

The ELF approach--a fixed set of relocations with predefined
algorithms--is used because it works for 99.99% of programs,
specifically including all pure C/C++ programs, and it permits the
linker to run faster.  And, of course, it is extensible when new
relocation algorithms are needed.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]