[PATCH] [lld] Remove duplicate class definitions of ELF LinkingContexts

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sun Feb 22 08:16:02 PST 2015


On 22 February 2015 at 11:08, Shankar Easwaran
<shankar.kalpathi.easwaran at gmail.com> wrote:
> With hexagon the relocation encoding depends on the instruction. So when the relocation need to be applied the encoding mask has to be figured out from the instruction how it encodes the immediate bits.

That is a hexagon specific thing. Don't generalize it. I mean it in
two dimension:

* Don't assume other targets need the instruction encoding.
* Don't assume hexagon needs more than the encoding.

My preference would probably be to just duplicate the hexagon encoding
in lld for now. It is *far* easier to refactor duplicated code out
than it is to untangle bad dependencies.

Another option would be to create a llvm/lib/TargetInfo that doesn't
depend on the corresponding llvm/lib/Target. Having that, *only in the
case of hexagon* would *only the encoding* be moved to
llvm/lib/TargetInfo.

> In the case of LTO, it was needed that the linker needed information about target specific behavior to handle specific common symbols. As you mentioned generally it's not needed.

That is minuscule. Smaller than the odd r_info encoding on mips for example.

Cheers,
Rafael



More information about the llvm-commits mailing list