[LLVMdev] [lld] Add target-specific entries to the dynamic table

Simon Atanasyan simon at atanasyan.com
Tue Oct 8 12:42:37 PDT 2013


Hi,

I'm going to add MIPS target linking support to LLD. One of the things
I bumped into is the dynamic table. MIPS ABI declares many additional
mandatory dynamic table entries like DT_MIPS_LOCAL_GOTNO,
DT_MIPS_SYMTABNO etc. Some of these entries can be allocated and
initialized at once, other entries should be allocated in the
beginning and initialized at the end. For example we need to know the
number of GOT entries related to local symbols to set the
DT_MIPS_LOCAL_GOTNO value.

Current DynamicTable external interface is rather solid and allows
only combined allocation/initialization using DynamicTable::addEntry()
method.

So my question - what is the correct/best way to improve DynamicTable
interface and allow to add target-specific entries to the dynamic
table?

My current idea is to declare abstract base class
TargetDynTableHandler and factor out the dynamic table's entries
allocation/initialization to the successors of that class. Is it a
good way? Maybe it's over complicated.

Regards,
Simon



More information about the llvm-dev mailing list