The Extension to ELF

Frank Ch. Eigler fche@redhat.com
Wed Aug 8 16:23:00 GMT 2012


Fumiaki Isoya <isoyaf@gmail.com> writes:

>> It may interest you to know that, for an older Cygnus project (mep),
>> we implemented a facility called computed/complex relocations, as an
>> ELF extension.  This is a way of encoding general symbol/arithmetic
>> expressions to be evaluated at link time and substituted into the
>> binary output.  [...]
>
> Did you write some compiler language to evaluate that feature?

No.  Software for this particular was mainly coded in assembly, and
the assembly language / instruction set were itself very
configurable(!), so relocations had to be general.  If this capability
is useful for a higher-level language, a binding would have to be
created, and the arch gas/binutils would have to start generating the
info.

> How is the idea of adopting it as the standard format of GNU Hurd?

I have no opinion on this.  Note though that these complex relocations
are encoded within a standard ELF file (merely using separate
relocation-type and symbol-type codes).  There is no need for an
OS/kernel to support it, since all the action takes place within the
assembler and linker.

- FChE



More information about the Gcc mailing list