This is the mail archive of the binutils@sourceware.cygnus.com 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]

bfd_perform_relocation() and split fields


All,

The function bfd_perform_relocation() is oriented for inserting a resolved relocation into a contiguous set of bits. I find myself in perhaps a rather unique situation in which I need a resolved relocation to appear in two non-contiguous fields within an instruction, i.e. the most-significant portion of the reloc appears in field A, and the least-significant portion of the reloc appears in field B, where other bits separate field A from field B.

Function bfd_perform_relocation() as it stands today wont do this, so I have two options as I see it:

The pros to the first option is that everything is already in place to accomodate this! 8) The cons, on the other hand, mean defining two relocs for every case like this (of which I have many), which means it will take longer to link, for both static and dynamic links. It will also require more disk and/or memory space for the two-rather-than-one relocs (the amount of space may be insignificant since I haven't attempted to measure this yet).

The pros to the second option are that I can handle the reloc in one pass versus two, but the cons are mucking around with the machine-independent code to add a CPU hook in just the right place (in bfd_perform_relocation() and probably also the howto structure).

I'm leaning towards adding a CPU hook because:
- the relocs are already defined in the ABI
- gas is already done, so no need to muck with it to break the one reloc into two
- it makes more sense given the reloc definitions to do it once rather than in two
- this could become a useful general purpose feature???

These may be bad reasons, so ...

Anybody else ever had to do this?

Hints, suggestions, dos, donts?

Thanks in advance,
Eric


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