[PATCH] Linking of shared libraries for MIPS little-endian 32-bit target

Shankar Kalpathi Easwaran shankarke at gmail.com
Wed Nov 20 08:51:08 PST 2013



================
Comment at: lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h:39
@@ +38,3 @@
+private:
+  MipsGOT _got;
+};
----------------
Simon Atanasyan wrote:
> Simon Atanasyan wrote:
> > Michael Spencer wrote:
> > > This isn't a great place for this as it preserves atom pointers from a specific pass, which are not guaranteed to be stable. It seems that it's only used for the local and global offsets of the got. I think a better option here would be to calculate the offsets in the layout by iterating over the final .got MergedSection.
> > OK. I will fix that.
> It looks like my answer "I will fix that" was too optimistic.
> 
> I need to know a GOT content to perform the following actions:
> - Emit `DT_MIPS_LOCAL_GOTNO` (depends on number of local GOT entries) and `DT_MIPS_GOTSYM` (depends on number of global GOT entries) dynamic table tags.
> - Sort dynamic symbol table's atoms which have corresponding entries in the global part of GOT. The dynamic symbol entries should go at the same order as their GOT complements.
> - Initialize GOT entries related to the `R_MIPS_GOT16` relocation. These GOT entries should be initialized by values calculated during the `R_MIPS_GOT16` relocation processing. This action is not implemented in this patch.
> 
> Unfortunately I cannot figure out how to complete all these actions by iterating over the final .got MergedSection. Could you please provide more hints?
You could override createSection/createDynamicTable in the TargetLayout/TargetHandler respecitively. With this the Mips Target is in complete control of how the section gets written. Will this work ? 




http://llvm-reviews.chandlerc.com/D2156



More information about the llvm-commits mailing list