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

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

You can add a member function in the TargetHandler to override the dynamic table that the target wants to create.

Thanks

Shankar Easwaran

Thanks for the advice. I will use this approach.

Regards,
Simon