[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4 BFD relocation future

Clearly the current BFD relocation support is in bad shape. A wholescale rewrite would be very difficult, because it would require thorough testing of every BFD target. So some sort of incremental change is required.

My vague thoughts on this would involve defining a new, clearly defined, howto structure. Some mechanism would be used to determine which type of howto structure was being used by a particular format.

The new howto structure would clearly define the relocation behaviour in the case of an assembly, a relocatable link, and a final link. At least one special function would be defined as an escape, and it might make sense to define more.

One or more generic functions similar to `bfd_perform_relocation' would be written to handle the new howto structure.

This should make it possible to write a generic version of the relocate section functions used by the new linker. The target specific code would provide some mechanism (a function pointer or an initial conversion) to convert target specific relocations into howto structures.

Ideally it would be possible to use this generic relocate section function for the generic linker as well. That is, it would replace the `bfd_generic_get_relocated_section_contents' function which is currently normally used.

For the special case of ELF dynamic linking, more consideration needs to be given to writing ELF specific but ELF target generic code to handle special relocation types such as GOT and PLT.



This document was generated by system on December, 2 2004 using texi2html