[PATCH] D14450: [ELF2] Add mandatory .dynamic section entries on MIPS.

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 02:09:27 PST 2015


ikudrin added inline comments.

================
Comment at: ELF/OutputSections.cpp:96-99
@@ +95,6 @@
+
+template <class ELFT>
+unsigned GotSection<ELFT>::getMipsLocalEntriesNum() const {
+  return Target->getGotHeaderEntriesNum();
+}
+
----------------
ruiu wrote:
> I don't know why you needed this function. If it's just a forwarder, why don't you call Target->getGotHeaderEntriesNum() instead of this function?
The Target->getGOTHeaderEntriesNum returns the number of the "reserved" GOT entries. This function returns the count of all entries of the local part of GOT, which contains not only the reserved entries but also entries for local symbols. So, the meanings are different.

Even though GotSection does not support entries for local symbols for now, the result is correct and we can use it to write the DT_MIPS_LOCAL_GOTNO dynamic section entry. When the support is added, we will have to update only this function, not DynamicSection::writeTo() method, so the changes will be more local.


http://reviews.llvm.org/D14450





More information about the llvm-commits mailing list